Binary Arithmetic Trainer
Practice unsigned and signed 8-bit binary addition, subtraction, and logical shifts with step-by-step working. Covers AQA A Level CS (7517) §4.5.4.1–4.5.4.3.
📖 Learn Step-by-StepStep-by-step working
Unsigned vs Signed (8-bit)
Key concepts
- Binary addition follows the same column rules as decimal
- 1 + 1 = 10 (0, carry 1)
- 1 + 1 + 1 = 11 (1, carry 1)
- Overflow occurs when the result exceeds 8 bits
Binary Arithmetic Practice Questions
Use the trainer above to explore binary arithmetic, then try these exam-style questions.
Calculate the sum of these two unsigned 8-bit binary numbers.
Work from right to left. Enter carries in the bottom row where needed.
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | |
|---|---|---|---|---|---|---|---|---|
| Addend 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 |
| Addend 2 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 |
| Answer | ||||||||
| Carries |
Add these two unsigned 8-bit binary numbers. Does overflow occur?
Work from right to left. Enter carries in the bottom row where needed.
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | |
|---|---|---|---|---|---|---|---|---|
| Addend 1 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 |
| Addend 2 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 |
| Answer | ||||||||
| Carries |
Perform a logical shift left by 2 places on this 8-bit binary number.
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | |
|---|---|---|---|---|---|---|---|---|
| Original | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 |
| ↓ Left shift by 2 | ||||||||
| Result | ||||||||
Perform a logical shift right by 3 places on this 8-bit binary number.
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | |
|---|---|---|---|---|---|---|---|---|
| Original | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 |
| ↓ Right shift by 3 | ||||||||
| Result | ||||||||
Represent the decimal number −45 as an 8-bit two's complement binary number.
Your Answer (8-bit Two's Complement):
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
Represent the decimal number −100 as an 8-bit two's complement binary number.
Your Answer (8-bit Two's Complement):
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
Quick reference — binary arithmetic
Binary addition rules:
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 0 = 1
- 1 + 1 = 10 (0 carry 1)
- 1 + 1 + 1 = 11 (1 carry 1)
Two's complement (for signed numbers):
- MSB has negative weight (e.g., −128 for 8-bit)
- To negate: flip all bits, then add 1
- Subtraction: A − B = A + two's complement of B
- 8-bit range: −128 to +127
Logical shifts:
- Shift left: each shift = ×2, vacated bits filled with 0
- Shift right: each shift = ÷2 (integer), vacated bits filled with 0
- Bits shifted out are lost permanently
- Arithmetic shift right preserves the sign bit (not covered here — this is logical shift)
Overflow:
- Occurs when the result cannot be represented in the available bits
- Unsigned overflow: carry out of the MSB
- Signed overflow: result changes sign unexpectedly