Integer representation and arithmetic pt2 Flashcards
1
Q
How does binary addition work (carrying and result)
A
- Add from least to most significant
- If 1 + 1 => carry 1 val 0
- If 1 + 1 + 1 (carry) => carry 1 val 1
- Carry is 1 larger than length
2
Q
What is the psuedo-code for addition in any base (digit by digit, low to high sig)
A
3
Q
What is a Full-Adder and its truth table
A
- Adds two single bits together
4
Q
How does a full-adder work in circuit
A
- Each full-adder is responsible for each bit (low to high signficance)
5
Q
What two cases can binary addition fail
A
- The inputs are unsigned and there is a carry-out (larger than max val)
- The inputs are signed but the sign of the result makes no sense (eg: 1000 0011 + 1000 0001 = 0000 0100, sign switch)
This problems can be detected and signaled to fix