SLIDE 1 / 10
CSZone.co.uk
Click anywhere to advance · Arrow keys also work
AQA 7517 · Paper 2 · 4.5.1

Number
Systems

Binary · Hexadecimal · Two's complement · Section 4.5 Fundamentals of Data Representation

WHAT YOU'LL LEARN
Binary/hex/denary conversion · Two's complement · Binary arithmetic · Overflow
AQA SPEC LINK
4.5.1 — Number systems: binary, hex, denary, two's complement
Number Bases

Binary, Denary & Hexadecimal

BaseDigits usedNameUse
20, 1BinaryComputer hardware
100–9DenaryEveryday numbers
160–9, A–FHexadecimalCompact binary representation
Hex A=10, B=11, C=12, D=13, E=14, F=15. One hex digit = 4 binary bits (nibble).
Binary to Denary

Converting Binary to Denary

Each bit position represents a power of 2. Multiply each bit by its place value and sum.
Convert 10110101₂ to denary
1286432168421
10110101
128 + 32 + 16 + 4 + 1 = 181
Denary to Binary

Converting Denary to Binary

Method: repeatedly divide by 2, record remainders. Read remainders bottom to top.
Convert 45 to binary:
45 ÷ 2 = 22 r 1
22 ÷ 2 = 11 r 0
11 ÷ 2 = 5 r 1
5 ÷ 2 = 2 r 1
2 ÷ 2 = 1 r 0
1 ÷ 2 = 0 r 1
Result (bottom→top): 101101₂
Hex Conversions

Binary ↔ Hexadecimal

Group binary into nibbles (4 bits) from right. Convert each nibble to one hex digit.
Convert 10111110₂ to hex:
1011 | 1110
 B      E
= BE₁₆
Hex to denary — place values of 16:
BE₁₆ = 11×16 + 14 = 176 + 14 = 190
Two's Complement

Two's Complement — Negative Numbers

Two's complement is the standard method for representing negative integers in binary. The MSB (most significant bit) has a negative weight.
8-BIT TWO'S COMPLEMENT EXAMPLE: -35
1. Write +35: 00100011
2. Invert all bits: 11011100
3. Add 1:      11011101
Check: -128+64+16+8+4+1 = -35 ✓
Binary Arithmetic

Binary Addition

Rules: 0+0=0; 0+1=1; 1+1=10 (carry 1); 1+1+1=11 (carry 1).
Add 00110101 (53) + 00101011 (43):
  00110101
+ 00101011
——————
  01100000 = 96 ✓
Overflow occurs when the result is too large for the number of bits. In 8-bit, max is 127 (signed) or 255 (unsigned).
Why Hex?

Why Use Hexadecimal?

Compact — 1 hex digit = 4 bits. A byte (8 bits) = 2 hex digits (e.g. FF)
Readable — hex is far easier for humans to read than long binary strings
Memory addresses — displayed in hex (e.g. 0x7FFE3A2B)
Colours — RGB in HTML: #FF6600 = red=255, green=102, blue=0
MAC addresses — 48-bit hardware address shown as 6 hex pairs
AQA Exam Style

Practice Question

AQA 7517 — Paper 2 Style
(a) Convert 10101100₂ to denary. Show working. [2]
(b) Convert denary 200 to 8-bit binary. Show working. [2]
(c) Represent -25 in 8-bit two's complement. [2]
(d) State ONE reason why hexadecimal is used by programmers. [1]
[7 marks]
2 marks
(a) 128+32+8+4 = 172
2 marks
(b) 128+64+8 = 200 → 11001000
2 marks
(c) +25=00011001; invert=11100110; +1=11100111. Check: -128+64+32+4+2+1=-25 ✓
1 mark
(d) More compact than binary / easier to read than long binary strings
Summary

Key Points to Remember

Binary base 2; Hex base 16 (1 hex digit = 4 bits)
Binary → hex: group into nibbles; hex → binary: expand each digit to 4 bits
Two's complement: invert all bits, add 1. MSB has negative weight
Overflow: result too large for number of bits available
8-bit range: 0–255 (unsigned) or -128 to +127 (two's complement)
🎉 Lesson complete — move to the quiz!