AQA GCSE Computer Science (8525) · Data

Fundamentals of data representation: free AQA GCSE Computer Science practice questions

Section 3.3 is the calculation topic on Paper 2: conversions between binary, denary and hexadecimal, binary addition and shifts, and the file size estimates for an image or a sound. The facts below are what those calculations rest on.

Practice

Free practice questions

Data

How many bits are in a nibble?

Based on: AQA 8525 · 3.3.1

Data

What is the denary value of the binary number 01001101?

Based on: AQA 8525 · 3.3.2

Data

What is the hexadecimal value of the binary number 11011110?

Based on: AQA 8525 · 3.3.3

Data

What is 01011010 + 00101101 in 8 bit binary?

Based on: AQA 8525 · 3.3.4

The mistakes that cost the most marks

Most of these are wrong reasons rather than wrong numbers.

  • Saying a computer uses binary because it is faster. The reason is that hardware has two reliable states, so binary is far less error prone.
  • Confusing resolution with colour depth. Resolution is how many pixels. Colour depth is how many bits per pixel.
  • Forgetting that a right shift loses the bits that fall off the end, so dividing an odd number by 2 by shifting loses the remainder.
  • Saying run length encoding always makes a file smaller. On data with few repeats it can make the file larger.
  • Treating Unicode as a kind of compression. It is a character set, and it uses more space per character than ASCII.
  • Giving the number of colours as the colour depth. A colour depth of 4 bits gives 16 colours, not 4.

Bits, bytes and why binary at all

A bit is a single binary digit, 0 or 1. Four bits are a nibble and eight bits are a byte. Everything a computer stores is a pattern of bits. The units go kilobyte, megabyte, gigabyte and terabyte, each 1,000 times the one before in the convention AQA uses. Computers use binary because the hardware has two reliable states, on and off. A two-symbol system is far less error prone than trying to store ten different voltage levels.

Converting between binary, denary and hexadecimal

To convert binary to denary, add up the place values with a 1 above them: 128, 64, 32, 16, 8, 4, 2, 1. So 01001101 is 64 + 8 + 4 + 1, which is 77. To convert denary to binary, subtract the largest place value you can, repeatedly, writing 1 where it fits and 0 where it does not. So 200 is 128 + 64 + 8, which is 11001000. Hexadecimal is base 16, using 0 to 9 and then A to F for 10 to 15. One hex digit represents exactly four bits, so a byte is always two hex digits. Hexadecimal is used because it is shorter and easier for a person to read and copy than a long string of bits, which makes mistakes less likely.

Binary addition, overflow and shifts

Binary addition follows four rules: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 10, which means write 0 and carry 1, and 1 + 1 + 1 = 11, which means write 1 and carry 1. If a carry runs off the left of the byte, that is overflow. Overflow happens when the result of a calculation needs more bits than are available, so the value stored is wrong. A left shift of one place multiplies the number by 2. A right shift of one place divides it by 2. Shifting by n places multiplies or divides by 2 to the power n, and bits shifted off the end are lost.

Characters, images and sound

A character set maps each character to a binary code. ASCII uses 7 bits and covers 128 characters, which is enough for English but not for other writing systems. Unicode uses more bits per character, so it can represent most of the world's writing systems, at the cost of more storage. Character codes for a run of characters are consecutive, so if A is 65 then B is 66. A bitmap image is a grid of pixels. Resolution is the number of pixels and colour depth is the number of bits per pixel. File size in bits is approximately width x height x colour depth, and a colour depth of n bits gives 2 to the power n colours. Sound is recorded by sampling the amplitude of the wave at regular intervals. Sample rate is samples per second and sample resolution is bits per sample. File size in bits is approximately sample rate x sample resolution x duration in seconds. A higher rate or resolution gives a more accurate recording and a bigger file.

Two lossless compression methods you must know

Compression makes files smaller so they take less storage and less time to transmit. Lossless compression can rebuild the original exactly. Lossy compression throws information away permanently. Run length encoding is lossless. It replaces runs of the same value with the value and a count, so it works well on images with large blocks of one colour and badly on noisy photographs. Huffman coding is lossless. It gives the most frequent characters the shortest bit codes, read off a Huffman tree, so ordinary text shrinks a lot.

Resolution and colour depth are different measures
ResolutionColour depth
The number of pixels in the image.The number of bits used for each pixel.
Usually given as width by height.Given in bits per pixel.
Doubling it makes the grid finer.Doubling it allows more colours: n bits give 2 to the power n colours.
Multiplies into the file size as width x height.Multiplies into the file size as bits per pixel.
FAQ

Frequently asked questions

Why do computers use binary?

Because the hardware has two reliable states, on and off. A two-symbol system is far less error prone than storing ten different voltage levels. Saying binary is faster is the answer that loses the mark.

How do I convert binary to denary?

Add up the place values that have a 1 above them: 128, 64, 32, 16, 8, 4, 2, 1. For example 01001101 is 64 + 8 + 4 + 1, which is 77.

Why is hexadecimal used at all?

It is far shorter and easier for a person to read and copy than a long string of bits, which makes mistakes less likely. One hex digit is exactly four bits, so a byte is always two hex digits.

What is the difference between ASCII and Unicode?

ASCII uses 7 bits and covers 128 characters, enough for English. Unicode uses more bits per character so it can represent most of the world's writing systems, at the cost of more storage. Unicode is not a form of compression.

Does run length encoding always make a file smaller?

No. It replaces runs of the same value with the value and a count, so it works well on images with large blocks of one colour. On data with few repeats it can make the file larger.

RiverMap Learning apps are independent study tools. They are not affiliated with, endorsed by, or connected to any government body or examination authority. Question content is original and based on publicly available official study materials.