Download presentation
Presentation is loading. Please wait.
1
Computer Architecture & Operations I
Instructor: Ryan Florin
2
Floating Point Numbers
Morgan Kaufmann Publishers 29 May, 2018 Floating Point Numbers 6.022 x 10^23 16.2 119 What do you call a decimal point in binary? Chapter 3 — Arithmetic for Computers
3
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 => x 10^2 => 5.85 x 10^-5
4
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. => x 2^2 .05 => 1.6 x 2^-5
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 = a = 1.71 1.71 x 2^2
6
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
7
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 ( ) Fraction = 1.57
8
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 = Fraction:
9
Single Precision Example: 3.14 Sign bit: 0 Exponential: 1000 0000
Fraction:
10
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
11
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 = / 2^-9 = 1.28 Exponential = -9 + bias = 1014( ) Fraction = 1.28
12
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 =
13
Double Precision Example: .0025 Sign bit: 0 Exponential: 011 1111 0110
Fraction:
14
Reverse Process Example: 412C000016 0100 0001 0010 1100 0000 0000 0000
Sign bit: 0 Positive Exponential: 130 – 127 = 3 Fraction: = = x 23 = 10.75
15
What I want you to do Review Chapters 3.5 Review Midterm II
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.