What number bases do computers use and how do we convert between them?
Understand the decimal, binary and hexadecimal number systems, why computers use binary and hexadecimal, and how to convert between the three bases.
A focused answer to AQA A-Level Computer Science 4.5.1, covering the decimal, binary and hexadecimal number systems, why computers use binary and hexadecimal, and how to convert between the three bases.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
AQA wants you to describe the decimal, binary and hexadecimal number systems, explain why computers use binary and why hexadecimal is convenient, and convert numbers between the three bases reliably under exam time.
The three number systems
A positional number system gives each column a weight equal to a power of the base. In binary the column weights from the right are and so on, each double the one before. In hexadecimal the weights are . The same idea (digit times place value, summed) recovers the denary value in any base, which is the single rule that underpins every conversion you will be asked to do.
Why binary and hexadecimal
Hexadecimal does not change how the machine stores data; the hardware is still binary. Hex is purely a notation that programmers and the exam use because it compresses binary by a factor of four without any awkward arithmetic, since the base is a power of two.
Converting between bases
Binary to decimal: write the place values above the bits and add the values where there is a 1. So .
Decimal to binary: repeatedly divide by 2, recording remainders, then read the remainders from bottom to top. So gives quotient 6 remainder 1, then 3 r 0, then 1 r 1, then 0 r 1, read upward as . An equivalent method is place-value subtraction: take out the largest power of two that fits, set that bit, and repeat with the remainder.
Binary and hexadecimal: split the binary into groups of four bits from the right (pad the left with zeros if needed) and convert each group to one hex digit. So , and each hex digit expands back to four bits. Hexadecimal to decimal multiplies each digit by its power of 16: .
Exam-style practice questions
Practice questions written in the style of AQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
AQA 20194 marksConvert the denary number 217 into binary and then into hexadecimal. Show your working.Show worked answer β
Work in 8 bits with place values .
Denary to binary by subtraction: (set the 128 bit), (set 64), (set 16), (set 8), (set 1). The set columns are , giving .
Binary to hex by grouping in fours from the right: and , so .
Markers award method marks for the place-value subtraction and the grouping into nibbles, then accuracy marks for and . A single arithmetic slip that is carried correctly still earns method marks.
AQA 20212 marksExplain why hexadecimal is commonly used as a shorthand for binary in computing.Show worked answer β
Each hexadecimal digit maps to exactly four binary digits (a nibble), because . This means a long string of bits can be written compactly: one byte is two hex digits rather than eight ones and zeros.
Markers reward the precise reason (one hex digit equals four bits) plus a consequence such as fewer transcription errors or easier reading of memory addresses and colour codes. A vague answer ("it is shorter") without the four-bit relationship earns only one mark.
Related dot points
- Understand unsigned and signed binary using two's complement, binary addition and subtraction, fixed point and floating point representation of real numbers, and the effects of overflow and rounding.
A focused answer to AQA A-Level Computer Science 4.5.2 to 4.5.7, covering unsigned and signed binary using two's complement, binary addition and subtraction, fixed and floating point representation of real numbers, and overflow and rounding errors.
- Understand the bit and byte, the units of information capacity, binary and decimal prefixes (kibi versus kilo), and how the number of bits limits the range of values that can be represented.
A focused answer to AQA A-Level Computer Science 4.5.8, covering the bit and the byte, the units of information capacity, binary prefixes (kibi, mebi) versus decimal prefixes (kilo, mega), and how the number of bits limits the range of values.
- Understand character encoding using ASCII and Unicode, the limitations of ASCII, why Unicode was introduced, and the relationship between a character set and a character code.
A focused answer to AQA A-Level Computer Science 4.5.9, covering character encoding using ASCII and Unicode, the limitations of ASCII, why Unicode was introduced, and the relationship between a character set and its codes.
- Understand how bitmap images are represented using pixels, colour depth and resolution, how analogue sound is sampled, and the effect of sample rate, resolution and metadata on quality and file size.
A focused answer to AQA A-Level Computer Science 4.5.10 and 4.5.11, covering bitmap images with pixels, colour depth and resolution, the sampling of analogue sound, and the effect of sample rate, resolution and metadata on quality and file size.
- Understand lossy and lossless compression, run length encoding and dictionary-based compression, symmetric and asymmetric encryption, and error-checking methods such as parity and check digits.
A focused answer to AQA A-Level Computer Science 4.5.12 to 4.5.14, covering lossy and lossless compression, run length encoding and dictionary-based compression, symmetric and asymmetric encryption, and error checking with parity and check digits.
Sources & how we know this
- AQA A-level Computer Science (7517) specification β AQA (2015)