Arithmetic For Computers: C S E 2 1 2 Krishna K Nagar
Arithmetic For Computers: C S E 2 1 2 Krishna K Nagar
CSE 212
KRISHNA K NAGAR
2/14/2011
Introduction
2/14/2011
Computer Arithmetic
Operations on integers
Addition and subtraction
2/14/2011
Integer Addition and Subtraction
Example: 7 + 6
Example: 7 – 6 = 7 + (-6)
2/14/2011
Overflow
2/14/2011
Multiplication
2/14/2011
Algorithm and Hardware
2/14/2011
Example
2/14/2011
Optimization
Catch????
Product register should actually be 65 bits.
2/14/2011
Example
2/14/2011
Faster Multiplication
2/14/2011
Division
2/14/2011
Algorithm and Hardware
Initially divisor
in left half
Initially dividend
2/14/2011
Step Quotient Divisor Remainder itr
2/14/2011
Example
2/14/2011
Multiplication and Division in MIPS
2/14/2011
To Do
2/14/2011