0% found this document useful (0 votes)
3 views

CSE_321_4_5

Uploaded by

mmufrat1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

CSE_321_4_5

Uploaded by

mmufrat1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Arithmetic for Computers

Chapter -4
(Continuation)
4.8 Floating Point
• Real numbers:
• 3.14159265…. ()
• 2.71828… (e)
• 0.000000001 or 1.0 × 10-9 (seconds in a
nanosecond)
• 3,155,760,000 or 3.15576 × 109 (seconds in a
century)

• Scientific Notation
4.8 Floating Point

• Normalized numbers:
• A number in scientific notation that has no
leading zeros.
• 1.0 × 10-9

×
• 0.1 × 10-8
• 10.0 × 10-10
4.8 Floating Point

• Binary numbers in scientific notation:

• 1.0 × 2-1

Binary Point

• 1. xxxxxxxx × 2yyyy
• Computer arithmetic that support such numbers is
called floating point because it represents numbers in
which the binary point is not fixed.
4.8 Floating Point

• A standard scientific notation for reals in


normalized form offers three advantages:
– It simplifies exchange of data that includes floating-
point numbers
– It simplifies the floating-point arithmetic algorithms
to know that numbers will always be in this form
– It increases the accuracy of the numbers that can
be stored in a word
Floating Point Representation
• Single precision
• Sign and magnitude representation
3130292827262524232221201918171615141312 11 10 9 8 7 6 5 4 3 2 1 0
s exponent significand
1 bit 8 bits 23 bits
• (-1)S × F × 2E
• S – sign
• F – significand
• E – exponent
Floating Point Representation
• Single precision
• Sign and magnitude representation
3130292827262524232221201918171615141312 11 10 9 8 7 6 5 4 3 2 1 0
s exponent significand
1 bit 8 bits 23 bits
• (-1)S × F × 2E
• As small as 2.0ten × 10 -38
• As large as 2.0ten × 10 38
• Overflow: exponent is too large to fit in the exponent field
• Underflow: negative exponent is too large to fit … … …
Floating Point Representation
• Double precision
3130292827262524232221201918171615141312 11 10 9 8 7 6 5 4 3 2 1 0
s exponent significand
1 bit 11 bits 20 bits
3130292827262524232221201918171615141312 11 10 9 8 7 6 5 4 3 2 1 0
Significand (Continued)
32 bits

• (-1)S × F × 2E
• As small as 2.0ten × 10 -308
• As large as 2.0ten × 10 308
Floating Point Representation
• Double precision

• IEEE 754
• (-1)S × (1 + Significand) × 2E
• (-1)S × (1 + (s1 × 2-1) + (s2 × 2-2) + … … ) × 2E
3130292827262524232221201918171615141312 11 10 9 8 7 6 5 4 3 2 1 0
s exponent significand
1 bit 11 bits 20 bits
3130292827262524232221201918171615141312 11 10 9 8 7 6 5 4 3 2 1 0
Significand (Continued)
32 bits
Floating Point Representation
• When we want to represent zero (0)

• (-1)S × (1 + Significand) × 2E
• (-1)S × (1 + (s1 × 2-1) + (s2 × 2-2) + … … ) × 2E
31 3029 2827 2625 2423 2221 2019 1817 16151413 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

• 1+0=1
Floating Point Representation
• Biased Notation
• A = 1.0 × 2-1, B = 1.0 × 2+1, Whether A>B or not
• 1.0 × 2-1
31 3029 2827 2625 2423 2221 2019 1817 16151413 12 11 10 9 8 7 6 5 4 3 2 1 0
0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

• 1.0 × 2+1
31 3029 2827 2625 2423 2221 2019 1817 16151413 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

• -1  -1 + 127 = 126
• +1  +1 + 127 = 128
• (-1)S × (1 + Significand) × 2(Exponent – Bias)
• For Double Precision bias is 1023

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy