GCSE / Computer

Fundamentals of Data Representation

Learn how computers represent and store data using binary, hexadecimal, bits and bytes. This GCSE Computer Science topic covers number-base conversions, binary arithmetic and shifts, ASCII and Unicode character encoding, bitmap image representation, digital sound, file-size calculations and data compression using Huffman coding and run-length encoding.

Computers use binary to represent all data and instructions because electronic circuits can reliably distinguish between two states, represented as 0 and 1. Binary is base 2, decimal is base 10 and hexadecimal is base 16. Hexadecimal uses the digits 0–9 and letters A–F, where A represents 10 and F represents 15.
Binary, decimal and hexadecimal are different number systems used in computing. Students must be able to convert whole numbers between binary and decimal, binary and hexadecimal, and decimal and hexadecimal. For this GCSE specification, values up to decimal 255 are required; 255 in binary is 11111111 and in hexadecimal is FF.
Binary place values are powers of 2. For an 8-bit binary number the place values are 128, 64, 32, 16, 8, 4, 2 and 1. To convert binary to decimal, add the place values containing a 1. To convert decimal to binary, determine which powers of 2 combine to make the decimal value.
Hexadecimal is useful in computer science because one hexadecimal digit represents exactly four binary bits. This makes long binary values shorter and easier for humans to read, write and check while still having a direct relationship with binary data.
A bit is the fundamental unit of digital information and can have a value of either 0 or 1. A byte contains 8 bits. Students should understand how many bits are in a byte and compare quantities of digital storage using bytes and their standard prefixes.
Decimal storage prefixes used in the specification are kilo, mega, giga and tera. 1 kB=1,000bytes,1MB=1,000kB,1GB=1,000MBand1TB=1,000GBkB = 1,000 bytes, 1 MB = 1,000 kB, 1 GB = 1,000 MB and 1 TB = 1,000 GB. These prefixes are based on powers of 10 rather than powers of 2.
Binary arithmetic includes adding together up to three binary numbers, normally using no more than 8 bits per number. Binary addition follows the same place-value principle as decimal addition, but because binary contains only 0 and 1, 1 + 1 produces binary 10 and a carry into the next column.
A binary shift moves all bits to the left or right. A logical left shift multiplies an unsigned binary value by powers of 2, while a logical right shift divides it by powers of 2. For example, shifting 00000101 one place left gives 00001010, changing decimal 5 to decimal 10.
Character encoding assigns binary codes to characters. GCSE students need to understand 7-bit ASCII and Unicode, use character encoding tables to convert characters into character codes and convert character codes back into characters. Character codes are often arranged sequentially in encoding tables.
ASCII can represent a relatively limited set of characters. Unicode was developed to represent a much larger range of characters, alphabets and symbols used around the world. Unicode shares the same character codes as ASCII for ASCII characters up to code 127, making the two systems compatible for those characters.
Digital bitmap images are made from pixels. A pixel, short for picture element, is a single point in an image. Image dimensions are measured using width × height in pixels. Increasing the number of pixels generally increases image detail but also increases the amount of data needed to store the image.
Colour depth is the number of bits used to represent the colour of each pixel. A greater colour depth allows more possible colours because the number of available colours is 2 raised to the number of colour-depth bits. Increasing either image dimensions or colour depth increases bitmap file size.
Bitmap image file size can be calculated using: file size in bits=width×height×colourdepthbits = width × height × colour depth. File size in bytes=(width×height×colourdepth)÷8bytes = (width × height × colour depth) ÷ 8. Students should also be able to convert simple binary patterns into bitmap images and convert simple bitmap images back into binary data.
Sound is analogue in the real world and must be converted into digital data for computer storage and processing. Sampling records the amplitude of an analogue signal at regular intervals. Sampling rate is the number of samples taken per second and is measured in hertz, while sample resolution is the number of bits used to store each sample. Sound file size in bits=samplingrate×sampleresolution×durationbits = sampling rate × sample resolution × duration in seconds.
Data compression reduces the amount of data required to store a file. Students must understand Huffman coding and run-length encoding (RLE). Huffman coding uses shorter binary codes for frequently occurring symbols and longer codes for less frequent symbols. RLE stores repeated values using frequency/data pairs. Students should interpret Huffman trees, calculate compressed and uncompressed sizes, calculate bits saved, and create or interpret RLE frequency/data pairs.
Fundamentals of Data Representation | GCSE Computer Science