Fixed-point and floating-point numbers Ellen Spertus MCS 111 October 4, 2001.

Slides:



Advertisements
Similar presentations
Fixed-point and floating-point numbers CS370 Fall 2003.
Advertisements

Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved Floating-point Numbers.
CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (2)
Floating Point Numbers. CMPE12cGabriel Hugh Elkaim 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or.
Computer ArchitectureFall 2007 © September 5, 2007 Karem Sakallah CS 447 – Computer Architecture.
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.
Booth’s Algorithm.
1 Lecture 3 Bit Operations Floating Point – 32 bits or 64 bits 1.
Floating Point Numbers
1 Module 2: Floating-Point Representation. 2 Floating Point Numbers ■ Significant x base exponent ■ Example:
Floating Point Numbers
Computer ArchitectureFall 2008 © August 27, CS 447 – Computer Architecture Lecture 4 Computer Arithmetic (2)
Computer Science 210 Computer Organization Floating Point Representation.
Lecture 8 Floating point format
Binary Representation and Computer Arithmetic
The Binary Number System
Ch. 2 Floating Point Numbers
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
Computer Arithmetic Nizamettin AYDIN
Computer Arithmetic. Instruction Formats Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Number Systems So far we have studied the following integer number systems in computer Unsigned numbers Sign/magnitude numbers Two’s complement numbers.
Ellen Spertus MCS 111 October 11, 2001 Floating Point Arithmetic.
Computer Architecture
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.
S. Rawat I.I.T. Kanpur. Floating-point representation IEEE numbers are stored using a kind of scientific notation. ± mantissa * 2 exponent We can represent.
Floating Point (a brief look) We need a way to represent –numbers with fractions, e.g., –very small numbers, e.g., –very large numbers,
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
9.4 FLOATING-POINT REPRESENTATION
Fixed and Floating Point Numbers Lesson 3 Ioan Despi.
COMP201 Computer Systems Floating Point Numbers. Floating Point Numbers  Representations considered so far have a limited range dependent on the number.
1 Number Systems Lecture 10 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
Floating Point Arithmetic
Lecture notes Reading: Section 3.4, 3.5, 3.6 Multiplication
Fractions in Binary.
CSPP58001 Floating Point Numbers. CSPP58001 Floating vs. fixed point Floating point refers to a binary decimal representation where there is not a fixed.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Computer Engineering FloatingPoint page 1 Floating Point Number system corresponding to the decimal notation 1,837 * 10 significand exponent A great number.
Floating Point in Binary 1.Place Value Chart:
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Data Representation: Floating Point for Real Numbers Computer Organization and Assembly Language: Module 11.
Floating Point Numbers
IT11004: Data Representation and Organization Floating Point Representation.
Numbers in Computers.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
Representation of Data (Part II) Computer Studies Notes: chapter 19 Ma King Man.
10/7/2004Comp 120 Fall October 7 Read 5.1 through 5.3 Register! Questions? Chapter 4 – Floating Point.
Software Design and Development Storing Data Computing Science.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
CSCI206 - Computer Organization & Programming
Introduction To Computer Science
Floating Point Number system corresponding to the decimal notation
Luddy Harrison CS433G Spring 2007
CSCI206 - Computer Organization & Programming
Number Representations
Floating Point Representation
Computer Science 210 Computer Organization
Floating Point Arithmetic
COMS 161 Introduction to Computing
Numbers with fractions Could be done in pure binary
Number Representations
Floating Point Arithmetic
Presentation transcript:

Fixed-point and floating-point numbers Ellen Spertus MCS 111 October 4, 2001

Representations of numbers Unsigned integers Signed integers  Fixed-point numbers  Floating-point numbers

Base-10 (decimal) arithmetic Uses the ten numbers from 0 to 9 Each column represents a power of 10

Base-10 (decimal) arithmetic Uses the ten numbers from 0 to 9 Each column represents a power of 10

Standard binary representation Uses the two numbers from 0 to 1 Every column represents a power of 2

Fixed-point representation Uses the two numbers from 0 to 1 Every column represents a power of 2

Addition Base-10Base-2

Conversion to base 10

Questions about binary data Is it signed or unsigned? What exponent is used for each place?

Range of values in a byte

Scientific notation (1) One billion =1,000,000,000 =1 x 10 9 –significand or mantissa: 1 –base or radix: 10 –exponent: 9

Scientific notation (2) 1999 =1.999 x 10 3 –significand or mantissa: 1999 –base or radix: 10 –exponent: 3 =19.99 x 10 =199.9 x 10

Practice (base 10)

Base-2 scientific notation 2.25 ten =10.01 two =10.01 two x 2 0 =1.001 two x 2 1  normalized

8-bit floating point format (1) Note: This isn’t a standard format. It’s just for teaching purposes.

Improvements Bias the exponent –Always subtract a fixed amount, e.g., 3 –Allows representation of negative exponents Implicit one –What’s the Mills phone number? –Why use a bit for the leading one?

8-bit floating-point format (2) Exponent (3 bits) is biased by 3 The leading one of significand is implicit Zero is represented by all zeros

IEEE standard floating-point Single precision –32 bits sign: 1 bit exponent: 8 bits significand: 23 bits –Bias: 127 Double precision –64 bits sign: 1 bit exponent: 11 bits significand: 52 bits –Bias: 511

Practice 13 ten 1.25 ten 257 ten