Home / GCSE · AQA / Computer Science / Data representation

CS11Number Bases, Units and Binary Arithmetic

3.3.1 Number bases

Why computers use binary

Computers use binary to represent all data and instructions.

  • A computer is built from billions of tiny electronic switches (transistors). Each has two states, off and on, which stand for 0 and 1.
  • Two states are easy to store and tell apart reliably, so everything a computer holds is a pattern of 0s and 1s.
  • A bit is a single 0 or 1. A bit pattern is a group of bits, such as 0100 0001.
  • The same bit pattern can represent different types of data: a number, a character of text, part of an image, a sound sample, or an instruction. What it means depends on how the program uses it.
  • Binary is written in groups of four bits to make it easier to read: 0100 0001, not 01000001. Both mean the same.

The same bits can mean different things

Exam tipSay “data and instructions”. Computers represent all of both in binary, not just some, and not just data.
Binary
Base 2: a number system that uses 2 different numerals, 0 and 1.
Bit pattern
A group of bits that can represent a number, text, an image, sound or an instruction.
3.3.1 Number bases

Decimal, binary and hexadecimal

You need three number bases. In each, the place values are powers of the base.

  • AQA: “Hexadecimal is a number base that uses the numerals 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.”
  • Hex has a close link to binary: 4 bits can be represented by 1 hexadecimal digit. A group of 4 bits is often called a nibble.
  • You only need whole numbers from 0 to 255: that is 0000 0000 to 1111 1111 in binary and 00 to FF in hex.
  • There is no single hex digit for 16: F (15) is the largest. 16 in hex is 10.
BaseNameNumerals (AQA)Place values (right to left)Largest you need
10Decimal0, 1, 2, 3, 4, 5, 6, 7, 8, 91, 10, 100, 1000…255
2Binary0, 11, 2, 4, 8, 16, 32, 64, 1281111 1111
16Hexadecimal (hex)0–9 and A, B, C, D, E, F1, 16FF
Decimal0–9101112131415
Hex digit0–9ABCDEF
Binary (4 bits)0000–1001101010111100110111101111
Exam tipHex digits after 9 start at A = 10, so D = 13 and F = 15. Examiners report students counting “0–10, then A” (making D = 14) or writing F = 16.
Decimal
Base 10: uses 10 different numerals, 0 to 9.
Hexadecimal
Base 16: uses the numerals 0 to 9 and A to F. One hex digit represents 4 bits.
Nibble
A group of 4 bits: half a byte. One hex digit.
3.3.2 Converting between number bases

Converting between binary and decimal

Use the 8-bit place values: 128, 64, 32, 16, 8, 4, 2, 1.

  • Binary to decimal: write the place values over the bits and add the place values where there is a 1.
  • Decimal to binary (subtraction method): work from 128 down. If the place value fits into what is left, write 1 and subtract it; otherwise write 0.
  • Decimal to binary (division method): keep dividing by 2 and write down the remainders; read them from the last to the first.
  • Give 8 bits when asked, including leading 0s: 25 is 0001 1001.
  • Check: an odd decimal number always ends in 1 in binary; an even one ends in 0.

Binary to decimal with a place value table

Worked exampleConvert 1001 0011 to decimal.
  1. 1s under 128, 16, 2, 1read the place values where there is a 1
  2. 128 + 16 + 2 + 1 = 147add them
147
Worked exampleConvert 157 to 8-bit binary.
  1. 157 − 128 = 29 → 1128 fits
  2. 64? no → 0; 32? no → 029 is less than both
  3. 29 − 16 = 13 → 116 fits
  4. 13 − 8 = 5 → 1; 5 − 4 = 1 → 18 and 4 fit
  5. 2? no → 0; 1 − 1 = 0 → 1finish at 0
1001 1101
Exam tipWrite the place values above the bits every time. It takes seconds and avoids the commonest slip: misreading which column a 1 is in.
3.3.2 Converting between number bases

Converting with hexadecimal

Hex is easiest to reach through binary: one hex digit is one nibble.

  • Binary to hex: split the 8 bits into two nibbles, convert each nibble to a value 0–15, then write each as one hex digit.
  • Hex to binary: write each hex digit as 4 bits (keep the leading 0s: 5 is 0101), then join them.
  • Hex to decimal: left digit × 16, plus the right digit. Turn letters into numbers first (C = 12).
  • Decimal to hex: divide by 16. The whole-number answer is the left digit and the remainder is the right digit. Or convert to binary first, then to hex.

Binary to hex, one nibble at a time

Worked exampleConvert the hex number 3C to decimal.
  1. C = 12letters first
  2. 3 × 16 = 48the left digit is worth 16s
  3. 48 + 12 = 60add the 1s
60
Worked exampleConvert 157 to hexadecimal.
  1. 157 ÷ 16 = 9 remainder 139 × 16 = 144, and 157 − 144 = 13
  2. 13 = Dremainder as a hex digit
9D
Worked exampleConvert the hex number E5 to binary.
  1. E = 14 = 1110first nibble
  2. 5 = 0101second nibble: keep the leading 0
1110 0101
Exam tipWhen asked for hex to decimal, don’t stop after converting to binary: finish the job. Show each step, as working marks are available.
3.3.1 Number bases

Why hexadecimal is used

Computers don’t use hex: they only store binary. Hex is for people.

  • AQA: “Hexadecimal is a more compact form than binary and therefore can take up less space on a display and take less time to enter. It is also easier for people to understand/remember.”
  • Two hex digits replace 8 bits, so it is quicker to read, write and type, and there are fewer mistakes when copying.
  • It does not take up less memory. AQA: “hexadecimal does not take up less memory space (as a computer only stores binary)”. Hex isn’t faster for the computer to process either.
  • Hex is still easy to change back to binary, because each digit is exactly one nibble.
  • You see hex in colour codes, error codes and memory addresses.
Exam tipAny answer saying hex “uses less memory”, “is faster for the computer” or “is more accurate” earns nothing. Keep it to people: shorter to read, write and remember, so fewer errors.
3.3.3 Units of information

Bits, bytes and units

AQA: a bit is “the fundamental unit of information (a 1 or a 0)”. A byte is “a group of 8 bits”. b stands for bit and B for byte.

  • AQA uses these decimal prefixes, based on powers of 10. Mark schemes reject 1024.
  • Some older books and videos use 1024. That is a different system (kibibytes, mebibytes) that you don’t need.
  • Bits to bytes: ÷ 8. Bytes up to kB, MB, GB, TB: ÷ 1000 at each step. Going down, multiply instead.
  • Comparing quantities: convert them all to the same unit first, then compare.
PrefixSymbolValue (AQA)
kilokB1 kB = 1000 bytes
megaMB1 MB = 1000 kB
gigaGB1 GB = 1000 MB
teraTB1 TB = 1000 GB

Converting between units

Worked exampleConvert 24 000 000 bits to megabytes.
  1. 24 000 000 ÷ 8 = 3 000 000 bytesbits to bytes
  2. 3 000 000 ÷ 1000 = 3000 kBbytes to kB
  3. 3000 ÷ 1000 = 3 MBkB to MB
3 MB
Worked exampleHow many bits are in 1.5 GB?
  1. 1.5 GB = 1500 MB = 1 500 000 kB = 1 500 000 000 bytes× 1000 three times
  2. 1 500 000 000 × 8 = 12 000 000 000bytes to bits
12 000 000 000 bits
Worked exampleWhich is larger: 0.5 TB or 450 000 MB?
  1. 0.5 TB = 500 GB = 500 000 MBsame unit first
  2. 500 000 MB > 450 000 MBcompare
0.5 TB
Exam tipPaper 2 has no calculator, so set out each step. Most students who missed full marks on a unit conversion still got a working mark.
Bit
The fundamental unit of information: a 1 or a 0. Symbol b.
Byte
A group of 8 bits. Symbol B.
Kilobyte (kB)
1000 bytes.
Megabyte (MB)
1000 kilobytes.
Gigabyte (GB)
1000 megabytes.
Terabyte (TB)
1000 gigabytes.
3.3.2 Converting between number bases

How many values can n bits hold?

Each extra bit doubles the number of different patterns.

  • n bits give 2n different values. 3 bits give 8 values: 000, 001, 010, 011, 100, 101, 110, 111.
  • Counting starts at 0, so the largest whole number is one less: 2n − 1. 8 bits: 0 to 255.
  • Bits needed for a number of values: find the smallest n where 2n is at least that number. 20 values need 5 bits (24 = 16 is too few; 25 = 32 is enough).
Bits (n)12345678
Different values (2n)248163264128256
Largest whole number (2n − 1)137153163127255
Exam tip“How many different values can 3 bits represent?” The answer is 8. In 2025 the common wrong answers were 3 (the number of bits) and 7 (the largest value).
3.3.4 Binary arithmetic

Adding binary numbers

You add up to three 8-bit binary numbers, column by column from the right, carrying as in decimal.

  • Count the 1s in the column, including any carry, then use the table: 2 is 10 in binary, 3 is 11.
  • AQA keeps it simple: never more than three 1s in a column, and answers fit in 8 bits.
  • Check by converting each number to decimal, adding, and converting your answer back.
Column adds toWriteCarry
000
110
2 (1 + 1)01
3 (1 + 1 + 1)11

Adding three 8-bit binary numbers

Worked exampleAdd 0101 0110 and 0010 1011.
  1. Right column: 0 + 1 = 1write 1, no carry
  2. Next: 1 + 1 = 10 → write 0, carry 1two 1s
  3. Then 1 + 0 + carry 1 = 10 → write 0, carry 1, and so on to the leftinclude the carry in the count
  4. Check: 86 + 43 = 129convert to decimal
1000 0001
Exam tipThree 1s in a column (two digits plus a carry, or three digits) make 3: write 1 and carry 1. Writing 0 here is the mistake examiners see most.
3.3.4 Binary arithmetic

Logical binary shifts

AQA: “A logical binary shift involves moving the bits of a binary number to the left or right. Vacated positions are filled by zeros.”

  • Left shift of 1 place multiplies by 2. Left shift of n places multiplies by 2n: 2 places × 4, 3 places × 8, 4 places × 16.
  • Right shift of 1 place divides by 2. Right shift of n places divides by 2n.
  • Bits shifted off either end are lost. You only use 8 bits.
  • A right shift that pushes out a 1 loses the remainder: 25 shifted right by 2 gives 6, not 6.25.
  • A left shift that pushes out a 1 gives a wrong answer, because the true answer is too big for 8 bits.
  • Where shifts are used: for simple multiplication and division by powers of 2. A single shift can’t multiply by 3 or 10.

Left and right logical shifts

Worked exampleApply a left shift of 2 to 0000 1011.
  1. 0000 1011 → 0010 1100every bit moves 2 places left; two 0s fill the right
  2. 11 × 4 = 44check: 2 places is × 2² = × 4
0010 1100
Worked exampleApply a right shift of 3 to 0101 0000.
  1. 0101 0000 → 0000 1010three 0s fill the left; three 0s drop off the right
  2. 80 ÷ 8 = 103 places is ÷ 2³ = ÷ 8
0000 1010
Worked exampleApply a left shift of 1 to 1100 0011 using 8 bits.
  1. 1100 0011 → 1000 0110the leftmost 1 is lost
  2. 195 × 2 = 390, but the result is 134390 doesn’t fit in 8 bits (max 255)
1000 0110
Exam tipWhen asked for the “arithmetic effect” of a shift, give the operation and the number: “multiplies by 16”, not “makes it bigger”.
Logical binary shift
Moving the bits of a binary number left or right, filling vacated positions with zeros.
Left shift
Multiplies by 2 for each place shifted.
Right shift
Divides by 2 for each place shifted; any remainder is lost.