Docsity

Floating Point Arithmetic: Multiply, Divide, Add and Subtract, Study notes of Computer Science

Partial preview of the text

Download Floating Point Arithmetic: Multiply, Divide, Add and Subtract and more Study notes Computer Science in PDF only on Docsity!

Floating Point ArithmeticFloating Point Arithmetic

September 25, 2000September 25, 2000

CSC201 Section 002

Fall, 2000

Floating Point Multiply Floating Point Multiply

  • Steps
    • Multiply (unsigned) mantissas
    • add exponents
    • set sign of result
    • normalize
  • Overflow: possible, but we’ll skip it!

(normalized) 1 +3 1.010..

(unnormalized) 1 +2 10.10..

*****^1 -2 1.10…

Exponent Mantissa (decimal)

Sign

Floating Point Addition Floating Point Addition

  • Steps
    • Align smaller exponent with larger
    • Add (unsigned) mantissas
    • normalize
    • set sign of result
  • Overflow: possible, but skip it!

+^0 +6 .0110.. (normalized) 0 +6 1.100…

+^0 +4 1.100…

Exponent Mantissa (decimal)

Sign

Floating Point Subtract Floating Point Subtract

  • Skip it!