Units, binary and hexadecimal
Bits, bytes and the larger units, converting between denary, binary and hexadecimal, binary addition, shifts, overflow and negative numbers.
Watch the lesson
Every point below, worked through in one video, and each point links straight to its own part.
Learn
Units, binary and hexadecimal, explained point by point
Everything the GCSE specification expects you to be able to do, and how to actually do it - the same lesson a signed-in student studies from.
Use the units of data storage and convert between them
A bit is a single 0 or 1. Four bits make a nibble and eight bits make a byte. After that the boards differ, so learn your own. OCR and AQA go up in thousands: 1 kilobyte is 1000 bytes, 1 megabyte is 1000 kilobytes, then gigabyte, terabyte and, for OCR, petabyte (OCR also accepts 1024). Eduqas uses 1024 for each step. Edexcel uses 1024 with the binary names: kibibyte, mebibyte, gibibyte and tebibyte. To go to a smaller unit multiply, and to go to a bigger unit divide.
Explain why computers use binary, and how many values a number of bits can hold
A computer is built from billions of switches that are either on or off, so everything inside it is stored as 1s and 0s. Each extra bit doubles the number of different patterns: 1 bit gives 2 values, 2 bits give 4, 3 bits give 8, and 8 bits give 2⁸ = 256. So n bits can represent 2ⁿ different values. That one fact explains the limits you meet later, such as 256 colours from 8 bits per pixel.
Convert positive whole numbers between denary and 8-bit binary
The eight columns of a byte are worth 128, 64, 32, 16, 8, 4, 2 and 1. To read a binary number, add the values of the columns that hold a 1: 01001101 is 64 + 8 + 4 + 1 = 77. To write a denary number in binary, work from the left and put a 1 in each column whose value fits into what is left: 200 is 128 + 64 + 8, so 11001000. The largest 8-bit number is 255. The left-hand bit is the most significant bit and the right-hand bit the least significant.
Convert between hexadecimal, binary and denary, and explain why hexadecimal is used
Hexadecimal is base 16. It uses 0 to 9 and then A to F for 10 to 15. One hex digit stands for exactly four bits, so split a byte into two nibbles and convert each: 1011 0110 is B6. To reach denary, multiply the first digit by 16 and add the second: B6 is 11 × 16 + 6 = 182. People use hex because it is shorter than binary and easier to read and copy without mistakes. The computer still stores binary. Edexcel asks for conversion between hex and binary only.
Add binary numbers and explain overflow
Add from the right, one column at a time. 0 + 1 is 1, 1 + 1 is 0 carry 1, and 1 + 1 + 1 is 1 carry 1. If the answer needs a ninth bit it will not fit in a byte: that is an overflow error, and the stored result is wrong. OCR and Edexcel add two 8-bit numbers and ask about overflow. AQA may ask you to add three numbers but never sets a sum that overflows. Eduqas also asks for binary subtraction and for underflow, where a result is too small to store.
Carry out binary shifts and say what they do to a number
A left shift moves every bit to the left and fills the gap with 0s. Each place shifted multiplies the number by 2, so a left shift of 3 multiplies by 8. A right shift moves the bits right, and each place divides by 2. Bits pushed off the end are lost, so a right shift can lose accuracy and a left shift can overflow. These are logical shifts. Edexcel and Eduqas also ask for the arithmetic shift, which keeps the sign bit of a negative number when shifting right.
Represent negative whole numbers in two’s complementEdexcel and Eduqas only
In 8-bit two’s complement the left-hand column is worth −128, not 128, so a byte can hold −128 to +127. To make a number negative, write the positive number, flip every bit, then add 1: 5 is 00000101, flipped is 11111010, add 1 gives 11111011, which is −5. A leading 1 always means the number is negative. Edexcel and Eduqas examine this, and Eduqas also asks for sign and magnitude, where the left-hand bit is simply a plus or minus sign. OCR and AQA do not examine negative binary numbers.
Units, binary and hexadecimal key terms
The words the specification and the mark schemes use, each defined the way an examiner wants it.
- Bit
- A single binary digit, 0 or 1: the smallest unit of data.
- Nibble
- A group of four bits, which is half a byte.
- Byte
- A group of eight bits, enough to store one character in ASCII.
- Binary
- The base 2 number system, which uses only the digits 0 and 1.
- Denary
- The base 10 number system used in everyday life, with the digits 0 to 9.
- Hexadecimal
- The base 16 number system, which uses 0 to 9 and A to F, where each digit represents four bits.
- Most significant bit
- The left-hand bit of a binary number, which has the largest place value.
- Overflow
- An error that happens when the result of a calculation needs more bits than are available to store it.
- Binary shift
- Moving all the bits of a binary number left or right, which multiplies or divides it by a power of 2.
- Two’s complement
- A way of representing negative whole numbers in binary in which the left-hand bit has a negative place value.
Common mistakes in Units, binary and hexadecimal
The slips that cost marks year after year, and what to do instead.
Using 1024 where your board uses 1000, or the other way round
OCR and AQA count in thousands. Edexcel and Eduqas use 1024. Learn your board’s rule and show the multiplication.
Reading the columns of a byte in the wrong direction
The right-hand column is worth 1 and each column to the left doubles, up to 128. Write the values above the bits before you add.
Forgetting the carry in binary addition
In each column 1 + 1 is 0 carry 1, and 1 + 1 + 1 is 1 carry 1. Write every carry above the next column.
Saying a left shift divides
A left shift multiplies by 2 for each place and a right shift divides. Check with a small number such as 3 shifted left to 6.
Converting hexadecimal as if both digits were worth the same
The left digit is worth 16 times its value. For 2F work out 2 × 16 and then add 15.
Practice
Try a Units, binary and hexadecimal question
A GCSE-style original question from this topic. Have a go before you open the working - deciding on an answer first is what makes the working stick.
Answer: 60
3C = 3 × 16 + 12 = 60.
- The left digit is worth 16 each: 3 × 16 = 48.
- C stands for 12.
- 48 + 12 = 60.
