Skip to main content
EnglandComputer Science

Edexcel GCSE Computer Science Topic 2 Data: binary, two's complement, hexadecimal, ASCII, images, sound, storage and compression

A deep-dive Edexcel GCSE Computer Science guide to Topic 2 Data. Covers why computers use binary and the number of states a pattern holds, unsigned and two's complement signed integers, denary-binary conversion, binary addition and shifts, overflow, hexadecimal, 7-bit ASCII, bitmap images, sampled sound, the binary storage multiples and file-size calculations, and lossy and lossless compression.

Generated by Claude Opus 4.815 min readTopic 2

Reviewed by: AI editorial process; not yet individually human-reviewed

Jump to a section
  1. What Topic 2 actually demands
  2. Binary, states and signed numbers
  3. Binary arithmetic, shifts and hexadecimal
  4. Encoding characters, images and sound
  5. Storage and compression
  6. Check your knowledge

What Topic 2 actually demands

Data is the most numerical part of the course and a major part of Paper 1. You must move fluently between the number representations, handle signed numbers in two's complement, add binary and shift bits, recall the binary storage units, and calculate file sizes and capacity. You also need to explain how characters, images and sound are encoded as binary, the limitations that a fixed number of bits imposes, and why and how data is compressed.

This guide ties together the seven dot-point pages for Topic 2.

Binary, states and signed numbers

Computers use binary because their components have two stable states that map to 1 and 0. A pattern of nn bits holds 2n2^n states. Whole numbers are stored as unsigned integers (8 bits give 0 to 255) or as two's complement signed integers (8 bits give -128 to +127, with the leftmost bit worth -128). Two's complement of a negative number is found by inverting the bits of the positive value and adding 1.

Binary arithmetic, shifts and hexadecimal

Binary addition adds column by column with carries, and overflow occurs when the result needs more bits than the register holds, so a bit is lost and the answer is wrong. A binary shift moves bits left (multiply by 2n2^n) or right (divide by 2n2^n); a logical shift fills with 0, while an arithmetic right shift copies the sign bit. Hexadecimal is a shorthand where one hex digit equals four bits, so converting to and from binary is done in nibbles.

Encoding characters, images and sound

7-bit ASCII maps each character to one of 27=1282^7 = 128 codes, with letters and digits in consecutive order. A bitmap image is a grid of pixels, where resolution (number of pixels) and colour depth (bits per pixel) set the quality and size. Sound is analogue, so it is sampled: the sample rate (samples per second) and bit depth (bits per sample) set the quality and size. A fixed number of bits limits the colours, amplitudes and detail that can be stored.

Storage and compression

Storage uses binary multiples: bit, nibble, byte, then kibibyte, mebibyte, gibibyte and tebibyte, each 10241024 of the one below. File-size and capacity calculations use these factors. Compression reduces file size to save storage and transfer faster: lossless keeps all the data so the original can be rebuilt exactly, while lossy permanently removes data for much smaller files (MP3, JPEG).

Check your knowledge

A mix of conversion, calculation and recall questions covering Topic 2. Attempt them, then check against the solutions.

  1. State the number of states a 5-bit pattern can hold. (1 mark)
  2. Convert the denary number 100 to 8-bit unsigned binary. (2 marks)
  3. State the 8-bit two's complement range. (1 mark)
  4. Convert the binary number 11001010 to hexadecimal. (2 marks)
  5. State how many characters 7-bit ASCII can represent. (1 mark)
  6. Calculate the file size in bytes of a 100 by 80 pixel image at 8 bits per pixel. (2 marks)
  7. State how many bytes are in a kibibyte. (1 mark)
  8. State one difference between lossy and lossless compression. (2 marks)

Sources & how we know this

  • computer-science
  • gcse-edexcel
  • edexcel-computer-science
  • data
  • gcse
  • binary
  • hexadecimal
  • compression