Docsity

IEEE 754 Computer Arithmetic: Single Precision and Exceptions, Slides of Computer Aided Design (CAD)

Partial preview of the text

Download IEEE 754 Computer Arithmetic: Single Precision and Exceptions and more Slides Computer Aided Design (CAD) in PDF only on Docsity!

Computer Arithmetic

Integer and Fixed Point

Single Precision IEEE 754 Example (1)

Ex : 3.8125 10 = +1.11101 * 2^1

  • Sign is 0 (bit position 31  MSB)
  • Exponent is 1 0 0 0 0 0 0 0 (underlined above)
    • 0111 1111 + 0000 0001 = 1000 0000
  • Mantissa is 1.1110100…0 (the leading 1 is assumed in the representation above)
  • That’s +1.11101 * 2(128-127)^ = 1.90625 10 * 2^1 = 3.8125 10

Exceptions to IEEE 754

  • These rules apply when
    • Exponent  00
    • Exponent  FF (= 255 10 )
  • Special rules apply for these situations
  • These special rules provide for
    • NaN (Not a Number)
    • +/- Inf (infinity)
    • +/- 0 (yes, two zeros!)
    • “unnormalized” numbers  allows very very very small values including “machine epsilon” (the smallest positive number allowed)

Exceptions to IEEE 754

  • Special cases: (E is Exponent, F is Mantissa)
  • If E=255 and F is nonzero, then Value=NaN ("Not a Number")
  • If E=255 and F is zero and S is 1, then Value=-Infinity
  • If E=255 and F is zero and S is 0, then Value=Infinity
  • If E=0 and F is nonzero, then Value=(-1)^S * 2^(-126) * (0.F) These are "unnormalized" values.
  • If E=0 and F is zero and S is 1, then Value=-
  • If E=0 and F is zero and S is 0, then Value=