# A computer is a shopping list?

Someone I know was wondering how to explain to a young person what the major parts of a computer do. How does a computer work, and how do the main parts – RAM, CPU, hard drive (or *storage*) – interact with each other? And it’s not just young people who don’t know!

The example I immediately thought of is when you use a shopping list to budget for your next trip to the store. The shopping list, your brain, and somewhere to write your “working out” of the sums all add up to the major parts of a computer.

# What *are* all the parts?

**C****omputer storage** – a hard drive, USB stick, SD card – is like a **shopping list** . It stores the information – *data*¹ – that you want to keep. In this instance, the shopping list will probably have the following information:

- the items you want
- how many of each item
- how much each item costs
- the total cost of everything, once you’ve figured it out.

The computer **CPU** (central processing unit) is like your **brain** . It does all the sums (*computations*) required to multiply the number of items by how much they cost, and then add all those numbers together to figure out the total. Any sum like 1 + 1 = 2 is a computation. Everything that happens inside a computer is by adding and subtracting numbers, even though what you are seeing is words or images. Before electronic computers were invented, *people* who did all the calculations for science and so on were often called “computers” – because their brains did all the computing.

**RAM** (random access memory) is like your **working** of the sums. It is a very short-term place to store calculations so that the CPU can get to them quickly. You might use a whiteboard or scrap of paper to write down the numbers you need to multiply (you just need the quantity and cost of each item here, not all their names as well). Once you’ve done multiplication with your brain and written the results temporarily on the board, you easily can total up the cost of all your list items. Once you’ve got the final total, you’d write that on your shopping list (*store* the new data) for when you visit the ATM to take some money out, and then clean off your workings off the board.

RAM in a computer constantly wipes temporary information off and writes it over with new data that it’s working on. It’s *completely* wiped when you turn the computer off. That’s why when you are writing something in a document, you must remember to SAVE it so that it gets *stored* properly on the hard drive before you wipe the temporary data by shutting down (what you type is mostly just in RAM until it is saved).

There are other parts to a computer like a motherboard, which the other parts slot into (like a Lego board), DVD player, graphics card, keyboard, the case and so on. But the main work of a computer is done with the CPU, RAM and storage. It doesn’t do anything more than what your brain does, combined with a way to store the information that you are working on, temporarily, or forever.

# Why do we use computers, then?

Now that we know how simple computing is, and that our brains and a piece of paper can do anything a computer does in terms of calculation, why do we use them?

Firstly, let’s look at how much information a computer can store. The usual measurement of how much information can be stored on a drive these days is in “gigabytes”. A byte is about the amount of storage that can store one letter in our alphabet – you can use about 5 million of letters, or bytes, to store everything that Shakespeare wrote – 5 megabytes. That’s about 1500 pages in a book (that would normally be three books). A gigabyte is 1024 megabytes – that’s as many books as you could stack in the back of a pickup trucks/ute. An average smartphone today currently has 64GB of storage, which means that it could store 39,000 big books. This is probably more than the number of books in a suburban library.

Next, there’s how much a computer can work on or compute at once. My computer isn’t very new, and it has two processors that each have a speed of 2.67 gigahertz. Gigahertz is basically a measure of how many millions of “bits” of data per second the processor can work on. A bit is 1/8th of a byte. Because my computer runs a “64-bit” operating system (basically, how many data “pipes” the processor can handle), it can work on over 340 million bits of information per second.

This is in theory, but in the real world, it’s not that simple. When we do multiplication, we learn that 5 x 5 = 25. We do it in one calculation. A computer has to basically add all the 5s together 5 times to get the same result. (Well, not quite like that – we add things in base-10, but computers use base-2 – it really only needs three addition operations to calculate 5 x 5.) What we do in one calculation, a computer tends to do more “expensively” – it needs to do more calculations to get the result. On the other hand, it takes me maybe half a second to remember 5 x 5 = 25. The fastest mental arithmetician can add up 15 3-digit numbers in 1.7 seconds – that’s nearly 27 separate additions per second (although humans actually use shortcuts). My computer could theoretically calculate 5 x 5 = 25 (using 6 number bits and three additions) 18.9 million times in a second. Still 700,000 times faster than the mathematics genius.

Imagine how long it would take to read 39,000 big books. Some people might be able to do it in 106 years (reading one a day). But spending that many years on storing that information in your head – assuming you live that long *and *remember all of it – would be pretty tough. Once you start working on it, you’re just one person. If you wanted to work as fast as my computer, you’d somehow need to share that information with your 700,000 maths geniuses, or else you would have *all* needed to spend that 106 years memorising everything first.²

So, to sum up, the main advantage of a computer is that it can store a lot of information, and it can work on everything *extremely fast*. And it doesn’t get bored. Also, depending on the software, a computer can show a lot of information in many different ways – numbers, words, pictures, sound. The drawback is that it can’t *think*, or decide for itself how valid the information it’s received is – it can only calculate with what it’s given. The only way it knows that 5 x 5 = 25 is because of the rules that have been programmed into it. If you give a computer the wrong information, or give it in the wrong way, it doesn’t know that, and you can end up getting the wrong results (or no result at all).

Because a computer works so fast with so much data, though, and we don’t normally have 700,000 maths geniuses nearby, we’ve found it worth the effort of programming lots of rules, developing software, and checking the accuracy of the information a computer is working with, in order to get the benefit of that speed in processing so much of the data that’s out there in the world.

# Notes

¹ A piece of *data* is just some kind of fact or measurement. For example, you learn that the price of a bar of chocolate has gone up by 50 cents. That’s data about the chocolate price. *Information* is about using that data in context, or combining other data points together. With the higher price, the chocolate bar might now be the most expensive chocolate bar in the store. This might mean the store will sell less of them in future. Or, since the previous price of the chocolate bar was $2.50, you might decide that 50c more is too much extra to pay and that the makers are pretty cheeky to ask for that much extra.

² People might notice I’m using an example combining the storage capacity on a smartphone with the processing power of my computer. We could pretend that my computer only stores 64GB of data. But these examples are not supposed to be *real* – we’re just trying to get a very imprecise impression of the scale of the differences between how a computer works vs what one person can do.