How a Computer Works: A Beginner Guide From Power Button to Screen - featured illustration

How a Computer Works: A Beginner Guide From Power Button to Screen

When you click an icon, a program opens in a fraction of a second. Behind that click is a chain of steps that is the same on every computer: power on, firmware, boot loader, operating system, then your program running instructions on the CPU. This beginner’s guide follows one click from the button to the screen, so that the parts described in what is a computer fit together.

Step 1: everything is bits

A computer only understands two states, on and off, written as 1 and 0. Numbers, text, pictures, sounds and even programs are encoded as patterns of these bits (see bits and bytes). The letter “A”, for example, is stored as the number 65, which in binary is 01000001. Tiny electronic switches called transistors hold and change these values, and a modern CPU contains billions of them.

Step 2: power on and start-up

Pressing the power button starts the firmware on the motherboard (UEFI on modern PCs). It checks the hardware (POST), finds the disk with the operating system and loads the boot loader from it. The boot loader loads the OS kernel into RAM, the kernel starts services and drivers, and finally the login screen appears. Each stage is explained in the Windows boot process.

Step 3: the CPU’s cycle

A program is a long list of tiny instructions stored in memory, such as “add these two numbers” or “copy this value”. The CPU repeats a simple cycle billions of times per second:

  1. Fetch the next instruction from memory.
  2. Decode it to work out what it asks for.
  3. Execute it using the arithmetic and logic unit (ALU) and small, very fast storage places called registers.
  4. Store the result, then move to the next instruction.

The processor’s clock speed, measured in gigahertz (GHz), counts clock ticks: 3 GHz means roughly three billion ticks per second. One instruction may take several ticks, and modern cores can finish several instructions in one tick, so clock speed alone does not tell you how fast a CPU is. Modern CPUs also have several cores, each running its own instruction stream, and use cache memory on the chip to avoid waiting for the slower RAM.

Step 4: memory and storage

On a PC, programs and data are loaded into RAM before the CPU uses them, because RAM is far faster than a disk (some small devices run code directly from flash memory instead). Storage (SSD or hard disk) keeps everything when the power is off. When you open a program, the OS copies it from storage into RAM and starts running it. If RAM fills up, the OS may move less-used data to a page file or swap area on disk, which is much slower and is why a computer with too little RAM feels sluggish.

Step 5: the operating system in the middle

The OS decides which program uses the CPU and for how long, gives each program its own protected memory, and provides the file system, networking and drivers. A program that needs to read a file or send data does not do it itself; it makes a system call, and the kernel does the work. That protects programs from each other; read user mode and kernel mode for the details. The OS also switches between programs so quickly that many appear to run at once.

Step 6: input and output

When you move the mouse or press a key, the device sends a signal, which raises an interrupt that makes the CPU pause and run a small piece of driver code. The OS delivers the event to the program in front, which responds by asking the GPU to draw something new on screen. The GPU builds the picture in memory and sends it to the display, typically 60 or more times per second.

Putting it together: opening a photo

  1. You double-click holiday.jpg. The mouse click becomes an interrupt, and the OS tells Explorer.
  2. Explorer asks the OS to open the file; the OS reads it from the SSD into RAM.
  3. The photo app’s instructions run on the CPU, decompressing the JPEG data into pixel values.
  4. The GPU draws the pixels into a window and the display shows them.

Each of these steps takes microseconds to milliseconds, which is why it feels instant.

Try it yourself

  • Open Task Manager (Windows) or top/htop (Linux) and watch CPU and memory change as you open a program.
  • In PowerShell, [Convert]::ToString(65,2) shows the binary for 65. In a Linux shell, printf '%d\n' "'A" prints 65.
  • Compare storage speeds: opening the same large program from an SSD and a hard disk shows the memory hierarchy in action.

Common questions

Why does a computer slow down when many programs are open?

They compete for CPU time and RAM. When RAM runs out, the system swaps to disk, which is very slow.

What is the difference between a CPU and a GPU?

A CPU has a few powerful cores good at complex, varied tasks. A GPU has thousands of simpler cores suited to doing the same operation on lots of data at once, such as graphics and AI.

Does more GHz always mean faster?

No. Performance also depends on the number of cores, cache, memory and how much work the CPU does per cycle.

Sources

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *