Digital Technologies · Number bases and data representation
Binary, octal and hexadecimal
Flip eight bit-switches to see how computers store numbers, then hit target values in binary.
- Curriculum: Digital Technologies, Number bases and data representation
- Class: JSS 2 – SSS 1
- For BECE, WAEC, NECO practicals
- Readings, table
- Quiz with answers explained
Start this experimentAll Digital Technologies experiments
Aim
To convert numbers between denary (base 10), binary (base 2), octal (base 8) and hexadecimal (base 16).
Apparatus
- Eight switches and lamps (or this simulator)
- Place-value chart
Theory
Computers store data as bits: 0 or 1. Eight bits make a byte. Each bit has a place value that doubles from right to left:
128 · 64 · 32 · 16 · 8 · 4 · 2 · 1
The denary value is the sum of the place values of the bits that are 1. One hexadecimal digit stands for four bits; one octal digit stands for three bits.
Procedure
- Flip a few switches and watch the denary, octal and hexadecimal values change.
- Read the target number.
- Set the switches so that the byte equals the target.
- Check and record, then take a new target.
- Try targets given in hexadecimal as well as denary.
What you do in the virtual lab
Set up the apparatus on screen, take readings and record them in a table (Target; Your binary; Denary; Octal; Hexadecimal; Check). Simulated instruments give slightly different readings each time, as real ones do. Finish with a short quiz; every answer is explained.
Teachers can set the experiment for a class, see each student’s results and use it as a WAEC- or NECO-style practical paper in exam practice.
Practice questions
The binary number 1011 in denary is
- 9
- 13
- 11
- 1011
Show the answer
C. 11 8 + 0 + 2 + 1 = 11.
The denary number 20 in binary is
- 10100
- 10010
- 11000
- 10110
Show the answer
A. 10100 20 = 16 + 4, so the 16s and 4s bits are 1: 10100.
The hexadecimal digit F stands for the denary value
- 10
- 14
- 16
- 15
Show the answer
D. 15 Hexadecimal digits run 0–9 then A = 10 up to F = 15.
Related Digital Technologies experiments
- Logic gates and truth tablesSwitch the inputs of AND, OR, NOT, NAND, NOR and XOR gates and build each truth table.
- Programming a robot: sequence and loopsWrite a program of moves and turns to steer a robot to its goal, then shorten it with a loop.
- How strong is a password?Test made-up passwords, measure their strength in bits and see how long an attacker would need to guess them.
- Spreadsheet formulas and functionsUse cell references, SUM, AVERAGE, MAX and IF to complete a shop sales record and a class result sheet.
- Coding in PythonWrite real Python – print, variables, loops and if statements – and have each program checked automatically.
- Train a simple AITeach a computer to tell ripe plantain from unripe by giving it labelled examples, then test how accurate it is.