Computer System
Computer memory
Convert between memory units.
A computer needs memory to store data and instructions. 'Memory' usually means primary (main) memory; secondary memory (storage devices) keeps data, instructions and results permanently for future use.
Units of memory. Computers store everything in binary: bits (0 and 1). A 4-bit word is a nibble (e.g. 1001); an 8-bit word is a byte (e.g. 01000110). Larger units each step up by 1,024:
- 1 KB (kilobyte) = 1,024 bytes; 1 MB = 1,024 KB; 1 GB = 1,024 MB; 1 TB = 1,024 GB;
- 1 PB (petabyte) = 1,024 TB; 1 EB (exabyte) = 1,024 PB; 1 ZB (zettabyte) = 1,024 EB; 1 YB (yottabyte) = 1,024 ZB.
Primary memory: programs and data are loaded here before processing, and the CPU reads and writes it directly.
- RAM (Random Access Memory) is volatile: it keeps data only while the power is on; switching off wipes it. It holds the programs and data in use, is called main memory, and is faster than secondary storage.
- ROM (Read Only Memory) is non-volatile: contents stay without power. It is a small, fast store for things that rarely change, such as the boot loader that loads the operating system into RAM at start-up.
Cache memory: RAM is still slower than the processor, so a very high-speed memory sits between the CPU and RAM. It keeps copies of frequently used data. The CPU checks the cache first and goes to RAM only if the data is not there, cutting average access time.
Secondary memory is non-volatile, larger, slower and cheaper than main memory, and cannot be accessed directly by the CPU: its contents must first be brought into main memory. Examples: Hard Disk Drive (HDD), CD/DVD, memory card, Solid-State Drive (SSD) (much faster than HDDs) and pen (flash) drives.
Example (new): how many bytes are in a 2 KB file? 2 × 1,024 = 2,048 bytes. And a 512 MB video is exactly half a gigabyte, since 1 GB = 1,024 MB.
Practise this lesson
Questions that get harder as you improve, a Tutor that helps without giving the answer away, and progress you can see. Free for every learner.
No account, no email address. Opens the real product.