All exams← All GCSE Computer Science (AQA) notes

Data representation & binary: GCSE Computer Science (AQA) revision notes

Revision notes

Why binary?

Computers are built from transistors that are either on or off, so they can only reliably store two states: 1 and 0. This is called binary (base 2). Everything a computer stores, text, numbers, images, sound, is ultimately just patterns of binary digits (bits).

Bits, nibbles, bytes

  • A bit is a single 0 or 1.
  • A nibble is 4 bits.
  • A byte is 8 bits, and can represent 256 different values (0 to 255).
  • Storage units scale up in multiples of 1024 for the exam: 1 KB = 1024 bytes, 1 MB = 1024 KB, 1 GB = 1024 MB, 1 TB = 1024 GB.

Binary to denary (and back)

Each bit position in an 8-bit binary number is worth a power of 2, reading left to right: 128, 64, 32, 16, 8, 4, 2, 1. To convert binary to denary, add up the place values where there is a 1. To convert denary to binary, subtract the largest place value that fits, repeatedly, marking 1s and 0s as you go.

Binary addition and overflow

Add binary numbers column by column like normal addition, carrying when a column totals 2 or more (1+1=10, carry the 1). If an 8-bit register cannot hold the result of an addition, this is called overflow, and it causes an error because the number is too big to store.

Hexadecimal

Hexadecimal (base 16) uses digits 0 to 9 then A to F (A=10 up to F=15). It is used because it is a much shorter way of representing binary, one hex digit exactly represents one nibble (4 bits), so a byte is always 2 hex digits. Hex is used for MAC addresses, colour codes (like #FF0000), and memory addresses because it is easier for humans to read than long strings of 1s and 0s.

Character encoding

Characters are stored using a code that maps each character to a binary number. ASCII uses 7 or 8 bits, giving 128 or 256 possible characters, enough for English letters, numbers and symbols. Unicode uses more bits (commonly 16), allowing over 100,000 characters, so it can represent every language and symbol in the world, including emoji.

Images

A bitmap image is stored as a grid of pixels. Each pixel's colour is stored as a binary number. Colour depth (bits per pixel) determines how many colours are possible, more bits means more colours but a bigger file. Resolution (the number of pixels) also affects file size and image quality, higher resolution means more pixels and a larger file.

Sound

Sound is analogue in the real world, so it must be sampled to be stored digitally. Sample rate is how many samples are taken per second (measured in Hz). Bit depth is how many bits are used to store each sample. Higher sample rate and higher bit depth both improve sound quality but increase file size.

Common mistakes

  • Forgetting binary place values start at 128 for 8 bits, not 256.
  • Mixing up bits and bytes (8 bits = 1 byte).
  • Forgetting each hex digit maps to exactly a nibble.
  • Confusing sample rate (samples per second) with bit depth (bits per sample).

Key facts

Flashcards

How many bits are in a byte?
8 bits.
tap to reveal
How many different values can a single byte store?
256 (0 to 255).
tap to reveal
What are the place values for an 8-bit binary number, left to right?
128, 64, 32, 16, 8, 4, 2, 1.
tap to reveal
Convert the binary number 10110101 to denary.
128+32+16+4+1 = 181.
tap to reveal
What is overflow in binary addition?
When the result of an addition is too big to fit in the number of bits available, causing an error.
tap to reveal
What base is hexadecimal, and what digits does it use?
Base 16, using digits 0-9 then A-F, where A=10 and F=15.
tap to reveal
How many bits does one hexadecimal digit represent?
4 bits (a nibble).
tap to reveal
Why is hexadecimal used instead of binary in things like colour codes and MAC addresses?
It is much shorter and easier for humans to read than long strings of 1s and 0s, while still mapping exactly onto binary.
tap to reveal
What is the difference between ASCII and Unicode?
ASCII uses 7 or 8 bits for up to 256 characters (mainly English); Unicode uses more bits (commonly 16) to represent over 100,000 characters from all languages and symbols.
tap to reveal
What two factors affect the file size and quality of a bitmap image?
Resolution (number of pixels) and colour depth (bits per pixel).
tap to reveal
What is sample rate in digital sound?
The number of samples taken per second, measured in Hz.
tap to reveal
What is bit depth in digital sound?
The number of bits used to store each sample; higher bit depth means better quality but larger file size.
tap to reveal
How many bytes are in 1 KB, and 1 KB in 1 MB, for exam purposes?
1 KB = 1024 bytes, and 1 MB = 1024 KB.
tap to reveal
What is a nibble?
4 bits, half of a byte.
tap to reveal
Why do computers use binary rather than denary?
Because they are built from transistors that can only reliably represent two states, on (1) and off (0).
tap to reveal
Practice questions

Data representation & binary: 5 practice questions

Q1. What is the denary (base 10) value of the 8-bit binary number 10110101?
  • A.  165
  • B.  213
  • C.  181
  • D.  173
Show answer & explanation
✓ Answer: C. 181
Adding the place values where there is a 1 (128+32+16+4+1) gives 181. A common mistake is to misread the bit weights or add the wrong set of columns, which produces 173 or 165 instead.
Q2. What is the largest unsigned value that can be stored in one byte?
  • A.  255
  • B.  999
  • C.  128
  • D.  256
Show answer & explanation
✓ Answer: A. 255
A byte has 8 bits, and 8 bits can represent 2^8 = 256 different values, from 0 to 255. Students often confuse 256 (the number of values) with 255 (the maximum value), forgetting that zero is included.
Q3. Which term describes a group of 4 bits?
  • A.  Nibble
  • B.  Word
  • C.  Octet
  • D.  Byte
Show answer & explanation
✓ Answer: A. Nibble
A nibble is exactly half a byte, made up of 4 bits, and is commonly used to represent a single hexadecimal digit. A byte is 8 bits and a word is a group of bits handled together by the CPU, which varies by system.
Q4. Convert the denary number 90 into an 8-bit binary number.
  • A.  01011010
  • B.  01100101
  • C.  01011100
  • D.  01011001
Show answer & explanation
✓ Answer: A. 01011010
90 = 64 + 16 + 8 + 2, so the bits set are in the 64, 16, 8 and 2 columns, giving 01011010. Miscounting which powers of two sum to 90 is the usual source of the wrong answers offered here.
Q5. What is the result of the binary addition 00001111 + 00000001?
  • A.  11110000
  • B.  00010001
  • C.  00001110
  • D.  00010000
Show answer & explanation
✓ Answer: D. 00010000
1111 in binary is 15, and adding 1 gives 16, which is 00010000. This is a carry-cascade case where each column of 1s carries into the next, a pattern students often stop partway through.
Test yourself
See the GCSE Computer Science (AQA) page

More GCSE Computer Science (AQA) topics