Computer Architecture & Operations I

Slides:



Advertisements
Similar presentations
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved Floating-point Numbers.
Advertisements

Chapter 5 Floating Point Numbers. Real Numbers l Floating point representation is used whenever the number to be represented is outside the range of integer.
Computer Science 210 Computer Organization Floating Point Representation.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Number Systems II Prepared by Dr P Marais (Modified by D Burford)
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
9.4 FLOATING-POINT REPRESENTATION
1 Number Systems Lecture 10 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Floating Point in Binary 1.Place Value Chart:
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale Floating point arithmetic.
Fixed-point and floating-point numbers Ellen Spertus MCS 111 October 4, 2001.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
CSCI206 - Computer Organization & Programming
Floating Point. Binary Fractions.
Floating Points & IEEE 754.
Floating Point Numbers
Floating Point Representations
Computer Architecture & Operations I
Computer Science 210 Computer Organization
Introduction To Computer Science
What does science have to do with math???
Floating Point Representations
CSCI206 - Computer Organization & Programming
Number Systems and Binary Arithmetic
Computer Architecture & Operations I
Numbers in a Computer Unsigned integers Signed magnitude
Floating Point Number system corresponding to the decimal notation
CS 232: Computer Architecture II
Computer Architecture & Operations I
Morgan Kaufmann Publishers
April 2006 Saeid Nooshabadi
Scientific Notation (small numbers)
PRESENTED BY J.SARAVANAN. Introduction: Objective: To provide hardware support for floating point arithmetic. To understand how to represent floating.
William Stallings Computer Organization and Architecture 7th Edition
Arithmetic for Computers
Topic 3d Representation of Real Numbers
Scientific Notation.
Luddy Harrison CS433G Spring 2007
CSCI206 - Computer Organization & Programming
Scientific Notation.
Number Representations
Systems Architecture I
Data Representation Data Types Complements Fixed Point Representation
EEL 3705 / 3705L Digital Logic Design
Floating Point Representation
CSCI206 - Computer Organization & Programming
Scientific Notation.
Computer Science 210 Computer Organization
Arithmetic Logical Unit
Chapter Ten Exponents and Scientific Notation
How to represent real numbers
October 17 Chapter 4 – Floating Point Read 5.1 through 5.3 1/16/2019
Number Representation
Scientific Notation.
The ability to write all numbers between 1 and 10.
Representation of real numbers
Systems Architecture I
Morgan Kaufmann Publishers Arithmetic for Computers
COMS 161 Introduction to Computing
Topic 3d Representation of Real Numbers
Floating Point Numbers
CS 286 Computer Architecture & Organization
Scientific Notation EXPONENTS X10.
SCIENTIFIC NOTATION ... a way to express very small or very large numbers that is often used in "scientific" calculations where the analysis must be very.
Numbers with fractions Could be done in pure binary
OBJECTIVES After reading this chapter, the reader should be able to :
Number Representations
Scientific notation: positive exponent
Lecture 9: Shift, Mult, Div Fixed & Floating Point
Presentation transcript:

Computer Architecture & Operations I Instructor: Ryan Florin

Floating Point Numbers Morgan Kaufmann Publishers 29 May, 2018 Floating Point Numbers 3.1415926535897 6.022 x 10^23 16.2 119 What do you call a decimal point in binary? Chapter 3 — Arithmetic for Computers

Scientific Notation (base 10) Takes the form: a x 10^b Normalized form ensures there is only 1 non-zero number to the left of the decimal point. 300 => 3.0 x 10^2 142.001 => 1.42001 x 10^2 .0000585 => 5.85 x 10^-5

Scientific Notation (base 2) Takes the form a X 2^b Normalized form ensures there is only 1 non-zero number to the left of the “binary” point. -6.84 => -1.71 x 2^2 .05 => 1.6 x 2^-5

Normalizing binary R = a x 2^b Step 1: Find the power of 2 that is the closest to the number without going over. This is the value of b. Step 2: divide R by 2^b to get the value of a. Example: 6.84 Step 1: b = 2 (2^2 = 4) Step 2: 6.84 / 4 = 1.71 a = 1.71 1.71 x 2^2

IEEE 754 Single Precision (-1)signbit x (1 + fraction) x 2 exponent – bias Single Precision bias: 127 Range: 2^128 – 2^-127 Precision: ~7 digits

Single Precision Example: 3.14 3.14 is positive. Sign bit = 0 a x 2^b 3.14 is between 2^1 and 2^2 (2 and 4) a = 3.14 / 2 = 1.57 Exponential = 1 + bias = 128 (10000000) Fraction = 1.57

Single Precision Example: 3.14 Fraction = 1.57 Due to being normalized, there will always be a 1 to the left of the binary point. It is assumed to be a 1. Represent the rest (.57) using negative powers of 2 .57 = 2-1 + 2-4 + 2-8 + 2-9 + 2-10 + 2-11 + 2-13 + 2-15 + 2-16 + 2-17 + 2-22 Fraction: 10010001111010111000010

Single Precision Example: 3.14 Sign bit: 0 Exponential: 1000 0000 Fraction: 100 1000 1111 0101 1100 0010 0100 0000 0100 1000 1111 0101 1100 0010

IEEE 754 Double Precision (-1)signbit x (1 + fraction) x 2 exponent – bias Double Precision bias: 1023 Range: 2^1024 – 2^-1023 Precision: ~16 digits

Double Precision Example: .0025 .0025 is positive. Sign bit = 0 a x 2^b b = -9: .0025 is between 2^-9 and 2^-8 (.002 and .004) a = .0025 / 2^-9 = 1.28 Exponential = -9 + bias = 1014(11 1111 0110) Fraction = 1.28

Double Precision Example: .0025 Fraction = 1.28 Due to being normalized, there will always be a 1 to the left of the binary point. It is assumed to be a 1. Represent the rest (.28) using negative powers of 2 .28 = 0100 0111 1010 1110 0001 0100 0111 1010 1110 0001 0100 0111 1011

Double Precision Example: .0025 Sign bit: 0 Exponential: 011 1111 0110 Fraction: 0011 1111 0110 0100 0111 1010 1110 0001 0100 0111 1010 1110 0001 0100 0111 1011

Reverse Process Example: 412C000016 0100 0001 0010 1100 0000 0000 0000 Sign bit: 0 Positive Exponential: 1000 0010 130 – 127 = 3 Fraction: 010 1100 0000 0000 0000 2-2 + 2-4 + 2-5 = .5 + .0625 + .03125 = .34375 1.34375 -10 + 1.34375 x 23 = 10.75

What I want you to do Review Chapters 3.5 Review Midterm II