Fully solved problem book
Eight-bit addition
Set 14 of 14 · 4 worked questions. Predict your result before expanding the solution.
These worked traces are meant to build fluency through controlled variation. If several answers feel identical, try the next difficult value and look for the point where a carry, sign, branch, or selected memory address changes the outcome.
Bitwise arithmetic · Problem 0417
Add 11111110₂ and 00101001₂; keep the low eight result bits.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Use exactly eight bits: A=11111110, B=00101001.
- Ordinary decimal arithmetic gives 254+41=295.
- We process bits from the rightmost column (bit zero) to the leftmost (bit seven).
- Bit 0 (weight 1): 0+1+incoming carry 0=1; write 1, pass carry 0.
- Bit 1 (weight 2): 1+0+incoming carry 0=1; write 1, pass carry 0.
- Bit 2 (weight 4): 1+0+incoming carry 0=1; write 1, pass carry 0.
- Bit 3 (weight 8): 1+1+incoming carry 0=2; write 0, pass carry 1.
- Bit 4 (weight 16): 1+0+incoming carry 1=2; write 0, pass carry 1.
- Bit 5 (weight 32): 1+1+incoming carry 1=3; write 1, pass carry 1.
- Bit 6 (weight 64): 1+0+incoming carry 1=2; write 0, pass carry 1.
- Bit 7 (weight 128): 1+0+incoming carry 1=2; write 0, pass carry 1.
- The final carry-out is 1; it is outside the eight-bit result.
- The stored sum is 00100111, which is 39 unsigned.
- Check modular arithmetic: 295 modulo 256 = 39.
- Signed readings of the inputs are -2 and 41; signed overflow should be evaluated separately.
- An ALU may expose carry-out and signed overflow as different flags.
Final answer: 00100111
Bitwise arithmetic · Problem 0418
Add 11111110₂ and 01111000₂; keep the low eight result bits.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Use exactly eight bits: A=11111110, B=01111000.
- Ordinary decimal arithmetic gives 254+120=374.
- We process bits from the rightmost column (bit zero) to the leftmost (bit seven).
- Bit 0 (weight 1): 0+0+incoming carry 0=0; write 0, pass carry 0.
- Bit 1 (weight 2): 1+0+incoming carry 0=1; write 1, pass carry 0.
- Bit 2 (weight 4): 1+0+incoming carry 0=1; write 1, pass carry 0.
- Bit 3 (weight 8): 1+1+incoming carry 0=2; write 0, pass carry 1.
- Bit 4 (weight 16): 1+1+incoming carry 1=3; write 1, pass carry 1.
- Bit 5 (weight 32): 1+1+incoming carry 1=3; write 1, pass carry 1.
- Bit 6 (weight 64): 1+1+incoming carry 1=3; write 1, pass carry 1.
- Bit 7 (weight 128): 1+0+incoming carry 1=2; write 0, pass carry 1.
- The final carry-out is 1; it is outside the eight-bit result.
- The stored sum is 01110110, which is 118 unsigned.
- Check modular arithmetic: 374 modulo 256 = 118.
- Signed readings of the inputs are -2 and 120; signed overflow should be evaluated separately.
- An ALU may expose carry-out and signed overflow as different flags.
Final answer: 01110110
Bitwise arithmetic · Problem 0419
Add 11111110₂ and 11000001₂; keep the low eight result bits.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Use exactly eight bits: A=11111110, B=11000001.
- Ordinary decimal arithmetic gives 254+193=447.
- We process bits from the rightmost column (bit zero) to the leftmost (bit seven).
- Bit 0 (weight 1): 0+1+incoming carry 0=1; write 1, pass carry 0.
- Bit 1 (weight 2): 1+0+incoming carry 0=1; write 1, pass carry 0.
- Bit 2 (weight 4): 1+0+incoming carry 0=1; write 1, pass carry 0.
- Bit 3 (weight 8): 1+0+incoming carry 0=1; write 1, pass carry 0.
- Bit 4 (weight 16): 1+0+incoming carry 0=1; write 1, pass carry 0.
- Bit 5 (weight 32): 1+0+incoming carry 0=1; write 1, pass carry 0.
- Bit 6 (weight 64): 1+1+incoming carry 0=2; write 0, pass carry 1.
- Bit 7 (weight 128): 1+1+incoming carry 1=3; write 1, pass carry 1.
- The final carry-out is 1; it is outside the eight-bit result.
- The stored sum is 10111111, which is 191 unsigned.
- Check modular arithmetic: 447 modulo 256 = 191.
- Signed readings of the inputs are -2 and -63; signed overflow should be evaluated separately.
- An ALU may expose carry-out and signed overflow as different flags.
Final answer: 10111111
Bitwise arithmetic · Problem 0420
Add 11111111₂ and 00001000₂; keep the low eight result bits.
Try it on paper first. The worked answer is hidden below.
Reveal detailed solution →
- Use exactly eight bits: A=11111111, B=00001000.
- Ordinary decimal arithmetic gives 255+8=263.
- We process bits from the rightmost column (bit zero) to the leftmost (bit seven).
- Bit 0 (weight 1): 1+0+incoming carry 0=1; write 1, pass carry 0.
- Bit 1 (weight 2): 1+0+incoming carry 0=1; write 1, pass carry 0.
- Bit 2 (weight 4): 1+0+incoming carry 0=1; write 1, pass carry 0.
- Bit 3 (weight 8): 1+1+incoming carry 0=2; write 0, pass carry 1.
- Bit 4 (weight 16): 1+0+incoming carry 1=2; write 0, pass carry 1.
- Bit 5 (weight 32): 1+0+incoming carry 1=2; write 0, pass carry 1.
- Bit 6 (weight 64): 1+0+incoming carry 1=2; write 0, pass carry 1.
- Bit 7 (weight 128): 1+0+incoming carry 1=2; write 0, pass carry 1.
- The final carry-out is 1; it is outside the eight-bit result.
- The stored sum is 00000111, which is 7 unsigned.
- Check modular arithmetic: 263 modulo 256 = 7.
- Signed readings of the inputs are -1 and 8; signed overflow should be evaluated separately.
- An ALU may expose carry-out and signed overflow as different flags.
Final answer: 00000111