# 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
`s`_{i} =
`x`_{i} `y`_{i}
XOR `c`_{i}
`c`_{i+1} =
`x`_{i} `y`_{i}
+ `c`_{i} `x`_{i}
+ `c`_{i} `y`_{i}

- 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