Cyber basics · Lesson 2 of 6
How computers work (for future defenders)
CPU, memory, storage and the operating system explained simply, plus bits and bytes, and why all of it matters when you’re protecting a computer.
⏱ 14 min🎯 Beginner🧪 Hands-on✅ 4-question quiz🎬 Video✓ Completed
By the end, you’ll be able to…
- Name the main parts of a computer and what each one does
- Explain bits and bytes, and count in binary up to 255
- Describe what an operating system does and why updates matter
Key words
- CPU
- The processor: it follows instructions, billions of tiny steps per second.
- RAM
- Short-term memory for whatever is running right now. It’s wiped when the power goes off.
- Storage
- Long-term memory (SSD or hard drive) that keeps files when the computer is off.
- Bit
- The smallest piece of data: a single 0 or 1.
- Byte
- 8 bits. One byte can store a number from 0 to 255, or one simple character like A.
- Operating system
- The main software (Windows, macOS, Linux, Android, iOS) that runs everything else and controls the hardware.
- Kernel
- The core of the operating system. It decides which program gets the CPU, memory and devices.
Every computer does four things
Your laptop, your phone, a games console and the server that runs a website all do the same four jobs:
- Inputkeyboard, touch, network, camera
- Processthe CPU follows instructions
- StoreRAM for now, storage for later
- Outputscreen, speaker, network
Security people use this view a lot. Malware has to get in (input), run (process), often hide (storage), and usually send something out (output). Every stage is a chance for a defender to notice it.
The parts inside
- CPU (processor): the worker. It reads instructions one tiny step at a time, but billions of steps per second.
- RAM (memory): the desk. Whatever you’re working on right now sits here because it’s fast. Turn the power off and the desk is cleared.
- Storage (SSD or hard drive): the filing cabinet. Slower than RAM, but it keeps your files, apps and the operating system when the power is off.
- Network card (Wi-Fi or Ethernet): the door to other computers.
Why defenders care: evidence lives in different places. Some malware only lives in RAM and disappears when you restart. That’s why incident responders sometimes capture memory before turning a computer off.
Bits and bytes: everything is numbers
Inside the computer, everything (text, photos, music, passwords) is stored as bits: tiny switches that are either 0 (off) or 1 (on). Eight bits make a byte.
Each position in a byte is worth double the one to its right: 128, 64, 32, 16, 8, 4, 2, 1. Add up the positions that are switched on, and you get the number. 01000001 is 64 + 1 = 65. In the most common text encoding, 65 means the letter A.
012816403201608040211That’s also why storage sizes grow in big jumps: a kilobyte is about a thousand bytes, a megabyte about a million, a gigabyte about a billion.
The operating system: the boss
Apps don’t talk to hardware directly. They ask the operating system (OS), and its core, the kernel, decides what’s allowed.
- Appsbrowser, games, Discord, your code
- Operating systemWindows, macOS, Linux, Android, iOS: files, users, settings
- Kernelshares out the CPU and memory, talks to devices, enforces permissions
- HardwareCPU, RAM, storage, network card
The OS also manages users and permissions. A normal account can’t change system files without asking. That one rule stops a lot of malware, which is why you shouldn’t use an administrator account for everyday browsing.
What happens when you open an app?
- You clickinput
- OS finds the programon storage
- Loads it into RAMnow it’s a process
- CPU runs itstep by step
- Window appearsoutput
This matters for security: a malicious file sitting in your Downloads folder can’t do anything until it’s run. That’s why “don’t open unexpected attachments” is such good advice.
Why updates matter so much
Operating systems and apps contain millions of lines of code, and some of it has mistakes. When a security mistake (a vulnerability) is found and fixed, the fix is shipped as an update or patch. Attackers study those patches too, so an un-updated device is an easy target. Turning on automatic updates is one of the most effective things anyone can do.
Windows: open Task Manager (Ctrl + Shift + Esc). Mac: open Activity Monitor. Linux: run top. You’ll see every running process, and how much CPU and memory each one uses. Just look: don’t end processes you don’t recognise.
🧪 Hands-on
Practice
Flip the bits to build numbers and letters. Can you make 255? What about the letter T (84)?
🎬 Watch
Video: How Computers Work: What Makes a Computer, a Computer?
Video by Code.org, hosted on YouTube. It loads only when you press play.
✅ Check yourself
Quick quiz
Every answer comes with an explanation, right or wrong. Your best score is saved in this browser.
🔗 Go further
Trustworthy resources
- GCFGlobal: Computer Basics Free, gentle tutorials on hardware, software and operating systems.
- Harvard CS50x Harvard’s famous free intro to computer science.
- Khan Academy: Computers and the Internet Short lessons on bits, data and how computers work.