Unsigned integers use pure binary with positional (place) value. For an 8-bit byte, columns are:
| Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
|---|---|---|---|---|---|---|---|
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Range for an n-bit unsigned integer: 0 to 2ⁿ − 1. For 8 bits: 0 to 255.
Multiply each bit by its positional value and sum them.
Example: 10110011₂ = 128+32+16+2+1 = 179₁₀
Repeated division by 2 — record remainders from bottom to top.
| Division | Quotient | Remainder |
|---|---|---|
| 75 ÷ 2 | 37 | 1 |
| 37 ÷ 2 | 18 | 1 |
| 18 ÷ 2 | 9 | 0 |
| 9 ÷ 2 | 4 | 1 |
| 4 ÷ 2 | 2 | 0 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Reading remainders bottom-up: 75₁₀ = 1001011₂
Four rules:
| Column | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|
| A | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 |
| B | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 |
| Sum | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 |
A (106) + B (57) = 163 = 10100011₂. Verify: 128+32+2+1 = 163 ✓
Overflow occurs when the result of an arithmetic operation exceeds the number of bits available. In an 8-bit unsigned system, 200 + 100 = 300, but 300 > 255 — the result wraps around or raises an error.
Overflow in addition: when a carry-out is generated from the most significant bit position.
Shifting binary left or right is equivalent to multiplying or dividing by powers of 2:
| Operation | Effect | Example |
|---|---|---|
| Shift left 1 | × 2 | 00001010 → 00010100 (10→20) |
| Shift left 2 | × 4 | 00000011 → 00001100 (3→12) |
| Shift right 1 | ÷ 2 (integer) | 00010100 → 00001010 (20→10) |
Bits shifted off the end are lost; zeros fill in from the other end (logical shift).
8 questions · instantly marked · AQA 7517 standard
| Term | Definition |
|---|
10 questions · 10 minutes