- Explain why computers store everything as 0s and 1s
- Define bit, byte, nibble and word, and say how they are related
- Convert small numbers between decimal and binary by hand
- Recognise octal and hexadecimal and know where they are used
- Use the units KB, MB, GB and TB, and estimate how many files fit on a device
Time needed: about 3 hours (1 hr 15 min theory, 1 hr 15 min practical, 30 min questions and revision)
Every photo, song, document and video on your computer is stored as numbers. To understand how much a pen drive can hold, or why your phone says "storage full", you need to know the language of those numbers. Today is the most "mathematical" day of the course, but it only needs addition, multiplication by 2 and patience.
THEORY
Read it, understand it, remember it1Why computers use only 0 and 1
A computer is built from millions of tiny electronic switches. A switch has only two states: ON or OFF. It is easy and reliable to build a part that can tell these two states apart, even when the electricity is a little weak or noisy. It would be much harder to build a part that reliably tells ten different levels apart, as we would need for the digits 0 to 9.
So we write OFF as 0 and ON as 1. Everything the computer handles, whether a letter, a colour or a sound, is turned into patterns of 0s and 1s.
2Bit, byte and other units of data
A nibble is half a byte, which means 4 bits. A word is the amount of data a processor handles in one step, for example 32 bits or 64 bits. When people say "64-bit Windows", they mean the processor works with 64-bit words.
1 bit : [1] 1 nibble : [1][0][1][1] (4 bits) 1 byte : [0][1][0][0][0][0][0][1] (8 bits = the letter "A")
Why 8? With 8 bits there are 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 = 256 different patterns. That is enough for all English letters (capital and small), digits and common symbols, so 8 bits became the standard size of a byte.
3Number systems
A number system is a method of writing numbers using a fixed set of digits. The count of digits is called the base (or radix).
| System | Base | Digits used | Where it appears |
|---|---|---|---|
| Decimal | 10 | 0 to 9 | Everyday counting, money, marks |
| Binary | 2 | 0 and 1 | Inside the computer's circuits |
| Octal | 8 | 0 to 7 | Older systems, file permissions in Linux |
| Hexadecimal | 16 | 0 to 9 and A to F | Colour codes (#FF0000), memory addresses, MAC addresses |
In hexadecimal the letters stand for numbers: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. Hexadecimal is popular because one hex digit neatly represents 4 bits, so a byte can be written with just two hex digits (for example 41 for "A").
4Place value: the idea behind every number system
In decimal, the position of a digit decides its value. In the number 425, the 4 is worth 400 because it sits in the "hundreds" place.
| Digit | 4 | 2 | 5 |
|---|---|---|---|
| Place value | 10² = 100 | 10¹ = 10 | 10⁰ = 1 |
| Worth | 400 | 20 | 5 |
Binary works in the same way, but each place is worth a power of 2 instead of a power of 10. Moving left, each place doubles: 1, 2, 4, 8, 16, 32, 64, 128.
5Converting binary to decimal
Method: write the place values above the bits, then add the place values wherever there is a 1.
Place value : 8 4 2 1 Bits : 1 0 1 1 Add : 8 + 0 + 2 + 1 = 11So binary 1011 = decimal 11.
Place value : 128 64 32 16 8 4 2 1 Bits : 0 1 0 0 0 0 0 1 Add : 64 + 1 = 65So 01000001 = 65. Remember this number: it is the code for the letter "A".
6Converting decimal to binary
Method (repeated division by 2): divide the number by 2, write down the remainder, divide the quotient again, and continue until the quotient is 0. Then read the remainders from bottom to top.
13 / 2 = 6 remainder 1 (last digit) 6 / 2 = 3 remainder 0 3 / 2 = 1 remainder 1 1 / 2 = 0 remainder 1 (first digit) Read upward: 1101 so 13 = 1101Check: 8 + 4 + 0 + 1 = 13. Correct.
7How letters become numbers: ASCII
A computer cannot store the letter "A" directly, so people agreed on a table that gives every character a number. The best-known table is ASCII (American Standard Code for Information Interchange). Newer systems such as Unicode extend the idea so that Hindi, Tamil, Punjabi, Chinese and emoji can also be stored.
| Character | Decimal code | Binary (8 bits) |
|---|---|---|
| A | 65 | 01000001 |
| B | 66 | 01000010 |
| a | 97 | 01100001 |
| 0 (the digit) | 48 | 00110000 |
| Space | 32 | 00100000 |
This is why a text file with 1,000 English characters is about 1,000 bytes in size: one byte per character.
8Units of data storage: KB, MB, GB, TB
Bytes are tiny, so bigger units are used, just like metres and kilometres.
| Unit | Symbol | Size (computer counting) | Rough real-life example |
|---|---|---|---|
| Byte | B | 8 bits | One letter |
| Kilobyte | KB | 1,024 bytes | A short text message or a small text file |
| Megabyte | MB | 1,024 KB | One photo from a phone (2 to 5 MB), one MP3 song (3 to 5 MB) |
| Gigabyte | GB | 1,024 MB | A movie in good quality (1 to 3 GB) |
| Terabyte | TB | 1,024 GB | About 250 movies, or a large library of photos |
| Petabyte | PB | 1,024 TB | Data of big companies |
Why 1,024 and not 1,000?
Because computers count in powers of 2, and 210 = 1,024, which is very close to 1,000. Windows uses 1,024 when it shows file sizes. However, storage companies (pen drive, hard disk and SSD makers) usually count with 1,000 to describe capacity, because it gives a bigger-looking number.
Bits versus bytes: do not mix them up
| Written | Means | Used for |
|---|---|---|
| KB, MB, GB (capital B) | Bytes | File sizes and storage |
| Kb, Mb, Gb (small b) | Bits | Internet speed, for example 100 Mbps |
A 100 Mbps connection moves 100 megabits per second. Since 8 bits make a byte, that is only about 12.5 megabytes per second. So a 100 MB file takes about 8 seconds to download at best.
9Common misunderstandings
- "Bigger numbers mean more files, always." No. A single 4 GB movie takes the space of about 1,000 photos.
- "RAM and storage are both measured in GB, so they are the same." They use the same unit but do different jobs (Day 2). RAM is the working table; storage is the cupboard.
- "Deleting a file makes the computer faster." Only freeing storage space; speed depends on other parts too.
- "1 KB is exactly 1,000 bytes." In Windows it is 1,024 bytes. Both views exist.
PRACTICAL
Hands-on work on a real computerDo every task on a real computer where possible. You will also need a notebook and pencil.
Task 1: Convert by hand
Objective: practise both conversion methods. You need: notebook and pencil.
- Convert these binary numbers to decimal using place values: 101, 1100, 10010, 11111.
- Convert these decimal numbers to binary using repeated division: 5, 10, 25, 64.
- Convert your answers back to check them.
Expected results: 101 = 5, 1100 = 12, 10010 = 18, 11111 = 31; and 5 = 101, 10 = 1010, 25 = 11001, 64 = 1000000. Common mistake: reading remainders from top to bottom instead of bottom to top.
Task 2: Use the Windows Calculator in Programmer mode
Objective: confirm your hand conversions with a tool.
- Click Start, type
Calculatorand press Enter. - Click the menu button (three horizontal lines at top left) and choose Programmer.
- On the left side you will see HEX, DEC, OCT and BIN. Click DEC, then type
65. - Look at the BIN line. It should show
0100 0001, the same as the letter "A" in the ASCII table. - Click BIN and type
1101. Read the DEC line: it should show 13.
Troubleshooting: if you do not see Programmer mode, your Calculator may be an older version; search "Programmer" in its menu, or use the online converter on any search engine.
Task 3: Find real file sizes
- Open File Explorer and go to Pictures or Documents.
- Right-click any file and choose Properties.
- Note the Size (for example 2.4 MB) and the Size on disk. Size on disk is usually a little larger because disk space is given out in fixed blocks.
- Record five files of different types (photo, text, song, document, video) in a table with columns: Name, Type, Size, Unit.
Expected result: text files are tiny (a few KB); photos and songs are MB; videos are the largest.
Task 4: Capacity check of your own device
- Open File Explorer, click This PC.
- Under Devices and drives, note the total size and free space of each drive.
- Calculate how many 4 MB photos fit in the free space. (Convert GB to MB by multiplying by 1,024.)
Example: 20 GB free = 20 × 1,024 = 20,480 MB; divided by 4 MB = 5,120 photos.
Task 5: Secret message in ASCII
- Using the ASCII table in this lesson and the Calculator, find the decimal codes for the letters of your first name (capital A is 65, B is 66 and so on; counting forward from 65 works for all capitals).
- Write your name as a list of decimal codes. Give it to a friend to decode.
QUESTIONS
Check what you have learnedMultiple choice (click an answer)
True or false
Short and long questions (write in your notebook)
- Why do computers use binary instead of decimal? Use the idea of switches in your answer.
- Define bit, nibble, byte and word. How many bits does each hold?
- Convert 37 to binary and 100101 to decimal. Show every step.
- Explain why a 500 GB hard disk may show about 465 GB in Windows.
- A song is 4 MB. How many songs fit in 2 GB? (Show your calculation.)
- Differentiate between Mb and MB. Why does it matter when downloading?
- What is ASCII? Why is it needed? Give the ASCII code of "A".
Show model answers for the written questions
- Computers are made of switches that are either on or off; two states are easy and reliable to detect, so binary is used.
- Bit 1; nibble 4; byte 8; word is the processor's natural chunk, commonly 32 or 64 bits.
- 37 = 100101 (37/2=18 r1, 18/2=9 r0, 9/2=4 r1, 4/2=2 r0, 2/2=1 r0, 1/2=0 r1, read upward). 100101 = 32 + 4 + 1 = 37.
- 500 GB is 500,000,000,000 bytes; dividing by 1,024 three times gives about 465.
- 2 GB = 2,048 MB. 2,048 / 4 = 512 songs.
- Mb = megabit, used for speeds; MB = megabyte (8 bits each), used for file sizes. A 100 Mbps line downloads only about 12.5 MB per second.
- ASCII is a table giving each character a number so that it can be stored in binary. "A" is 65.
REVISION AND SUMMARY
Bring the key ideas backKey points to remember
- Computers use binary because electronic switches have two states.
- 1 byte = 8 bits. 1 KB = 1,024 B; 1 MB = 1,024 KB; 1 GB = 1,024 MB; 1 TB = 1,024 GB.
- Binary place values double: 1, 2, 4, 8, 16, 32, 64, 128.
- Decimal to binary: divide by 2 and read remainders upward.
- ASCII and Unicode give every character a numeric code.
- Capital B means bytes (files); small b means bits (internet speed).
Self-check: can you now do these?
- ☐ Explain in two sentences why computers use only 0 and 1.
- ☐ Convert 4-bit and 8-bit numbers both ways.
- ☐ Name the units from byte to terabyte in order.
- ☐ Explain why a new pen drive shows less capacity than printed on it.
- ☐ Find the size of any file and drive in Windows.
Summary
Finished today's lesson?
Tick it off to track your progress across the 90 days.
Tip: press Shift + ← or → to switch lessons.