Number Representation Part 2 Little-Endian vs. Big-Endian Representations Floating Point Representations ECE 645: Lecture 5.

Slides:



Advertisements
Similar presentations
Fixed Point Numbers The binary integer arithmetic you are used to is known by the more general term of Fixed Point arithmetic. Fixed Point means that we.
Advertisements

Arithmetic in Computers Chapter 4 Arithmetic in Computers2 Outline Data representation integers Unsigned integers Signed integers Floating-points.
Fabián E. Bustamante, Spring 2007 Floating point Today IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Next time.
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
© David Kirk/NVIDIA and Wen-mei W. Hwu, 2007 ECE 498AL, University of Illinois, Urbana-Champaign 1 ECE 498AL Lecture 11: Floating-Point Considerations.
Lecture 2 Addendum Rounding Techniques ECE 645 – Computer Arithmetic.
Topics covered: Floating point arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Datorteknik FloatingPoint bild 1 Floating point Number system corresponding to the decimal notation 1,837 * 10 significand exponent a great number of corresponding.
University of Washington Today Topics: Floating Point Background: Fractional binary numbers IEEE floating point standard: Definition Example and properties.
CSE 378 Floating-point1 How to represent real numbers In decimal scientific notation –sign –fraction –base (i.e., 10) to some power Most of the time, usual.
1 Error Analysis Part 1 The Basics. 2 Key Concepts Analytical vs. numerical Methods Representation of floating-point numbers Concept of significant digits.
Floating Point Numbers
+ CS 325: CS Hardware and Software Organization and Architecture Integers and Arithmetic Part 4.
Numerical Computations in Linear Algebra. Mathematically posed problems that are to be solved, or whose solution is to be confirmed on a digital computer.
Data Representation – Binary Numbers
Information Representation (Level ISA3) Floating point numbers.
Computer Organization and Architecture Computer Arithmetic Chapter 9.
CEN 316 Computer Organization and Design Computer Arithmetic Floating Point Dr. Mansour AL Zuair.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Negative and Floating Point.
Fixed-Point Arithmetics: Part II
Number Systems So far we have studied the following integer number systems in computer Unsigned numbers Sign/magnitude numbers Two’s complement numbers.
Computing Systems Basic arithmetic for computers.
Number Representation Part 2 Little-Endian vs. Big-Endian Representations Floating Point Representations Rounding Representation of the Galois Field elements.
Number Representation Part 2 Floating Point Representations Little-Endian vs. Big-Endian Representations Galois Field Representations ECE 645: Lecture.
Digital DesignFloating-Point Number-0 CS3104: 數位系統導論 Principles of Digital Design [project2] floating-point number addition 吳中浩 教授 助教 高鵬程 國立清華大學資訊工程學系.
1 Number Systems Lecture 10 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
Number Representation Part 2 Fixed-Radix Signed Representations Floating Point Representations Little-Endian vs. Big-Endian Representations Galois Field.
Computer Arithmetic Floating Point. We need a way to represent –numbers with fractions, e.g., –very small numbers, e.g., –very large.
ECE 645 – Computer Arithmetic Lecture 2: Number Representations (2) ECE 645—Computer Arithmetic 1/29/08.
Computer Architecture Lecture 22 Fasih ur Rehman.
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Floating Point Numbers Representation, Operations, and Accuracy CS223 Digital Design.
Number Representation Part 2 Floating Point Representations Rounding Representation of the Galois Field elements ECE 645: Lecture 5.
Number Representation Fixed and Floating Point
1/25/02CSE Number Representations Number Representations XVII times LIX CLXX -XVII D(CCL)LL DCCC LLLL X-X X-VII = DCCC CC III = MIII X-VII = VIIIII-VII.
Sources of Computational Errors FLP approximates exact computation with real numbers Two sources of errors to understand and counteract: 1. Representation.
Answer CHAPTER FOUR.
CSCI206 - Computer Organization & Programming
Introduction to Numerical Analysis I
Floating Point Representations
Part III The Arithmetic/Logic Unit
2.4. Floating Point Numbers
Recitation 4&5 and review 1 & 2 & 3
Integer Division.
Topics IEEE Floating Point Standard Rounding Floating Point Operations
CS 105 “Tour of the Black Holes of Computing!”
Fixed-Point Representations.
Floating Point Number system corresponding to the decimal notation
CS 367 Floating Point Topics (Ch 2.4) IEEE Floating Point Standard
Number Representation
CSCE 350 Computer Architecture
CSCI206 - Computer Organization & Programming
How to represent real numbers
Approximations and Round-Off Errors Chapter 3
Floating Point Arithmetic August 31, 2009
Faculty of Cybernetics, Statistics and Economic Informatics –
UNIVERSITY OF MASSACHUSETTS Dept
UNIVERSITY OF MASSACHUSETTS Dept
UNIVERSITY OF MASSACHUSETTS Dept
CS 105 “Tour of the Black Holes of Computing!”
Review In last lecture, done with unsigned and signed number representation. Introduced how to represent real numbers in float format.
COMS 161 Introduction to Computing
UNIVERSITY OF MASSACHUSETTS Dept
Lecture 9: Shift, Mult, Div Fixed & Floating Point
CS 105 “Tour of the Black Holes of Computing!”
Presentation transcript:

Number Representation Part 2 Little-Endian vs. Big-Endian Representations Floating Point Representations ECE 645: Lecture 5

Required Reading Endianness, from Wikipedia, the free encyclopedia Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware Design Chapter 17, Floating-Point Representations

Little-Endian vs. Big-Endian Representation of Integers

Little-Endian vs. Big-Endian Representation A0 B1 C2 D3 E4 F LSB MSB MSB = A0 B1 C2 D3 E4 F5 67 LSB = 89 Big-Endian Little-Endian LSB = 89 0 MAX 67 F5 E4 D3 C2 B1 MSB = A0 address

Little-Endian vs. Big-Endian Camps Big-Endian Little-Endian 0 MAX address MSB LSB... LSB MSB... Motorola 68xx, 680x0 Intel IBM Hewlett-Packard DEC VAX Internet TCP/IP Sun SuperSPARC Bi-Endian Motorola Power PC Silicon Graphics MIPS RS 232 AMD

Origin of the terms Little-Endian vs. Big-Endian Jonathan Swift, Gulliver’s Travels A law requiring all citizens of Lilliput to break their soft-eggs at the little ends only A civil war breaking between the Little Endians and the Big-Endians, resulting in the Big Endians taking refuge on a nearby island, the kingdom of Blefuscu Satire over holy wars between Protestant Church of England and the Catholic Church of France

Little-Endian vs. Big-Endian Big-EndianLittle-Endian easier to determine a sign of the number easier to compare two numbers easier to divide two numbers easier to print easier addition and multiplication of multiprecision numbers Advantages and Disadvantages

Pointers (1) F5 E4 D3 C2 B1 A0 Big-Endian Little-Endian 0 MAX address int * iptr; (* iptr) = 8967;(* iptr) = 6789; iptr+1

Pointers (2) F5 E4 D3 C2 B1 A0 Big-Endian Little-Endian 0 MAX address long int * lptr; (* lptr) = 8967F5E4;(* lptr) = E4F56789; lptr + 1

Floating Point Representations

The ANSI/IEEE standard floating- point number representation formats Originally IEEE Superseded by IEEE Standard.

Table 17.1 Some features of the ANSI/IEEE standard floatingpoint number representation formats

00017FFEFF7E – –1+1 Decimal code Hex code Exponent value f = 0: Representation of  0 f  0: Representation of denormals, 0.f  2 –126 f = 0: Representation of  f  0: Representation of NaNs Exponent encoding in 8 bits for the single/short (32-bit) ANSI/IEEE format 1.f  2 e Exponent Encoding

Fig Denormals in the IEEE single-precision format.

The IEEE standard includes five rounding modes: Round to nearest, ties away from 0 (rtna) Round to nearest, ties to even (rtne) [default rounding mode] Round toward zero (inward) Round toward +  (upward) Round toward –  (downward) Rounding Modes

Round to Nearest Number Fig Rounding of a signed- magnitude value to the nearest number. Rounding has a slight upward bias. Consider rounding (x k–1 x k–2... x 1 x 0. x –1 x –2 ) two to an integer (y k–1 y k–2... y 1 y 0. ) two The four possible cases, and their representation errors are: x –1 x –2 Round Error 00 down 0 01 down– up up 0.25 With equal prob., mean = For certain calculations, the probability of getting a midpoint value can be much higher than 2 –l rtna(x)

Directed Rounding: Motivation We may need result errors to be in a known direction Example: in computing upper bounds, larger results are acceptable, but results that are smaller than correct values could invalidate the upper bound This leads to the definition of directed rounding modes upward-directed rounding (round toward +  ) and downward-directed rounding (round toward –  ) (required features of IEEE floating-point standard)

Directed Rounding: Visualization Fig Upward-directed rounding or rounding toward + . Fig Truncation or chopping of a 2’s-complement number (same as downward- directed rounding).

Requirements for Arithmetic Results of the 4 basic arithmetic operations (+, , ,  ) as well as square- rooting must match those obtained if all intermediate computations were infinitely precise That is, a floating-point arithmetic operation should introduce no more imprecision than the error attributable to the final rounding of a result that has no exact representation (this is the best possible) Example: (1 + 2  1 )  (1 + 2  23 ) Rounded result1 + 2   22 Error = ½ ulp Exact result1 + 2    24

New IEEE Standard Basic Formats

New IEEE Standard Binary Interchange Formats