Download presentation
Presentation is loading. Please wait.
1
CSCI206 - Computer Organization & Programming
Floating Point Arithmetic zyBook: 10.9, 10.10
2
Review IEEE754 S Exponent Mantissa
Special values, else normalized numbers Exponent Mantissa (fraction) Value +/- zero nonzero denormalized number all 1’s +/- infinity NaN (not a number)
3
Floating Point Addition
Match exponents Add the significants Normalize the sum Check overflow/underflow Round Done
4
FP Addition Example Show the FP addition of: using 4 bits of precision
5
FP Addition Example Show the FP addition of:
6
1. Match Exponents larger exponent is , rewrite
shift number right, increment exponent shift number left, decrement exponent 1. Match Exponents larger exponent is , rewrite
7
2. Add
8
3. Renormalize (nothing to do in this example)
9
4. Check overflow/underflow
(nothing to do in this example)
10
5. Round 6. Done (check) (nothing to do in this example)
= 6. Done (check)
11
Accurate Arithmetic IEEE754 guarantees accuracy within 0.5 ulp (units in last place) error is no more than ½ of least significant digit To achieve this, 3 extra bits are added to the fractional part in arithmetic, they are called: guard, round, and sticky bits (from most significant to least).
12
Guard, Round, Sticky Guard and round bits act like any other bit to to the right of the decimal. The sticky bit is set if any nonzero value to the right of this place has ever existed. once set, it stays set (it’s sticky)
13
Addition Example with GRS
Use 4-bits of precision plus GRS 5. Round GRS: 111 rounds up: 1. Normalize: G GRS Nonzero value to right of round bit, so SET sticky bit 2. Add: GRS
15
Multiplication Similar to addition Add exponents Multiply significands
Normalize Check/round Set sign
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.