Why Digital Systems Use Binary
The bit is the smallest unit of digital information — nibbles (4 bits), bytes (8 bits), and words are all built from multiple bits. To bring the real world into a digital system, an analog-to-digital converter (ADC) converts continuous physical quantities into discrete digital values.
Converting Between Number Bases
Decimal → Binary, using powers of 2 (128, 64, 32, 16, 8, 4, 2, 1):
Worked example: 175 = 128+32+8+4+2+1 → binary 10101111.
Binary → Octal, group bits into 3-bit triples from the right:
Worked example: 101 100 111 001 010 100 001 → 5 4 7 1 2 4 1 → octal 5471241.
Binary → Hex, group bits into 4-bit nibbles from the right:
Worked example: 1000 1101 0100 0110 1111 → 8 D 4 6 F → hex 8D46F. Going the other way, F7A9 → F=1111, 7=0111, A=1010, 9=1001 → binary 1111011110101001.
1's and 2's Complement
- 1's complement — invert every bit.
- 2's complement — 1's complement, then add 1.
Worked example: 1's complement of 10111001 = 01000110; 2's complement = 01000110 + 1 = 01000111.
Reading a negative 2's-complement number: if the MSB (leftmost bit) is 1, the number is negative. Find its magnitude by inverting the bits and adding 1.
Worked example: 10010011 has MSB=1 (negative). Invert → 01101100, add 1 → 01101101 = 64+32+8+4+1 = 109, so the value is -109.
BCD and Excess-3 Codes
- BCD (Binary-Coded Decimal) — each decimal digit is encoded separately as its own 4-bit binary value (e.g. 7 → 0111, 3 → 0011).
- Excess-3 code — take the BCD value and add 3 (0011) to it.
Worked example: Excess-3 of decimal 6: BCD of 6 = 0110, + 0011 = 1001.
Why This Matters for Your Exams
Base-conversion questions are entirely mechanical once you know the grouping rule (3 bits for octal, 4 bits for hex) — write the binary string out in full, then group from the right-hand side, padding the leftmost group with zeros if it's short.

