Number Systems and Data Representation
Understanding Number Systems; Binary Number System; Converting Decimal to Binary; Octal Number System; Hexadecimal Number System; ASCII and Character Codes; Unicode; Representing Images; Representing Sound; Representing Video; Measuring File Sizes; Practical Exercises; How Computers Represent Data; Number Conversions with Worked Examples; Representing Characters, Images, Pixels and Colour Depth
On this page18 sections
- 01Learning Objectives
- 02Understanding Number Systems
- 03Binary Number System
- 04Converting Decimal to Binary
- 05Octal Number System
- 06Hexadecimal Number System
- 07ASCII and Character Codes
- 08Unicode
- 09Representing Images
- 10Representing Sound
- 11Representing Video
- 12Measuring File Sizes
- 13Practical Exercises
- 14How Computers Represent Data
- 15Number Conversions with Worked Examples
- 16Representing Characters, Images, Pixels and Colour Depth
- 17Practical Work
- 18Scenario-Based Questions
Learning Objectives
- Explain place value in the decimal, binary, octal and hexadecimal systems.
- Convert numbers between decimal, binary and hexadecimal.
- Explain how characters, images and sound are represented.
- Use the units that measure file sizes.
Understanding Number Systems
A number system is a way of writing numbers using a fixed set of symbols called digits and a base (the radix). The base tells how many digits the system uses and what each position is worth. The four common systems are binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). Number systems matter because computer hardware can only recognise two states, on and off; every value it stores must first be turned into patterns of 0s and 1s, so binary is the native language of computing and the other systems are shorthand ways of writing it.
The table below introduces the four systems.
Binary Number System
Binary uses only the digits 0 and 1, and each position is worth a power of 2, working from the right, namely 1, 2, 4, 8, 16, 32, 64, 128. To convert binary to decimal, add the place values that carry a 1, so binary 1101 = 8 + 4 + 1 = 13, binary 10110 = 16 + 4 + 2 = 22, and binary 1100100 = 64 + 32 + 4 = 100.
Converting Decimal to Binary
To convert decimal to binary, divide the number repeatedly by 2, write down the remainder each time and stop when the quotient becomes 0, then read the remainders from bottom to top. For decimal 25, 25/2 = 12 r 1, 12/2 = 6 r 0, 6/2 = 3 r 0, 3/2 = 1 r 1, 1/2 = 0 r 1, giving binary 11001. For 100 the remainders give 1100100. Check your answer by adding the place values back, for example 16 + 8 + 1 = 25.
Octal Number System
Octal uses the digits 0 to 7, and each position is worth a power of 8, namely 1, 8, 64, 512. To convert octal to decimal, multiply each digit by its place value, for example octal 52 = (5 x 8) + 2 = 42. Because 8 equals 2 to the power of 3, each octal digit represents exactly three binary bits, so binary converts to octal by grouping the bits in threes from the right, so binary 110101 gives 110 and 101, which are 6 and 5, so it is octal 65. To convert decimal to octal, divide by 8 and read the remainders bottom to top, so decimal 63 becomes octal 77.
Hexadecimal Number System
Hexadecimal uses the digits 0 to 9 and the letters A to F, where A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. Each position is worth a power of 16, namely 1, 16, 256, 4096. To convert to decimal, multiply each symbol by its place value, for example 2A = (2 x 16) + 10 = 42, and FF = (15 x 16) + 15 = 255. Because 16 equals 2 to the power of 4, binary converts to hex by grouping bits in fours from the right, so binary 110101 gives 0011 and 0101, which is hex 35. To convert decimal to hex, divide by 16, so decimal 200 becomes C8, because 200/16 = 12 r 8 and the digit 12 is C.
Hexadecimal is used everywhere because it is compact; one byte, eight bits, is exactly two hex digits, so memory addresses and error codes are far shorter than in binary. Web colour codes such as #FF5733 and debugger memory dumps are also hexadecimal.
ASCII and Character Codes
A computer does not store letters directly; it stores numbers. ASCII, the American Standard Code for Information Interchange, assigns a number to each character. Standard ASCII uses 7 bits and can represent 128 characters, including English letters, digits, punctuation and control codes. Extended ASCII uses 8 bits, one byte, reaching 256 characters. The letter A is decimal 65 (binary 01000001), lowercase a is 97, and the digit 0 is 48. The gap between an uppercase letter and its lowercase form is always 32, which makes case conversion easy.
Unicode
ASCII can only cover English and a few symbols, so Unicode gives a unique number to every character in every writing system, over 140,000 characters today, including Yoruba, Hausa, Igbo, Arabic, Chinese and emoji. Unicode is backwards compatible with ASCII; the first 128 code points are identical. Common forms are UTF-8, which uses 1 to 4 bytes per character, and UTF-16 and UTF-32.
Representing Images
An image is stored as a grid of dots called pixels. Resolution is the number of pixels, written as width x height, so a 1024 x 768 image has 786,432 pixels. Colour depth is the number of bits per pixel; 1 bit gives black and white, 8 bits give 256 colours, and 24 bits give millions. File size = pixels x colour depth, so a 1024 x 768 image at 24 bits is 786,432 x 24 = 18,874,368 bits, about 2,359,296 bytes, roughly 2.4 MB. Higher resolution or colour depth means a sharper but larger image.
Representing Sound
Sound is captured by sampling the wave many times per second. Sampling rate is the number of samples per second (a music CD uses 44,100), bit depth is the bits per sample (16 on a CD), and channels is the number of sound tracks. File size = sampling rate x bit depth x channels x time. One minute of stereo CD audio is 44,100 x 16 x 2 x 60 = 84,672,000 bits, about 10 MB. Higher values give better quality but bigger files.
Representing Video
Video stores a sequence of frames and displays a new one at every frame rate, usually 24 to 30 per second. File size before compression = resolution x colour depth x frame rate x duration. A short video is therefore much larger than a photo because it is hundreds of pictures per second, which is why compression is essential.
Measuring File Sizes
Digital data is measured in bits and bytes. A bit is a single 0 or 1, and a byte is 8 bits, enough for one character. Because computers count in binary, larger units multiply by 1024 (2 to the power of 10), not by 1000, so 1 Kilobyte (KB) = 1024 bytes, 1 Megabyte (MB) = 1024 KB, 1 Gigabyte (GB) = 1024 MB, 1 Terabyte (TB) = 1024 GB and 1 Petabyte (PB) = 1024 TB. Some manufacturers use 1000 when labelling devices, which is why a new drive can show less space than advertised.
Practical Exercises
Test yourself with these problems before the Week 10 assessment.
Convert these binary numbers to decimal, 1010, 11011 and 100000.
Convert these decimal numbers to binary, 18, 37 and 121.
Convert octal 63 and octal 106 to decimal.
Convert decimal 49 and decimal 130 to hexadecimal.
Give the decimal codes for the letters A, a and the digit 0 in ASCII.
State whether each unit equals 1000 or 1024 times the previous unit.
Calculate the size in bytes of an 800 x 600 photo at 24-bit colour.
Estimate the size in megabytes of a 3-minute song with 44,100 samples per second, 16-bit and stereo.
How Computers Represent Data
A computer represents all data using a fixed-length binary pattern. The smallest unit is the bit, which holds a single 0 or 1. Eight bits grouped together form one byte, and a byte is the basic unit used to represent one character such as the letter A. Larger quantities are measured in kilobytes, megabytes, gigabytes and terabytes.
Fixed-length representation means the group of bits set aside for a value keeps a constant size. For example, one byte always holds eight bits, even if the number stored needs only three. This arrangement makes hardware simpler and faster, because the processor always knows where one unit begins and the next ends.
The choice of a fixed pattern also explains why computers use base 2. A transistor has two stable states, on and off, which map naturally to 1 and 0. By grouping many such switches, a computer stores any amount of data, from a single keystroke to a full-length video.
A bit is the smallest unit and holds one 0 or 1.
A byte is eight bits and represents one character.
Storage units grow by multiples of 1024 from the byte upward.
Fixed-length groups keep the processor simple and predictable.
Number Conversions with Worked Examples
Converting between number systems follows two systematic methods. To convert any base to decimal, multiply each digit by its positional value and add the results. To convert from decimal to any base, divide repeatedly by the target base and read the remainders from bottom to top.
Example one: convert binary 11010 to decimal. The place values from the right are powers of 2: 1, 2, 4, 8 and 16. The calculation is (1 times 16) + (1 times 8) + (0 times 4) + (1 times 2) + (0 times 1) = 26 in decimal.
Example two: convert decimal 255 to hexadecimal. Dividing by 16 gives 15 remainder 15, and 15 in hexadecimal is the letter F, so the answer is hex FF. Example three: convert octal 245 to decimal. The place values are 64, 8 and 1, giving (2 times 64) + (4 times 8) + (5 times 1) = 165 in decimal.
Use positional multiplication to convert any base to decimal.
Use repeated division with remainder recording to convert decimal to another base.
Group binary bits in threes for octal and fours for hexadecimal.
Representing Characters, Images, Pixels and Colour Depth
Beyond ASCII and Unicode, computers also encode images as binary data. A digital image is built from a grid of small dots called pixels. Each pixel stores a colour value, and the set of all pixel values together forms the complete picture.
Colour depth is measured in bits per pixel. A 1-bit image shows only black and white. An 8-bit image can display 256 colours. A 24-bit image uses 8 bits for each of the red, green and blue channels, giving over 16 million colours. Web designers meet this idea when they write hex colour codes such as FF0000 for pure red.
Unicode assigns a unique code point to every character across the world writing systems, including Latin, Arabic, Chinese and emoji. Where ASCII supports only 128 characters in 7 bits, Unicode currently maps well over a million code points. A Nigerian user typing in English or Hausa sees the same text reliably on a phone, a computer and a website because all three devices agree on the Unicode standard.
Pixels are the tiny picture elements that make up a digital image.
Colour depth decides how many colours each pixel can show.
24-bit colour supports over 16 million colours for realistic photos.
Unicode covers all world scripts, while ASCII covers English and basic symbols only.
| Number system | Base | Digits used | Used by computers? |
|---|---|---|---|
| Binary | 2 | 0 and 1 | Yes - the native language of computers |
| Octal | 8 | 0 to 7 | Compact grouping of binary |
| Decimal | 10 | 0 to 9 | For humans, not computers |
| Hexadecimal | 16 | 0 to 9, A to F | Compact grouping of binary |
| Term | Meaning |
|---|---|
| Number system | A way of writing numbers using a fixed set of digits and a base |
| Base (radix) | The number of unique digits a system uses and the value of each position |
| Binary | Base 2 system using only 0 and 1, the native language of computers |
| Octal | Base 8 system using digits 0 to 7 |
| Decimal | Base 10 system using digits 0 to 9, used by humans |
| Hexadecimal | Base 16 system using 0 to 9 and A to F |
| Bit | The smallest unit of data, a single 0 or 1 |
| Byte | 8 bits, enough to store one character |
| ASCII | A 7-bit or 8-bit code that numbers characters |
| Unicode | A code that numbers characters from every writing system |
| UTF-8 | A Unicode form using 1 to 4 bytes per character |
| Pixel | A single dot in a digital image |
| Resolution | The number of pixels across and down an image |
| Colour depth | The number of bits used to store each pixel |
| Sampling rate | The number of sound samples captured per second |
| Bit depth | The number of bits used for each sound sample |
| Frame rate | The number of video frames displayed per second |
| Kilobyte | 1024 bytes |
| Megabyte | 1024 kilobytes |
| Gigabyte | 1024 megabytes |
| Terabyte | 1024 gigabytes |
| Petabyte | 1024 terabytes |
Practical Work
- Convert the decimal number 45 to binary and to hexadecimal.
- Write the ASCII code for the letter A in binary.
- Explain how a colour image is stored using pixels.
- Arrange bit, byte, kilobyte, megabyte and gigabyte in order.
Scenario-Based Questions
- A student is asked to convert the binary number 1101 to decimal. Show the conversion step by step and give the answer.
- A web designer writes a colour as #FF5733 instead of a long run of binary digits. Explain why hexadecimal is more compact than binary for such codes, and calculate the decimal value of the first pair, FF, to show that two hex digits represent one byte (8 bits).
- A student types the letter A on a keyboard. Explain how the computer stores this character internally using ASCII, giving the decimal code, and explain why ASCII alone cannot represent Yoruba text.
- A camera captures an image at 1920 x 1080 resolution with 24-bit colour depth. Calculate the uncompressed file size in bytes and convert it to megabytes.
- A music streaming service records a song at 44,100 samples per second, 16-bit depth and stereo. Explain what each of these three values means and estimate the size of a three-minute recording before compression.
- A programmer says the hexadecimal value 2A equals decimal 42. Show the conversion to verify this claim, and explain why a computer scientist would prefer to write 2A instead of 00101010.
- A student confuses kilobytes (KB) with kilobits (Kb). Explain the difference between a bit and a byte, state whether KB equals 1000 or 1024 bytes, and explain why a new hard drive advertised as 1 TB may show less usable space than expected.
LEARNING OBJECTIVES: BY THE END OF THE LESSON STUDENTS SHOULD BE ABLE TO:
| Cognitive | i. Explain place value in the decimal, binary, octal and hexadecimal systems. ii. Convert numbers between decimal, binary and hexadecimal. iii. Explain how characters, images and sound are represented. iv. Use the units that measure file sizes. |
| Affective | i. Appreciate the value of Number Systems and Data Representation in school, at home and in the community. ii. Show willingness to use digital tools carefully, safely and responsibly. |
| Psychomotor | i. Convert the decimal number 45 to binary and to hexadecimal. ii. Write the ASCII code for the letter A in binary. iii. Explain how a colour image is stored using pixels. iv. Arrange bit, byte, kilobyte, megabyte and gigabyte in order. |
Rationale: A number system is a way of writing numbers using a fixed set of symbols called digits and a base (the radix). Understanding understanding Number Systems, binary Number System, converting Decimal to Binary, octal Number System helps learners use digital technology confidently, safely and responsibly.
Pre-requisite Knowledge: In Week 4, learners studied Operating Systems, Software Licensing and Applications, including types of Operating Systems, common Operating Systems, functions of an Operating System. The knowledge from that week is used again in this lesson.
Learning Material/Teaching Aid: Whiteboard, markers, computer or laptop where available, printed notes and charts on Number Systems and Data Representation, practical task sheets, learners' notebooks and pens.
Reference Materials: Digital Technology for Senior Secondary Schools (SS 2); NERDC Digital Technology Curriculum; Digital Technology SS 2 First Term Notes (Week 5); First Term examination and Continuous Assessment question papers.
LESSON DEVELOPMENT
| Stage/Step (Time) | Teacher's Activities | Student's Activities | Learning Points |
|---|---|---|---|
| Introduction 5 MINUTES | Welcomes learners, revises Week 4 (Operating Systems, Software Licensing and Applications) with two quick oral questions, and asks what they already know about Number Systems and Data Representation. Elicits responses and writes the topic on the board. | Recall the previous lesson and share what they already know about Number Systems and Data Representation. | Connecting prior knowledge to Number Systems and Data Representation. |
| Step 1 6 MINUTES | Covers Understanding Number Systems: A number system is a way of writing numbers using a fixed set of symbols called digits and a base (the radix). Covers Binary Number System: Binary uses only the digits 0 and 1, and each position is worth a power of 2, working from the right, namely 1, 2, 4, 8, 16, 32, 64, 128. Covers Converting Decimal to Binary: To convert decimal to binary, divide the number repeatedly by 2, write down the remainder each time and stop when the quotient becomes 0, then read the remainders from bottom to top. Also covers Octal Number System. | Listen, take notes and answer oral questions on "Understanding Number Systems" and related points. | Understanding: Understanding Number Systems; Binary Number System; Converting Decimal to Binary; and related ideas. |
| Step 2 6 MINUTES | Covers Hexadecimal Number System: Hexadecimal uses the digits 0 to 9 and the letters A to F, where A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. Covers ASCII and Character Codes: A computer does not store letters directly; it stores numbers. Covers Unicode: ASCII can only cover English and a few symbols, so Unicode gives a unique number to every character in every writing system, over 140,000 characters today, including Yoruba, Hausa, Igbo, Arabic, Chinese and emoji. Also covers Representing Images. | Copy the key points, give examples from school and everyday life, and ask questions on "Hexadecimal Number System" and related points. | Understanding: Hexadecimal Number System; ASCII and Character Codes; Unicode; and related ideas. |
| Step 3 6 MINUTES | Covers Representing Sound: Sound is captured by sampling the wave many times per second. Covers Representing Video: Video stores a sequence of frames and displays a new one at every frame rate, usually 24 to 30 per second. Covers Measuring File Sizes: Digital data is measured in bits and bytes. Also covers Practical Exercises. | Discuss in pairs, then report one point on "Representing Sound" and related points to the class. | Understanding: Representing Sound; Representing Video; Measuring File Sizes; and related ideas. |
| Step 4 6 MINUTES | Covers How Computers Represent Data: A computer represents all data using a fixed-length binary pattern. Covers Number Conversions with Worked Examples: Converting between number systems follows two systematic methods. Covers Representing Characters, Images, Pixels and Colour Depth: Beyond ASCII and Unicode, computers also encode images as binary data. | Respond to questions, complete the examples on the board and note down "How Computers Represent Data" and related points. | Understanding: How Computers Represent Data; Number Conversions with Worked Examples; Representing Characters, Images, Pixels and Colour Depth. |
| Practical Work 6 MINUTES | Guides learners through the practical work: (i) Convert the decimal number 45 to binary and to hexadecimal. (ii) Write the ASCII code for the letter A in binary. (iii) Explain how a colour image is stored using pixels. Moves round the class to check progress and correct unsafe or careless use. | Carry out the practical tasks individually or in pairs and record what they did in their notebooks. | Applying the lesson through hands-on practice. |
| Evaluation 3 MINUTES | Asks learners to: i. Explain place value in the decimal, binary, octal and hexadecimal systems. ii. Convert numbers between decimal, binary and hexadecimal. iii. Explain how characters, images and sound are represented. iv. Use the units that measure file sizes. | Respond verbally and in writing to the evaluation questions. | Assessment and consolidation of the lesson content. |
| Conclusion 2 MINUTES | Recaps the main points: understanding Number Systems, binary Number System, converting Decimal to Binary, octal Number System, hexadecimal Number System. Links them to the assignment and previews Week 6: Logic Gates and Digital Logic. | Listen, ask questions and copy the assignment. | Reinforcement of key concepts and a preview of the next lesson. |
Assignment: i. A student is asked to convert the binary number 1101 to decimal. Show the conversion step by step and give the answer. ii. A web designer writes a colour as #FF5733 instead of a long run of binary digits. Explain why hexadecimal is more compact than binary for such codes, and calculate the decimal value of the first pair, FF, to show that two hex digits represent one byte (8 bits).
On this page9 sections
- 01Lesson objectives
- 02Key vocabulary
- 03Common misconceptions
- 04Teacher activities
- 05Student activities
- 06Practical / learning evidence
- 07Resources and preparation
- 08Assessment for learning
- 09Inclusion and homework
Lesson objectives
By the end of the week, learners should be able to:
- Convert decimal numbers to binary, octal and hexadecimal.
- Convert binary back to decimal and vice versa.
- Explain why binary is the natural language of digital electronics.
- Represent characters, images and audio in binary forms.
- Compute the bit pattern for a given letter, image pixel and audio sample.
Key vocabulary
- Decimal: base ten number system using digits 0 through 9.
- Binary: base two using only digits 0 and 1.
- Octal: base eight using digits 0 through 7.
- Hexadecimal: base sixteen using digits 0 through 9 and letters A through F.
- Bit: one binary digit, the smallest unit of data.
- Byte: eight bits, the basic storage unit.
- Natural language: the native form a system uses internally.
- Character encoding: mapping letters to binary values.
- Pixel: one tiny picture element in an image.
- Sample: a discrete value taken from an audio stream.
Common misconceptions
- "Binary is hard to read." Binary is compact and fast once learned; humans add grouping aids.
- "Decimal converts directly to binary without grouping." Decimal must be grouped by powers of two for conversion.
- "Hexadecimal adds new symbols randomly." Hexadecimal maps cleanly onto four bits each.
Teacher activities
- Starter: ask which base suits electronic switches best and why.
- Walk through converting decimal ten to binary step by step.
- Show grouping decimal and binary with powers of two.
- Demonstrate converting decimal fifteen to octal and hexadecimal.
- Explain why binary is the natural language of electronics.
- Close with the conversion task and exit question.
Student activities
- Answer the starter and explain why binary suits electronic switches.
- Convert decimal ten to binary with the grouping method shown.
- Convert binary back to decimal and group the result.
- Convert decimal fifteen to octal and hexadecimal.
- Explain why binary is the natural language of digital electronics in one paragraph.
- Answer the exit question in one sentence about base choice.
Practical / learning evidence
At least five worked conversions covering decimal, binary, octal and hexadecimal, plus a bit-pattern worksheet for a letter, a pixel and an audio sample. Submit both for marking.
Resources and preparation
Printed conversion worksheets and bit-pattern templates. Offline route: paper worksheets, no device needed. Provide large printed templates for learners with low vision. Verify conversion accuracy against the official method before distributing.
Assessment for learning
Mark the working, not just the final answer. Check that each conversion shows grouping or division. Inspect the bit-pattern worksheet for a sensible mapping of each input to binary. Flag any learner who skips grouping and guesses results.
Inclusion and homework
Provide the conversion ladder prefilled for the first step and allow oral completion of the rest. Reduce the bit-pattern worksheet to two items. Extend confident learners with base conversions to base three and base five, and a seventh bit-pattern challenge. Homework: convert one decimal number to binary and verify your grouping answer by grouping.