Your phone says "storage almost full" while your game runs slowly because of low RAM. These are two different things, and exams love to test the difference. This lesson also covers the counting systems a computer uses inside, which give easy conversion questions.
Units of data
A computer stores everything as 0 and 1. Each 0 or 1 is one bit, the smallest unit of data.
| Unit | Size |
|---|---|
| 1 Nibble | 4 bits |
| 1 Byte | 8 bits (one character such as A) |
| 1 Kilobyte (KB) | 1024 bytes |
| 1 Megabyte (MB) | 1024 KB |
| 1 Gigabyte (GB) | 1024 MB |
| 1 Terabyte (TB) | 1024 GB |
| 1 Petabyte (PB) | 1024 TB |
How many songs fit?
Take a song of about 4 MB. A 64 GB phone has 64 x 1024 = 65,536 MB of space. Divide by 4 and you get about 16,000 songs, though the phone's own apps also use space.
Primary memory
Primary memory is directly used by the CPU. It is fast but limited in size.
RAM (Random Access Memory)
RAM holds the programs and data you are using right now. It is volatile, meaning everything in it disappears when the power goes off. This is why unsaved work is lost in a power cut. More RAM lets you run more apps together. RAM is of two kinds: SRAM (static, faster, costlier, used in cache) and DRAM (dynamic, slower, cheaper, used as main memory).
ROM (Read Only Memory)
ROM keeps the instructions needed to start the computer, such as the BIOS (Basic Input Output System). It is non-volatile: data stays without power. Types include PROM (programmed once), EPROM (erased by ultraviolet light) and EEPROM (erased by electricity).
Cache memory
Cache is a very fast memory between the CPU and RAM. It keeps frequently used data close to the CPU so work is faster. It comes in levels L1, L2 and L3. L1 is the smallest and fastest.
The order from fastest to slowest is: registers, cache, RAM, secondary storage.
RAM is not storage
A student says "my laptop has 512 GB RAM". That is wrong for a normal laptop. It has 8 or 16 GB of RAM and 512 GB of storage. RAM is the short-term workbench; storage is the cupboard.
Secondary storage
Secondary storage keeps data permanently, even after the power is off. It is bigger and cheaper but slower than RAM.
- HDD (Hard Disk Drive): spinning magnetic disks. Large and cheap but slower, and moving parts can fail.
- SSD (Solid State Drive): uses flash chips with no moving parts. It is faster, silent and more durable.
- Pen drive and memory card: portable flash storage.
- CD, DVD, Blu-ray: optical discs read by a laser. A CD holds about 700 MB, a single-layer DVD about 4.7 GB and a single-layer Blu-ray about 25 GB.
Virtual memory is a part of the hard disk that the operating system uses as extra RAM when the real RAM is full.
Number systems
A number system has a base, which is the count of digits it uses.
| System | Base | Digits used |
|---|---|---|
| Decimal | 10 | 0 to 9 |
| Binary | 2 | 0 and 1 |
| Octal | 8 | 0 to 7 |
| Hexadecimal | 16 | 0 to 9 and A to F (A = 10, F = 15) |
Decimal to binary
Divide by 2 again and again and note each remainder. Read the remainders from bottom to top.
For 13: 13 ÷ 2 = 6 remainder 1; 6 ÷ 2 = 3 remainder 0; 3 ÷ 2 = 1 remainder 1; 1 ÷ 2 = 0 remainder 1. Reading upwards gives 1101.
Binary to decimal
Give each place a power of 2, starting from the right: 1, 2, 4, 8. For 1011, you get 8 + 0 + 2 + 1 = 11.
Hexadecimal and octal
In hexadecimal, 1F means 1 x 16 + 15 = 31. In octal, 17 means 1 x 8 + 7 = 15. Hexadecimal is used for colour codes and memory addresses because it is shorter than binary.
Check yourself
- How many bits are there in 2 bytes? (16)
- What is binary 110 in decimal? (6)
- Which memory loses data when power goes off, RAM or ROM? (RAM)
Main points
- 1 byte = 8 bits; each higher unit is 1024 times the one before.
- RAM is volatile and temporary; ROM is non-volatile and holds start-up instructions.
- Cache is the fastest memory after registers; it sits between CPU and RAM.
- SSD is faster than HDD and has no moving parts.
- Binary is base 2, octal base 8, decimal base 10, hexadecimal base 16.
Revise this course: Quick revision notes · MCQs with answers (20)
Download all the notes of this course (PDF)
Doubts
No answered doubts for this lesson yet.