The answersDownload the PDF
Worksheet

F13.5 Number and data questions

Exam preparation · GCSE · OCR J277 1.2.4, AQA 8525 3.3.2, Edexcel 1CP2 2.1.3 · about 15 min

BugBotLab
NameClassDate

What this lesson is about

Conversions, units and file sizes at speed, with the checks that catch mistakes.

Questions 6 marks in all

  1. [1 mark]Convert 200 to 8-bit binary.

  2. [1 mark]Convert 10110110 to hexadecimal.

  3. [1 mark]How many different values can 8 bits hold?

  4. [1 mark]A 64 by 48 image at 8 bits a pixel. How many bits?

  5. [1 mark]What is the ASCII code for capital A?

  6. [1 mark]Your binary answer has 7 digits. What should you check?

    1. AAn 8-bit answer needs exactly 8 digits, so add the leading zero
    2. BNothing: 7 is fine
    3. CConvert it to hex instead
    4. DDouble the number

The task: the conversion drill

For each number in numbers, print <denary> = <8-bit binary> = <2-digit hex>, working each one out yourself rather than using bin(), hex() or format(). Then for the image in image (width, height, bits per pixel), print image: <n> bits and image: <n> kB, and for sound (rate, seconds, bit depth) print sound: <n> bits and sound: <n> kB. Give the kB to 1 decimal place.

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

numbers = [5, 77, 200, 255]
image = (64, 48, 8)        # width, height, bits per pixel
sound = (8000, 5, 8)       # samples a second, seconds, bits a sample

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/f13-5-number-and-data-questions/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Add a column for the number after a left shift of one place. What happens to 200?
  2. Work out the size of a 10-second stereo recording at 44,100 Hz and 16 bits.
  3. Time yourself converting ten random numbers. Where do you slow down?