Floating Point Addition and Subtraction Algorithm
Floating Point Addition and Subtraction Algorithm
x
The scientific notation for floating point is : m × r
The floating point is said to be normalized only if the
most significant digit is non-zero.
0036525 Notanormalizedvalue
.36525×
105 Anormalizedvalue
.00110101 Notanormalizedvalue
.110101 × 2-2 Anormalizedvalue
Biased Exponent
The bias is the number that is added to each exponent as the floating
number is formed, so that internally all exponent are positive.
Bs B b
As A1 A a
Qs Q q
0 ≠0 ≠0
BR AC
0
AC ← BR
Add
OP
Sub
AS ← `A s
A,B ≠ 0
a< a:b
a>
b b
a=b
Shr A Shr B
a←a+1 b←b+1
a=b
Sub Add
op
1 1
As Bs As Bs
0 0
EA ← A + B` + 1 EA ← A+B
=0 0
E E
EA ← A` + 1
As ← As`
= =
1 Shr A1
=0
≠0 A A1 ← E
a←a+1
=0 =
A1 1
AC ←0
Shl A
a←a-1
END
B. Vishnu Vardhan Assist. Professor VITW, Enikepadu
Addition and Subtraction of floating-point number
=0 ≠0 ≠0
BR AC
a< a>
=0 b a :b
b
AC←BR
Shr A a:b Shr B
a ← a+1 a ← a+1
Add
AC
Subtract Add
Sub op
=0
As ← As =1 =0
EA ← A+B`+1 As סּBs =1 As סּBs
Shr A =0 EA ← A+B
A ← A`+1 E =0
=1 A
As ← A`s
E
≠0 AC ← 0
=0 A1 =1 Shr A
A1←E
Shl A a ← a+1
a ← a-1
End
B. Vishnu Vardhan Assist. Professor VITW, Enikepadu