Binary Arithmetic
| Type | Quiz 1 Material |
|---|
Notes
Addition with unsigned or 2's complement binary numbers
Subtraction with 2's complement binary numbers
Overflow
Extra digits that does NOT fit into the available bits.
Overflow occurs if:
- We get a carry in to sign bit but no carry out
- We get a carry out of the sign bit but no carry in
Overflow never occurs if we add a positive number with a negative number.
Sign Extension
- Suppose we have a number which is stored in a four bit register
- We wish to add this number to a number stored in an eight bit register
- We have a device which will do the addition and it is designed to add two 8 bit numbers
- What issues do we need to deal with?
- To add bits to the left of a two’s complement number (i.e. make the number of bits bigger while representing the same numeric value)...
- Fill the new bits on the left with the value of the sign bit!
Adding a number to itself
Questions & Answers
How do you know overflow occurred when adding unsigned numbers?
What are the TWO ways to tell if overflow occurred in 2's complement addition/subtraction?
What is the sum of and ?



