Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.

Slides:



Advertisements
Similar presentations
Spring 2013 Advising Starts this week! CS2710 Computer Organization1.
Advertisements

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.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Chapter 2: Data Representation
Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 2: Data Representation.
Lecture 16: Computer Arithmetic Today’s topic –Floating point numbers –IEEE 754 representations –FP arithmetic Reminder –HW 4 due Monday 1.
Floating Point Numbers
Faculty of Computer Science © 2006 CMPUT 229 Floating Point Representation Operating with Real Numbers.
1 IEEE Floating Point Revision Guide for Phase Test Week 5.
Floating Point Numbers
Floating Point Numbers. CMPE12cGabriel Hugh Elkaim 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or.
Floating Point Numbers. CMPE12cCyrus Bazeghi 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or 2 64.
1 Lecture 3 Bit Operations Floating Point – 32 bits or 64 bits 1.
Signed Numbers.
Floating Point Numbers
1 Lecture 4: Arithmetic for Computers (Part 5) CS 447 Jason Bakos.
1 Module 2: Floating-Point Representation. 2 Floating Point Numbers ■ Significant x base exponent ■ Example:
Floating Point Numbers
Computer Science 210 Computer Organization Floating Point Representation.
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
The IEEE Format for storing float (single precision) data type Use the “enter” key to proceed through the show.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patterson and Hennessy Text.
Binary Representation and Computer Arithmetic
Convert Decimal to Floating point number [IEEE 754]
IT 251 Computer Organization and Architecture Introduction to Floating Point Numbers Chia-Chi Teng.
Ch. 2 Floating Point Numbers
Information Representation (Level ISA3) Floating point numbers.
Number Systems II Prepared by Dr P Marais (Modified by D Burford)
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Negative and Floating Point.
Computing Systems Basic arithmetic for computers.
Data Representation - Part I. Representing Numbers Choosing an appropriate representation is a critical decision a computer designer has to make The chosen.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of Computer.
CSE 111 Representing Numeric Data in a Computer Slides adapted from Dr. Kris Schindler.
Floating Point Numbers Topics –IEEE Floating Point Standard –Rounding –Floating Point Operations –Mathematical properties.
Data Representation - Part II. Characters A variable may not be a non-numerical type Character is the most common non- numerical type in a programming.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
Floating Point (a brief look) We need a way to represent –numbers with fractions, e.g., –very small numbers, e.g., –very large numbers,
Fixed and Floating Point Numbers Lesson 3 Ioan Despi.
CSC 221 Computer Organization and Assembly Language
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Floating Point Representation.
COMP201 Computer Systems Floating Point Numbers. Floating Point Numbers  Representations considered so far have a limited range dependent on the number.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
Aim: How can we express a large or small number?
CSC 4250 Computer Architectures September 5, 2006 Appendix H. Computer Arithmetic.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: November 08, 2004 Lecture Number: 30.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Floating Point in Binary 1.Place Value Chart:
Floating Point Numbers Representation, Operations, and Accuracy CS223 Digital Design.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
Scientific Notation.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
Numbers in Computers.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
Floating Point. Binary Fractions. Fixed point representation Scientific Notation. Floating point Single precision, Double precision. Textbook Ch.4.8 (p )
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
Lecture 6: Floating Point Number Representation Information Representation: Floating Point Number Representation Lecture # 7.
Fixed-point and floating-point numbers Ellen Spertus MCS 111 October 4, 2001.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
Floating Point. Binary Fractions.
Introduction to Numerical Analysis I
Introduction To Computer Science
2.4. Floating Point Numbers
Scientific Notation.
Number Representations
Floating Point Numbers
Topic 3d Representation of Real Numbers
Number Representations
Presentation transcript:

Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text

Review Last time we looked at binary representations of floating point numbers and the IEEE 754 standard. This time we will continue with the IEEE Standard 754

IEEE Standard Recall that the IEEE Standard 754 denotes the standard representation for floating point numbers. 32 bit floating point numbers are represented in binary scientific notation. Recall that decimal floating point numbers are represented in scientific notation as follows: +/- x.xxxxx * 10 ^ +/- y Appropriate representations of x.xxxxx are between and Notice that 10.5 * 10 ^ 7 is an improper representation. The appropriate representation is 1.05 * 10^8 where x is the significand and y is the exponent. In binary, we may represent scientific notation as: +/- x.xxxxxx * 2 ^ +/- y sign-bitexponentsignificand 1-bit8-bit23-bit

Examples The sign bit denotes whether the significand is positive or negative The exponent is a biased binary number and may represent a value between -127 and 126 Biased binary numbers are those in which we have a range of numbers and choose a value to represent zero. All values greater than that point are positive. All less than that point are negative. Take 4 bit numbers as an example <-- -8d 0001 <-- -7d 0010 <-- -6d 0011 <-- -5d 0100 <-- -4d 0101 <-- -3d 0110 <-- -2d 0111 <-- -1d 1000 <-- 0d Notice that this representation is biased because we moved zero <-- 1d 1010 <-- 2d 1011 <-- 3d 1100 <-- 4d 1101 <-- 5d 1110 <-- 6d 1111 <-- 7d <- This value is used for infinity

Biased Representation A bias is an movement to one side or an offset. We offset our representation of zero by half of our range. This is useful in representing the exponent because it makes comparison of floating point values easy. The significand represents an unsigned binary value less than 2 decimal. Notice that thisvalue will always be greater than or equal to one unless it is zero. Therefore, we will ignorethe leading one in the significand. Simply put, the significand denotes the significant bits of the value we are trying to represent.

Examples Let's examine a decimal value. Take as an example. A binary representation of this value is as follows: b To convert this to IEEE Standard 754 representation, we move the decimal place to the left six places. Now the representation is as follows: b * 2d ^ 6d Using biased binary with 8 bits, our range starts at -127 (0x00) and goes to 126 (0xfe) 6d = 110b = 133 So, our representation of is b * 2d ^ 6d which is converted to b * 2d ^ b using biased binary. Our sign bit is 0 since we are using a positive number, so our representation is now: signexponentsignificand (23 bits) Notice that we dropped the leading one in the significand.

Examples Let's look at another example. Take as an example is converted as follows: 205 % 2 = % 2 = 0 51 % 2 = 1 25 % 2 = 1 12 % 2 = 0 6 % 2 = 0 3 % 2 = 1 1 Notice that 205d = * * > 0.6 * > 0.2 * * * > 0.6 * > 0.2 * * * > 0.6 * > 0.2 * * 2…. So, our result is

Representation Result is We then move the decimal point to the left by seven places yielding: * 2 ^ 7 Now our IEEE 754 representation is: signexponentsignificand For the exponent, the result is = 134 =

Zero and +/- Infinity In the IEEE standard zero is represented as follows: signexponentsignificand Positive Infinity is represented as: Negative Infinity is represented as: NAN – Not a Number xxxx xxxx xxxx xxxx xxxx xxx Where x’s are anything other than all zeroes.

More Examples Convert 204.5d to IEEE Format First, convert to binary b Then change the value to binary scientific format * 2^7 subtract bias of = 134 =

Example, Continued We assume the 1.0b is going to always be there so the result is: sign exponent significand x434C8000

Working Backwards from MIPS Using MIPS find the hex value of , (this is a float value) 0xBD5E7EA sign exponent significant = = x * 2^-5