CSCI 255, ENGR 274, ECE 212 -- 10 October, 2000
Announcements
Representation of negative numbers -- review?
- Does 0 == -0?
- Do even numbers end with 0's
- Are both n and -n represented?
- Are there special rules for adding positive and negative numbers?
Signed Magnitude
Ones Complement
Twos Complement
Conversion to n-bit twos complement
- Convert to a n-bit binary number -- Use leading zero's if nexcessary!
- If positive,
- If negative,
- Complement the number
- Add one
- How about a spreadsheet?
Binary addition
Implementation of ripple-carry adder/subtractor
- Half-adder
- Full adder
- si =
xi yi
XOR ci
- ci+1 =
xi yi
+ ci xi
+ ci yi
- Adding and subtracting
- Detecting overflow
- Overflow occurs when the last two carries differ
- Performance of the ripple-carry adder
- Composed to full adders
- Has significant propagation delay
carry-select adder
Just do the top half twice, and select the right result