Data representation and security · GCSE Computer Science
Binary and hexadecimal conversion
GCSE Computer Science binary and hex: group bits into nibbles, digits 0–9 and A–F, and a full conversion of 156 into hexadecimal with the binary in the middle.
Hex is shorthand for binary, not a different electricity. Four bits make a nibble; each nibble is one hex digit 0–F. 1010 is A, 1111 is F. Humans read hex; the CPU still uses bits.
The important bits
What you need to know
- 1
Binary is base 2: place values … 128, 64, 32, 16, 8, 4, 2, 1 for one byte. A bit is a 0 or 1; a nibble is 4 bits; a byte is 8 bits (two nibbles).
- 2
Hexadecimal is base 16. Digits are 0–9 then A=10, B=11, C=12, D=13, E=14, F=15. One hex digit represents exactly one nibble because 2⁴ = 16.
- 3
Binary to hex: split the bit string into groups of 4 from the right, pad the left with zeros if needed, then translate each nibble. 11010111 → 1101 0111 → D7.
- 4
Hex to binary: expand each digit to a 4-bit nibble. A is 1010, F is 1111, 0 is 0000. Do not drop leading zeros in the middle of a byte if the question wants 8 bits.
- 5
Denary to hex: divide by 16 and read remainders, or convert denary → binary → nibbles → hex. The second route is safer if you already know place values.
- 6
Hex is shorter to write and less error-prone to copy than long binary (MAC addresses, colour codes, memory dumps). Computers do not “calculate in hex”; they calculate in binary. Hex is for humans and compact display.
- 7
A left shift in binary multiplies by 2; a right shift divides by 2 (integer). Overflow is a denary/binary addition issue: not enough bits, not a hex problem.
- 8
Show working. An answer of 9C with no nibble table can still score, but a slipped nibble is recoverable if the examiner sees 1001 1100.
Quotations worth analysing
Short evidence. Real method.
“A nibble is 4 bits and maps to one hexadecimal digit.”
This is why conversion is grouping, not a new number system the CPU switches into. 16 is 2⁴, so the mapping is exact.
“Hex digits run from 0 to F, where A represents 10 and F represents 15.”
Writing 10 as a single hex digit is wrong; that is A. Writing G is not a hex digit. 0–F only.
“Hexadecimal is easier for humans to read than binary.”
Pair with “converts easily because each digit is 4 bits”. Do not say computers work in hex. They work in binary.
Go deeper
Why hex exists: four bits at a time
Binary is truthful and unreadable. Group bits in fours and each nibble maps to one hex digit 0–F. MAC addresses, colour codes such as #1A2B3C, and memory dumps become shorter and less error-prone to copy. Converting 11010111 to D7 is faster than going via denary if you have practised the nibble table: 0000=0 … 1001=9, 1010=A, 1011=B, 1100=C, 1101=D, 1110=E, 1111=F. Hex is not a third kind of electricity. If a question asks for advantages, say shorter than binary and easy conversion because 16 is 2⁴, not “computers calculate in hex”. They do not. When you add in hex in later courses you still carry 16, but at GCSE the skill is conversion and the nibble split, done on paper with the groups marked.
Go deeper
Denary 156 is a nibble problem in costume
Place values for a byte: 128 64 32 16 8 4 2 1. 156 = 128 + 16 + 8 + 4 = 10011100 in binary. Split 1001 1100. 1001 is 9, 1100 is 12, which is C. Hex 9C. Check: 9×16 + 12 = 144 + 12 = 156. The divide-by-16 route is the same number: 156 ÷ 16 = 9 remainder 12, and remainder 12 is C, so 9C again. Students who write 9×10 + C have mixed denary place values into hex. Place values in hex are 16¹ and 16⁰ for two digits, then 16² for a third. Pad binary to a multiple of 4 bits: 11100 is not a nibble pair until you write 0001 1100, which is 1C, not 7C from grabbing 11100 as a blob. Always group from the right.
See the idea in action
Convert 156 to hexadecimal via binary. Byte place values: 128 64 32 16 8 4 2 1. 156 − 128 = 28, so the 128 bit is 1. 28 < 64, 0. 28 < 32, 0. 28 − 16 = 12, so 16-bit is 1. 12 − 8 = 4, so 8-bit is 1. 4 − 4 = 0, so 4-bit is 1. 2-bit 0, 1-bit 0. Binary: 10011100. Nibbles from the right: 1001 | 1100. 1001 = 8+1 = 9. 1100 = 8+4 = 12 = C. Hexadecimal: 9C. Check: 9×16 + 12 = 144 + 12 = 156. Remainder method: 156 ÷ 16 = 9 remainder 12 (C) → 9C. Same answer, two routes.
Exam technique
Turn knowledge into marks
Group binary in nibbles from the right and write the 0–F table in the margin. Show 156 = 10011100 = 1001 1100 = 9C. State that hex is a human shorthand for binary.
Common mistakes
Do not give these marks away
- 01
Grouping bits from the left so an odd-length bit string maps to the wrong hex digits.
- 02
Writing 10, 11 or 12 as hex digits instead of A, B and C, or saying the CPU calculates in hexadecimal.
- 03
Using place value 10 in a hex number, e.g. treating 9C as 9×10 + 12 instead of 9×16 + 12.
What is 156 in hexadecimal?
A9C
BC9
C156
D10011100
Show the answer
9C. 156 = 10011100 in binary. Nibbles 1001 and 1100 are 9 and C. C9 would swap the nibbles. 156 is denary. 10011100 is the binary form, not hex.
Quick questions
If this is the bit you searched
How do you convert binary to hex GCSE?
Split the binary into groups of 4 bits from the right, convert each nibble to a digit 0–F, and write the digits in the same order. Pad the left with zeros if the last group is short.
Why is hexadecimal used in computer science?
It is shorter than binary and maps cleanly onto nibbles, so addresses and colour codes are easier to read and copy. The hardware still operates on binary.
What numbers do A to F stand for?
A=10, B=11, C=12, D=13, E=14, F=15. Those are the six extra digits base 16 needs above 0–9.
Is 9C the same as 156?
They are the same quantity in different bases. 9C hex is 9×16 + 12 = 156 denary, which is 10011100 binary.