Data representation · GCSE · OCR J277 1.2.3, AQA 8525 3.3.3, Edexcel 1CP2 2.1.1 · about 12 min
Why computers use binary, and the units from bits to petabytes.
[1 mark]Why do computers store data in binary?
[1 mark]Put the units in order from smallest to largest.
Number the lines 1 to 7 to put them in the right order.
nibbleterabytemegabytegigabytekilobytebitbyte[1 mark]How many bits are in a byte?
[1 mark]How many different patterns can 5 bits make?
[1 mark]What does this program print?
frame_bytes = 320 * 240 * 3 print(frame_bytes, frame_bytes / 1000)
[1 mark]How many bytes is a kibibyte?
The robot's camera can also capture a small 64 by 48 frame with 3 bytes per pixel. Work out and print three lines: bits: <n>, bytes: <n> and kB: <n> (kilobytes of 1,000 bytes, as a decimal). Store the width, height and bytes per pixel in variables and calculate each line; do not type the answers.
# the two lines every program starts with: the commands, then the robot from bugbot import * connect() width = 64
Plan your program here, then type it in and press Run.
**.