KS4J277 1.2.3 18 min read 10 question quiz 17 exam marks

Units of Data

Bits, nibbles and bytes through to petabytes, why computers use binary at all, and how to answer file size calculation questions without losing marks on the units.

Why binary

Computers use binary, base 2, because the components they are built from have exactly two reliable states.

A transistor is either conducting or not. A capacitor is charged or not. A region of a disk is magnetised one way or the other. Two states can be distinguished quickly and reliably even when voltages fluctuate slightly.

Ten distinguishable voltage levels for denary would be far harder to build, far more error prone, and far more expensive. So everything, numbers, text, images, sound, instructions, is stored as patterns of 1s and 0s.

The exam answer

Computers use binary because their electronic components have two states, on and off, which can represent 1 and 0 reliably.

The units

UnitSymbolSize
BitbA single 1 or 0, the smallest unit of data
Nibble4 bits
ByteB8 bits
KilobyteKB1000 bytes
MegabyteMB1000 kilobytes
GigabyteGB1000 megabytes
TerabyteTB1000 gigabytes
PetabytePB1000 terabytes
1000 or 1024

OCR J277 uses 1000, not 1024. Historically 1 KB meant 210 = 1024 bytes, and some software still reports sizes that way, but for this specification use powers of 1000. If a question uses 1024 it will say so.

Converting between units

To go up a unit, divide by 1000. To go down a unit, multiply by 1000.

  • 6000 bytes = 6 KB
  • 3.5 MB = 3500 KB = 3,500,000 bytes
  • 12,000,000,000 bytes = 12 GB

Bits to bytes: divide by 8. Bytes to bits: multiply by 8.

  • 2 KB = 2000 bytes = 16,000 bits
The units of data storage, each step a thousand times the lastThe units of data storage drawn as a staircase, each step sitting on the one below it. A bit is a single binary digit, one 0 or one 1, and it is the smallest thing a computer can store. A nibble is four bits. Eight bits make a byte, which is enough to hold one character of text. A thousand bytes make a kilobyte, roughly a page of plain text. A thousand kilobytes make a megabyte, about the size of a photograph or a minute of music. A thousand megabytes make a gigabyte, about a film, and a thousand gigabytes make a terabyte, about the capacity of a hard disk. Each step up from the byte is a thousand times the last.bit1byte8 bitsAKB1,000 bytesa page of textMB1,000 KBa photographGB1,000 MBa filmTB1,000 GBa hard diskeach step up is × 100012345
  1. A bit is one binary digit: a single 0 or a single 1.
  2. Eight bits make a byte, which is enough for one character.
  3. A thousand bytes make a kilobyte. A page of plain text.
  4. A thousand kilobytes make a megabyte. A photograph, or a minute of music.
  5. A thousand megabytes make a gigabyte, and a thousand of those a terabyte.
Each step up is a thousand times the last. That is why a film does not fit on a floppy disk and a text file always will.

Calculating file sizes

Three formulas cover almost every calculation question at GCSE.

Text

file size (bits) = number of characters x bits per character

A 500 character message in ASCII, which uses 7 bits per character:

500 x 7 = 3500 bits = 437.5 bytes

Images

file size (bits) = colour depth x image height in pixels x image width in pixels

A 400 by 300 image with a colour depth of 8 bits:

8 x 400 x 300 = 960,000 bits = 120,000 bytes = 120 KB

Sound

file size (bits) = sample rate x duration in seconds x bit depth

A 30 second clip at 44,100 Hz with a bit depth of 16:

44100 x 30 x 16 = 21,168,000 bits = 2,646,000 bytes = 2.646 MB

Marks are lost on units, not maths

Read the question. If it asks for the answer in kilobytes and you leave it in bits, you lose the mark even though your arithmetic was perfect. Write the unit after every line of working.

A worked full mark answer

An image is 1000 pixels wide, 800 pixels high, with a colour depth of 24 bits. Calculate the file size in megabytes.

24 x 1000 x 800 = 19,200,000 bits 19,200,000 / 8 = 2,400,000 bytes 2,400,000 / 1000 = 2400 KB 2400 / 1000 = 2.4 MB

Every line shows a unit. Even if the final division went wrong, the working earns method marks.

File size calculator

Work out the size of an image, a sound file or a block of text, one conversion at a time. This tool needs JavaScript, so turn it on to use it. Everything you need to answer the exam question is explained in the text above.

File size formulas for an image, a sound and a piece of text, each worked through to a size in bytesThe file size of three kinds of data, each worked through from the formula to a size. For an image, multiply the width by the height by the colour depth: 1,000 times 800 times 24 is 19,200,000 bits, which divided by 8 is 2,400,000 bytes, or 2.4 megabytes. For a sound, multiply the sample rate by the bit depth by the number of seconds: 44,100 times 16 times 10 is 7,056,000 bits, which divided by 8 is 882,000 bytes, or 0.88 megabytes. For text, multiply the number of characters by the bits per character: 2,000 times 8 is 16,000 bits, which divided by 8 is 2,000 bytes, or 2 kilobytes. To move up the units, divide bits by 8 for bytes, then by 1,000 for kilobytes, megabytes and gigabytes. OCR, AQA and Key Stage 3 use 1,000. Edexcel uses 1,024 and the names kibibyte, mebibyte and gibibyte.Image1width1,000× height800× colour depth24= 19,200,000 bits÷ 8 = 2,400,000 bytes2.4 MBSound2sample rate44,100× bit depth16× seconds10= 7,056,000 bits÷ 8 = 882,000 bytes0.88 MBText3characters2,000× bits each8= 16,000 bits÷ 8 = 2,000 bytes2 KBFrom bits to bigger units4bits÷ 8bytes÷ 1000KB÷ 1000MB÷ 1000GBOCR, AQA and Key Stage 3 divide by 1000. Edexcel divides by 1024 and writes KiB, MiB and GiB.
  1. Image: width × height × colour depth. Every pixel costs the colour depth in bits.
  2. Sound: sample rate × bit depth × seconds, and × 2 for stereo.
  3. Text: number of characters × bits per character. ASCII uses 8.
  4. Divide by 8 to turn bits into bytes, then by 1,000 for each step up.
Every file size question is the same three steps: multiply, divide by 8, then change the unit. Show each step.

Key terms you must be able to define

Bit
A binary digit, either 1 or 0. The smallest unit of data a computer can store.
Nibble
Four bits, half a byte.
Byte
Eight bits. The standard unit for measuring file sizes.
Kilobyte
1000 bytes in the OCR specification.
Colour depth
The number of bits used to store the colour of each pixel in an image.
Sample rate
The number of audio samples recorded each second, measured in hertz.
Bit depth
The number of bits used to store each individual audio sample.

Flashcards

Say the definition out loud before you flip the card. Retrieving it from memory is what builds recall, reading it again is not.

DefineBit
AnswerA binary digit, either 1 or 0. The smallest unit of data a computer can store.
DefineNibble
AnswerFour bits, half a byte.
DefineByte
AnswerEight bits. The standard unit for measuring file sizes.
DefineKilobyte
Answer1000 bytes in the OCR specification.
DefineColour depth
AnswerThe number of bits used to store the colour of each pixel in an image.
DefineSample rate
AnswerThe number of audio samples recorded each second, measured in hertz.
DefineBit depth
AnswerThe number of bits used to store each individual audio sample.

Reach the top grade on this topic

This topic is pure technique, and technique is the easiest place to guarantee marks.

Always show working line by line, with units. Examiners award method marks. A single number with no working scores nothing if it is wrong, while correct working with an arithmetic slip at the end usually still scores most of the marks.

Convert at the end, not in the middle. Do the multiplication in bits, then convert down step by step: bits to bytes, bytes to KB, KB to MB. Converting halfway through is where errors creep in.

Watch the wording. "How many bits" and "how many bytes" differ by a factor of 8. "Colour depth of 3 bits" means 23 = 8 possible colours, not 3 colours.

  • Learn the three formulas by heart: text, image, sound
  • Practise converting bits to megabytes in four clean steps
  • Always finish with the unit the question asked for

Mistakes that cost marks here

Avoid these
  • Using 1024 instead of 1000. OCR J277 uses 1000.
  • Forgetting to divide by 8 when the answer must be in bytes rather than bits.
  • Confusing colour depth with number of colours. A colour depth of n bits gives 2 to the power n colours.
  • Giving an answer with no unit, or with the wrong unit.
  • Doing all the conversions in one step in your head and getting the power of ten wrong.
Fun fact

A nibble is half a byte, and yes, it is genuinely spelled that way in textbooks because it is half a byte. Computing has a long history of engineers naming things at the end of a very long day.

Knowledge check

0 of 10 answered
1How many bits are in a byte?
2According to the OCR specification, how many bytes are in a kilobyte?
3An image is 200 by 100 pixels with a colour depth of 4 bits. What is its file size in bits?
4Convert 24,000,000 bits into megabytes.
5A colour depth of 8 bits allows how many different colours?
6Why do computers use binary rather than denary?
7A 20 second sound clip is sampled at 8000 Hz with a bit depth of 8. What is the file size in bits?
8What is a nibble?
9Which is the largest of these?
10A text file contains 2000 characters stored in ASCII using 7 bits each. What is the size in bytes?
Score 0 / 10

Exam-style questions

Five written questions in the style of the real paper. Write a full answer, then let the marker check it against the mark scheme.

17 marks
1Explain why data is stored in binary in a computer system.2 marks
Explain

Mark scheme0 / 2
  • LElectronic components have two states, such as on and off or high and low voltage
  • LThese two states directly represent 1 and 0, and are reliable to distinguish
Model answer

Data is stored in binary because the electronic components inside a computer, such as transistors, have two reliable states: they are either conducting or not conducting, which corresponds to a high or low voltage. These two states map directly onto the digits 1 and 0, and because there are only two of them they can be distinguished reliably even if the voltage varies slightly, which would not be true if ten separate levels had to be recognised for denary.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
2An image is 800 pixels wide and 600 pixels high, with a colour depth of 16 bits. Calculate the file size of the image in megabytes. Show your working.4 marks
Calculate

Mark scheme0 / 4
  • LMultiplies colour depth by width by height: 16 x 800 x 600
  • LObtains 7,680,000 bits
  • LDivides by 8 to obtain 960,000 bytes
  • LDivides by 1000 twice to obtain 0.96 MB
Model answer

File size in bits is colour depth multiplied by width multiplied by height, so 16 x 800 x 600 = 7,680,000 bits. Dividing by 8 converts this to 960,000 bytes. Dividing by 1000 gives 960 kilobytes, and dividing by 1000 again gives a final file size of 0.96 megabytes.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
3A sound file is recorded for 4 minutes at a sample rate of 44,100 Hz with a bit depth of 16 bits. Calculate the file size in megabytes, showing your working.4 marks
Calculate

Mark scheme0 / 4
  • LConverts 4 minutes to 240 seconds
  • LMultiplies sample rate by duration by bit depth
  • LObtains 169,344,000 bits
  • LConverts to approximately 21.17 MB
Model answer

First convert the duration: 4 minutes is 4 x 60 = 240 seconds. File size in bits is sample rate x duration x bit depth, so 44,100 x 240 x 16 = 169,344,000 bits. Dividing by 8 gives 21,168,000 bytes, dividing by 1000 gives 21,168 kilobytes, and dividing by 1000 again gives a file size of approximately 21.17 megabytes.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
4State the number of bits in a nibble and the number of bits in a byte.2 marks
State

Mark scheme0 / 2
  • LA nibble is 4 bits
  • LA byte is 8 bits
Model answer

A nibble contains 4 bits and a byte contains 8 bits, so a nibble is exactly half a byte.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
5A school stores 3000 photographs. Each photograph is 2000 by 1500 pixels with a colour depth of 24 bits. Calculate the total storage required in gigabytes.5 marks
Calculate

Mark scheme0 / 5
  • LCalculates bits per image as 24 x 2000 x 1500
  • LObtains 72,000,000 bits per image
  • LConverts to 9,000,000 bytes or 9 MB per image
  • LMultiplies by 3000 photographs
  • LObtains 27,000 MB which is 27 GB
Model answer

For one photograph the file size in bits is 24 x 2000 x 1500 = 72,000,000 bits. Dividing by 8 gives 9,000,000 bytes, which is 9000 kilobytes or 9 megabytes per photograph. Multiplying by 3000 photographs gives 27,000 megabytes in total, and dividing by 1000 converts this to 27 gigabytes of storage required.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
Machine mark 0 / 17