OCR GCSE Computer Science (J277) · Paper 1
🔢 Data Representation
Revision notes written to the specification, with examiner tips and the required practicals. Every point here has flashcards in the Stickwise app.
Binary, hex & units
Computer hardware can only tell ON from OFF, so all data is stored as binary. The units of data climb in multiples of 1000: a bit is a single 0 or 1, four bits make a nibble, eight bits make a byte, and from there the units continue upward through KB, MB, GB, TB and PB. The rule behind all of this is that n bits give 2ⁿ possible values, so one byte gives 256 patterns, representing the numbers 0–255.
Binary to denaryWrite the place values 128 down to 1 above the bits, then add together the columns that contain a 1.
Denary to binaryWork down the place values, subtracting a place value whenever you can: write a 1 where you took it away, and a 0 where you did not.
Binary additionAdd binary numbers column by column, carrying as you go: 1 + 1 = 0 carry 1, and 1 + 1 + 1 = 1 carry 1. For example, 00101101 + 01100110 = 10010011, which is worth checking in denary: 45 + 102 = 147. If a carry is produced off the left-hand end of the number, this is called overflow.
ShiftsA left shift multiplies the value by 2 for each place shifted, and a right shift divides it by 2 for each place, with any remainder lost.
Hex and binaryEach hex digit is exactly one nibble, so B3 converts to 1011 0011. To convert the other way, group the binary digits into fours starting from the right, then convert each group to hex.
Hex and denaryTo convert hex to denary, multiply the first digit by 16 and add the second: 2F is 2 × 16 + 15, which is 47. To convert denary to hex, divide by 16 and use the quotient and remainder as the two digits.
Characters, images, sound & compression
CharactersText is stored as numbered symbols, and the number of bits used per character limits how many characters the set can hold, following the 2ⁿ rule. ASCII uses 7 bits, giving 128 characters, and extended ASCII uses 8 bits, giving 256. Unicode uses 16 to 32 bits, which is enough for every language and emoji, at the cost of more storage per character.
ImagesA bitmap image is stored as a grid of pixels. Its resolution (the number of pixels) and its colour depth (the number of bits per pixel) together determine both its quality and its file size. Metadata, such as the image's width, height and colour depth, tells the computer how to rebuild the picture.
SoundSound waves are sampled thousands of times a second. The sample rate, in Hz, combined with the bit depth, determines the fidelity of the recording: the higher both values are, the truer the sound but the larger the file.
CompressionLossy compression discards detail permanently, as in JPEG and MP3 files, and should never be used for code. Lossless compression repacks the data perfectly with nothing lost, as in PNG and ZIP files. Compressing files means less storage is needed, transfer is faster, less bandwidth is used, and streaming runs more smoothly.
Image size in bits is width × height × colour depth, then divide by 8 to convert to bytes. For example, a 100 × 100 image at an 8-bit colour depth is 100 × 100 × 8 ÷ 8, which comes to 10,000 bytes.
Sound file size in bits is sample rate × duration × bit depth, then divide by 8 to convert to bytes. For example, a sample rate of 44,100 Hz for 10 seconds at a 16-bit depth is 44,100 × 10 × 16 ÷ 8, which comes to approximately 0.88 MB.
🎯 Examiner tip: Every file-size mark scheme has the same hidden step: your multiplication gives an answer in bits, so you must divide by 8 before giving the answer in bytes. Write the ÷ 8 step explicitly to earn the mark.
Turn these notes into memory. 23 flashcards cover this topic. Short daily sessions, spaced repetition up to your exam date, quizzes with friends. Free during the beta.Practise Data Representation in the app ↗