How Computers Work: For The Greenhorns Amongst Us.
As a self-proclaimed nerd, I was quietly ashamed yesterday when a senior engineer at my job argued that too few engineers today truly understand how Computers work. Of course, my initial reaction was to jump to the defensive: "I was taught that at Uni, it's the basics!" I had a quiet chuckle to myself shortly afterwards. Since when had the education system ever truly prepared me for the industry?
Sure, I knew bits and pieces of how a computer worked from my stint as a software developer, plus a broad (if basic) view from my time at Uni. But ultimately, I realized I couldn't have a meaningful discussion about the very tool I used day in and day out: my PC. How could that be allowed? How could I consider myself a cyber professional without knowing that much?
This article aims to remedy that in an easy-to-consume format. I am not complacent in my lack of knowledge, and if you've read this far, I suspect you aren't either.
What is a Computer?
Computers were invented because humans are inefficient. Lazy, too. It's much better to design a wonderful, magical machine that does our thinking for us than be forced to think ourselves. Your PC is a computer; but so is the Antikythera mechanism, built c.100 BC to navigate the stars. Computers are not a recent phenomenon, but this article focuses on modern, digital computers.
Computers take input data, do cool things with it, and then spit out some output data. Alan Turning's theoretical model ([the Turing Machine](http://turning definition of a computer)) describes a computer as a machine capable of performing any computation that could be described as a set of logical rules. To translate that into Engish: any task that you can theoretically do with a pen and paper (and enough time), a ‘computer' ought to be able to do too. It can probably just do it more quickly than you can.

What is a Computer Made Of?
Due to a whole lot of physics-related stuff, a computer can only comprehend two states: high voltage and low voltage. You will hear computer geeks refer to these states as 1 and 0 (also ‘True' and ‘False'). Everything a user asks a computer to do begins with 1s and 0s. There is no getting around it.
In order to make anything happen with those 1s and 0s, we use logic gates. A logic gate is a physical component found in a circuit that is comprised of (many) transistors. When these logic gates are connected, the computer can perform logical and arithmetic operations.
Take the below ‘OR' Gate as an example. If we only receive two low voltages, we have no power. But if we receive just one high voltage, we have power.

If you're still confused, try to think of it in terms of a normal, non-computing context. Cake, for example!

There are different types of logic gates to make different decisions. See here for a good explanation.
How Does a Computer Think?
So far, we know what a computer is, and that its circuitry is made up of these things called logic gates. But what magic takes place that means somehow, stuff is shown to you on a screen? How come you can use applications, or access the internet?
Enter the CPU.
The Central Processing Unit (CPU) is comprised of millions of transistors and logic gates. Consider it the brain of a computer. Similar to how our brains work with the rest of our organs, the CPU works with other components like storage units to do its job: which is running programs.
A program is simply a long sequence of instructions. When we download a new program onto our PCs, the CPU examines the program and determines how to carry out its instructions. It does this using the Fetch, Decode, Execute cycle – this is a whole process in itself, for which there will be a new article shortly. In the meantime, I recommend reading up on the Von Neumann architecture: this video by Computerphile is great.
Where Does a Computer Store Stuff?
We've already established that a computer needs to store things. Even if you don't have a technical background, you can probably appreciate this: most adverts for technology have RAM specs on them, and besides, what would be the point in a computer that couldn't store anything you wanted to?
There are two types of internal PC storage you probably want to get your head around:
- RAM (Random Access Memory) serves as the computer's short-term memory, enabling it to access data and instructions required for any currently running processes. Unlike storage devices, RAM is volatile, meaning its contents are lost when the computer is turned off or restarted. Think of a time when you're PC has crashed, and as a result, you've lost some words in an unsaved document. That's because the RAM was wiped clean upon shutdown. The faster the RAM, the smoother the performance, as it allows the CPU to access data more quickly.
- ROM (Read-Only Memory) is memory that can only be read from; not written to. It typically contains firmware or key instructions that are permanently stored on the computer's circuitry. Unlike RAM, ROM retains its contents even when the computer is powered off. ROM contains a computer's Operating System and initializes essential hardware components before the operating system takes over.
Here's a nice table to make those distinctions a bit clearer:

What is an Operating System, and Why do I Care?
We mentioned Operating Systems in the last section, and that it is initially loaded from ROM. An ‘Operating System' (OS) is just a fancy word for a master program that acts as a translator between software (i.e. applications) and hardware (for example, the CPU). Windows, Mac and Unix are the most commonly used operating system; but so are IOS and Andriod.
The OS determines when a program can be run by the CPU, and what resources that program is permitted to access. This is why malicious software such as Rootkits are made: if you can control the OS, you can control almost anything on the PC. The kernel is considered the heart of an operating system.

Operating systems have several uses. I could write them out in a long, boring way, but here is a mindmap instead:

When I Press the Power Button on my PC, What Actually Happens?
To be frank, loads happens when you start your PC. But here is an oversimplified version of events:
- When the light flickers to life on your power button, it sends a signal to the power supply unit to start supplying power to the components of your computer.
- The motherboard receives power from the PSU and begins its initialization process. This involves checking various components such as the CPU, RAM, and peripherals to ensure they are functioning correctly.
- The CPU also receives power and starts executing instructions from the BIOS (Basic Input/Output System) or UEFI (Unified Extensible Firmware Interface) firmware, which is stored in a memory chip on the motherboard. In turn, these components perform a Power-On Self-Test (POST) to check for hardware errors.
- Once the BIOS/UEFI initialization is complete, the motherboard hands over control to the boot loader of the operating system installed on the computer. The boot loader loads the operating system kernel into memory and starts the operating system.
- Finally, the operating system presents the user with a login screen or desktop environment, allowing the user to interact with the computer.
Summary
It probably isn't a surprise to you that there's a lot that goes into how a computer works. It's not a question with a simple answer: after years of continuous technological advancement, how could there be an easy answer? You can't condense all the above into a simple statement, and frankly, the content of this article barely scratched the surface.
If you want to know more, I encourage some good, old-fashioned reading; better yet, buy a cheap PC and break into it. As Earl Nightingale once proclaimed:
"One hour per day of study in your chosen field is all it takes. One hour per day of study will put you at the top of your field within three years. Within five years you'll be a national authority. In seven years, you can be one of the best people in the world at what you do."
Whether or not the metrics still hold true, I have no idea. But it can't hurt, can it? To stay curious and dig for answers, no matter how big the question is.