Data representation — Edexcel GCSE Computer Science
Verified courseTeaching note checked against the official specification.
Data representation explained
Data representation covers 4 specification points, including Understand how computers encode characters… and Understand how bitmap images are represented….
Read the full explanation
Open a point below for its explanation and revision guidance.
2.2.1 understand how computers encode characters using 7-bit ASCII
Computers store characters as binary codes so that text can be processed, compared and transmitted consistently. In 7-bit ASCII each character is given a unique 7-bit pattern, so there are 2⁷ = 128 possible codes, numbered 0 to 127. For example, the capital letter A is code 65, which is 1000001 in 7 bits; the digit 0 is code 48, which is 00110000 in 8 bits when a leading zero is added. A computer looks up the code for a character when it stores it, and looks up the character for a code when it displays or prints it. Because the code length is fixed at 7 bits, every character takes the same space, and codes can be sorted into a standard order. The 128 codes cover control codes and printable characters such as letters, digits and punctuation, which is enough for basic English text but not for the full range of world languages.
2.2.2 understand how bitmap images are represented in binary (pixels, resolution, colour depth)
A bitmap image is stored as a grid of pixels, and each pixel is given a binary code for its colour. The resolution is the number of pixels in the image, often written as width × height, such as 1920 × 1080, which is 2 073 600 pixels. The colour depth is the number of bits used for each pixel; a colour depth of n bits gives 2ⁿ possible colours, so 1 bit gives 2 colours, 3 bits give 8 colours and 8 bits give 256 colours. The file size in bits is the number of pixels multiplied by the colour depth, so a 1920 × 1080 image at 8-bit colour depth needs 2 073 600 × 8 = 16 588 800 bits, which is 16 588 800 ÷ 8 = 2 073 600 bytes. Increasing resolution or colour depth stores more detail or more colours but increases the file size.
2.2.3 understand how analogue sound is represented in binary (amplitude, sample rate, bit depth, sample interval)
Analogue sound is a continuously changing pressure wave, so a computer must capture it as discrete measurements. At regular moments the microphone voltage is measured and each measurement is stored as a binary number. Amplitude is the height of the wave at that instant, so it sets the value recorded. Sample interval is the time gap between measurements, and sample rate is how many samples are taken each second, so a shorter interval gives a higher rate. Bit depth is the number of bits used for each sample, so it fixes how many different amplitude levels can be coded. For example, a rate of 44 100 samples per second with a bit depth of 16 bits gives 65 536 possible levels per sample. More samples and more bits give a closer copy of the original wave, but the file needs more storage.
2.2.4 understand the limitations of binary representation of data when constrained by the number of available bits
A fixed number of bits can store only a fixed set of values, so binary representation always has limits. With n bits there are 2ⁿ different patterns, so the range of unsigned integers runs from 0 to 2ⁿ − 1. For example, 8 bits give 256 patterns, covering 0 to 255, so the value 256 cannot be stored in 8 bits. If a result exceeds the largest storable value, overflow occurs and the extra carry has nowhere to go. Fewer bits also mean coarser resolution: a 4-bit sample has only 16 amplitude levels, while 8 bits give 256. Rounding or truncation happens when a value cannot be represented exactly, such as a fraction stored with a limited number of fractional bits. Adding bits widens the range and improves precision, but every extra bit doubles the number of patterns and increases storage.
Your focus
- State that 7-bit ASCII uses 7 bits per character and gives 128 codes.
- Convert a given ASCII character to its 7-bit binary code and back.
- Explain why 7-bit ASCII cannot represent every character in every language.
Show all 12 objectives
- Describe how a bitmap image is stored as pixels with binary colour codes.
- Calculate the number of colours from a given colour depth and the file size from pixels and colour depth.
- Explain how changing resolution or colour depth affects image quality and file size.
- Describe how an analogue sound wave is sampled and stored as binary values.
- Explain the meaning of amplitude, sample rate, bit depth and sample interval.
- Relate changes in sample rate and bit depth to the accuracy and size of a digital sound recording.
- State the number of values and the unsigned range that n bits can represent.
- Explain what happens when a value is too large for the available bits.
- Describe how a limited number of bits reduces the precision of stored data.
Data representation exam tips
Marking Points
- 7-bit ASCII uses exactly 7 bits per character, giving 2⁷ = 128 distinct codes, numbered 0 to 127.
- Each character maps to one unique code, so the same code always represents the same character.
- The capital letter A has code 65, written as 1000001 in 7 bits.
- The digit 0 has code 48, written as 0110000 in 7 bits or 00110000 when padded to 8 bits.
- A computer encodes text by replacing each character with its code and decodes text by replacing each code with its character.
- 7-bit ASCII covers 128 codes including control codes and printable English characters, so it cannot represent all world languages.
- A bitmap image is a grid of pixels, and each pixel is stored as a binary code for its colour.
- Resolution is the number of pixels in the image, for example 1920 × 1080 = 2 073 600 pixels.
- Colour depth is the number of bits used per pixel, and n bits give 2ⁿ possible colours.
- File size in bits = number of pixels × colour depth; divide by 8 to convert bits to bytes.
- A 1920 × 1080 image at 8-bit colour depth needs 2 073 600 × 8 = 16 588 800 bits = 2 073 600 bytes.
- Increasing resolution or colour depth increases the file size and the amount of detail or colour stored.
- Amplitude is the size or height of the sound wave at the moment a sample is taken, and it determines the binary value stored for that sample.
- Sample interval is the time between one sample and the next; a shorter interval means more samples are taken in each second.
- Sample rate is the number of samples taken per second, so it is the reciprocal of the sample interval.
- Bit depth is the number of bits used to store each sample, and it determines how many distinct amplitude levels can be represented.
- A higher sample rate captures faster changes in the wave, and a greater bit depth reduces the rounding error between the stored level and the true amplitude.
- Increasing sample rate or bit depth improves the accuracy of the representation but increases the number of bits needed to store the sound.
- With n bits there are 2ⁿ distinct bit patterns, so the number of representable values is limited by the number of available bits.
- For unsigned integers, n bits represent the range 0 to 2ⁿ − 1; for example, 8 bits represent 0 to 255.
- Overflow occurs when a calculation produces a value outside the range that the available bits can represent, so the result cannot be stored correctly.
- A smaller number of bits gives coarser resolution, so values such as measurements or sound amplitudes are rounded to the nearest representable level.
- Increasing the number of bits widens the range and improves precision, but it also increases the storage needed for each value.
- Limitations apply to all data types, including integers, characters and sampled sound, because each uses a fixed number of bits per value.
Examiner Tips
- 💡Learn the key values: 2⁷ = 128 codes, A = 65 = 1000001, a = 97, and 0 = 48.
- 💡When converting a character to binary, write exactly 7 bits and pad with leading zeros if needed.
- 💡Check whether a question asks for the number of bits, the number of codes or a specific code value before answering.
- 💡Write the formula file size in bits = pixels × colour depth before substituting numbers.
- 💡Convert bits to bytes by dividing by 8, and to kilobytes by dividing by 1024 if required.
- 💡Check whether the question asks for file size in bits, bytes or kilobytes before giving the final answer.
- 💡Link each term to its effect: amplitude to the stored value, sample rate to how often values are taken, bit depth to how many levels exist.
- 💡Use the reciprocal relationship when a question gives a sample interval and asks for a rate, or the reverse.
- 💡Check whether a question asks about quality or file size, because higher sample rate and bit depth improve quality but increase storage.
- 💡Calculate the number of patterns as 2ⁿ and the unsigned range as 0 to 2ⁿ − 1 before choosing an answer.
- 💡Identify overflow by comparing the required value with the maximum representable value for the given number of bits.
- 💡When a question mentions quality or accuracy, link the limitation to rounding or truncation caused by too few bits.
Common Mistakes
- Thinking ASCII uses 8 bits per character: 7-bit ASCII uses 7 bits, giving 128 codes, although an eighth bit may be added as a leading zero when storing in a byte.
- Confusing the number of codes with the number of bits: 7 bits give 2⁷ = 128 codes, not 7 codes.
- Assuming the code for A is 1 because A is the first letter: the code for A is 65, and codes 0 to 64 are used by other characters and control codes.
- Believing 7-bit ASCII can represent any character in any language: its 128 codes cover basic English characters and control codes only.
- Confusing resolution with colour depth: resolution is the number of pixels, while colour depth is the bits per pixel.
- Using 2ⁿ for the number of pixels instead of the number of colours: n bits of colour depth give 2ⁿ colours.
- Forgetting to divide by 8 when converting a file size in bits to bytes.
- Adding resolution and colour depth instead of multiplying them when calculating file size.
- Confusing sample rate with bit depth: sample rate is how often measurements are taken each second, while bit depth is how many bits each measurement uses.
- Thinking amplitude is the number of samples per second: amplitude is the height of the wave at a sample point, not a count of samples.
- Believing a higher bit depth makes the sound play faster: bit depth changes the number of amplitude levels, not the playback speed.
- Treating sample interval and sample rate as unrelated: they are reciprocals, so halving the interval doubles the rate.
- Thinking n bits store 2n values: the number of patterns is 2ⁿ, so 8 bits give 256 patterns, not 16.
- Believing the largest unsigned value is 2ⁿ: the range is 0 to 2ⁿ − 1, so 8 bits stop at 255.
- Assuming overflow changes the value to the correct larger number: overflow means the result cannot be represented in the available bits, so the stored pattern is wrong.
- Confusing range with precision: adding bits increases both the largest value and the number of levels, but these are separate effects.