TYPE THE SUBJECT NAME HERE
SUBJECT CODE
II IV
CS 8491
Computer Architecture
(Common to CSE & IT)
UNIT NO 2
ARITHMETIC FOR COMPUTERS
2.5 Floating Point - Addition, Subtraction and
Multiplication
COMPUTER ARCHITECTURE (Common to CSE & IT )
CS 8491
FLOATING POINT NUMBERS - ADDITION AND SUBTRACTION
ALGORITHM :
0. Zero check
- Change the sign of subtrahend
- If either operand is 0, the other is the result
1. Significand alignment: right shift smaller significand until two
exponents are identical.
2. Addition: add significands and report exception if overflow occurs.
3. Normalization
- Shift significand bits to normalize.
- report overflow or underflow if exponent goes out of range.
4. Rounding
COMPUTER ARCHITECTURE (Common to CSE & IT )
CS 8491
FLOATING POINT NUMBERS - ADDITION AND SUBTRACTION
COMPUTER ARCHITECTURE (Common to CSE & IT )
CS 8491
FLOATING POINT NUMBERS - ADDITION AND SUBTRACTION
COMPUTER ARCHITECTURE (Common to CSE & IT )
CS 8491
FLOATING POINT NUMBERS - ADDITION AND SUBTRACTION
COMPUTER ARCHITECTURE (Common to CSE & IT )
CS 8491
FLOATING POINT NUMBERS - ADDITION AND SUBTRACTION
EXAMPLE:
COMPUTER ARCHITECTURE (Common to CSE & IT )
CS 8491
FLOATING POINT NUMBERS - MULTIPLICATION
BASIC IDEA :
(m1 x 2e1) x (m2 x 2e2) = (m1 x m2) x 2e1+e2
● Separate signs
● Add exponents
● Multiply significands
● Normalize, round, check overflow
● Replace sign
COMPUTER ARCHITECTURE (Common to CSE & IT )
CS 8491
FLOATING POINT NUMBERS - MULTIPLICATION
ALGORITHM :
COMPUTER ARCHITECTURE (Common to CSE & IT )
CS 8491
FLOATING POINT NUMBERS - MULTIPLICATION
EXAMPLE :
COMPUTER ARCHITECTURE (Common to CSE & IT )
CS 8491
REFERENCES
● David A. Patterson and John L. Hennessy, Computer Organization and Design:
The Hardware/Software Interface, Fifth Edition, Morgan Kaufmann / Elsevier,
2014
● Carl Hamacher, Zvonko Vranesic, Safwat Zaky and Naraig Manjikian, Computer
Organization and Embedded Systems, Sixth Edition, Tata McGraw Hill, 2012
● https://nptel.ac.in/content/storage2/courses/117106114/Week9%20Slides/9.7Fl
oatingPoint.pdf
COMPUTER ARCHITECTURE (Common to CSE & IT )
CS 8491
https://www.youtube.com/watch?v=03fhijH6e2w

2.5 Floating Point Operations.pptx

  • 1.
    TYPE THE SUBJECTNAME HERE SUBJECT CODE II IV CS 8491 Computer Architecture (Common to CSE & IT) UNIT NO 2 ARITHMETIC FOR COMPUTERS 2.5 Floating Point - Addition, Subtraction and Multiplication
  • 2.
    COMPUTER ARCHITECTURE (Commonto CSE & IT ) CS 8491 FLOATING POINT NUMBERS - ADDITION AND SUBTRACTION ALGORITHM : 0. Zero check - Change the sign of subtrahend - If either operand is 0, the other is the result 1. Significand alignment: right shift smaller significand until two exponents are identical. 2. Addition: add significands and report exception if overflow occurs. 3. Normalization - Shift significand bits to normalize. - report overflow or underflow if exponent goes out of range. 4. Rounding
  • 3.
    COMPUTER ARCHITECTURE (Commonto CSE & IT ) CS 8491 FLOATING POINT NUMBERS - ADDITION AND SUBTRACTION
  • 4.
    COMPUTER ARCHITECTURE (Commonto CSE & IT ) CS 8491 FLOATING POINT NUMBERS - ADDITION AND SUBTRACTION
  • 5.
    COMPUTER ARCHITECTURE (Commonto CSE & IT ) CS 8491 FLOATING POINT NUMBERS - ADDITION AND SUBTRACTION
  • 6.
    COMPUTER ARCHITECTURE (Commonto CSE & IT ) CS 8491 FLOATING POINT NUMBERS - ADDITION AND SUBTRACTION EXAMPLE:
  • 7.
    COMPUTER ARCHITECTURE (Commonto CSE & IT ) CS 8491 FLOATING POINT NUMBERS - MULTIPLICATION BASIC IDEA : (m1 x 2e1) x (m2 x 2e2) = (m1 x m2) x 2e1+e2 ● Separate signs ● Add exponents ● Multiply significands ● Normalize, round, check overflow ● Replace sign
  • 8.
    COMPUTER ARCHITECTURE (Commonto CSE & IT ) CS 8491 FLOATING POINT NUMBERS - MULTIPLICATION ALGORITHM :
  • 9.
    COMPUTER ARCHITECTURE (Commonto CSE & IT ) CS 8491 FLOATING POINT NUMBERS - MULTIPLICATION EXAMPLE :
  • 10.
    COMPUTER ARCHITECTURE (Commonto CSE & IT ) CS 8491 REFERENCES ● David A. Patterson and John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, Fifth Edition, Morgan Kaufmann / Elsevier, 2014 ● Carl Hamacher, Zvonko Vranesic, Safwat Zaky and Naraig Manjikian, Computer Organization and Embedded Systems, Sixth Edition, Tata McGraw Hill, 2012 ● https://nptel.ac.in/content/storage2/courses/117106114/Week9%20Slides/9.7Fl oatingPoint.pdf
  • 11.
    COMPUTER ARCHITECTURE (Commonto CSE & IT ) CS 8491 https://www.youtube.com/watch?v=03fhijH6e2w