Computers: What Is A Computer Program?
Computers: What Is A Computer Program?
Computers: What Is A Computer Program?
explainthatstuff.com/howcomputerswork.html
1/11
Photo: Calculators and computers are very similar, because both work by processing
numbers. However, a calculator simply figures out the results of calculations; and that's all
it ever does. A computer stores complex sets of instructions called programs and uses
them to do much more interesting things.
Suppose you're looking at a digital photo you just taken in a paint or photo-editing
program and you decide you want a mirror image of it (in other words, flip it from left to
right). You probably know that the photo is made up of millions of individual pixels
(colored squares) arranged in a grid pattern. The computer stores each pixel as a
number, so taking a digital photo is really like an instant, orderly exercise in painting by
numbers! To flip a digital photo, the computer simply reverses the sequence of numbers
so they run from right to left instead of left to right. Or suppose you want to make the
photograph brighter. All you have to do is slide the little "brightness" icon. The computer
then works through all the pixels, increasing the brightness value for each one by, say, 10
percent to make the entire image brighter. So, once again, the problem boils down to
numbers and calculations.
What makes a computer different from a calculator is that it can work all by itself. You just
give it your instructions (called a program) and off it goes, performing a long and complex
series of operations all by itself. Back in the 1970s and 1980s, if you wanted a home
computer to do almost anything at all, you had to write your own little program to do it. For
example, before you could write a letter on a computer, you had to write a program that
would read the letters you typed on the keyboard, store them in the memory, and display
them on the screen. Writing the program usually took more time than doing whatever it
was that you had originally wanted to do (writing the letter). Pretty soon, people started
selling programs like word processors to save you the need to write programs yourself.
Today, most computer users rely on prewritten programs like Microsoft Word and Excel or
download apps for their tablets and smartphones without caring much how they got there.
(Apps, if you ever wondered, are just very neatly packaged computer programs.) Hardly
2/11
anyone writes programs any more, which is a shame, because it's great fun and a really
useful skill. Most people see their computers as tools that help them do jobs, rather than
complex electronic machines they have to pre-program. Some would say that's just as
well, because most of us have better things to do than computer programming. Then
again, if we all rely on computer programs and apps, someone has to write them, and
those skills need to survive. Thankfully, there's been a recent resurgence of interest in
computer programming. "Coding" (an informal name for programming, since programs
are sometimes referred to as "code") is being taught in schools again with the help of
easy-to-use programming languages like Scratch. There's a growing hobbyist movement,
linked to build-it yourself gadgets like the Raspberry Pi and Arduino. And Code Clubs,
where volunteers teach kids programming, are springing up all over the world.
3/11
Photo: Typical computer architecture: You can think of a computer as a series of layers,
with the hardware at the bottom, the BIOS connecting the hardware to the operating
system, and the applications you actually use (such as word processors, Web browsers,
and so on) running on top of that. Each of these layers is relatively independent so, for
example, the same Windows operating system might run on laptops running a different
BIOS, while a computer running Windows (or another operating system) can run any
number of different applications.
That's the basic idea behind an operating system: it's the core software in a computer that
(essentially) controls the basic chores of input, output, storage, and processing. You can
think of an operating system as the "foundations" of the software in a computer that other
programs (called applications) are built on top of. So a word processor and a chess game
are two different applications that both rely on the operating system to carry out their
basic input, output, and so on. The operating system relies on an even more fundamental
piece of programming called the BIOS (Basic Input Output System), which is the link
between the operating system software and the hardware. Unlike the operating system,
which is the same from one computer to another, the BIOS does vary from machine to
machine according to the precise hardware configuration and is usually written by the
hardware manufacturer. The BIOS is not, strictly speaking, software: it's a program semi-
permanently stored into one of the computer's main chips, so it's known as firmware (it is
usually designed so it can be updated occasionally, however).
Operating systems have another big benefit. Back in the 1970s (and early 1980s),
virtually all computers were maddeningly different. They all ran in their own, idiosyncratic
ways with fairly unique hardware (different processor chips, memory addresses, screen
sizes and all the rest). Programs written for one machine (such as an Apple) usually
wouldn't run on any other machine (such as an IBM) without quite extensive conversion.
That was a big problem for programmers because it meant they had to rewrite all their
programs each time they wanted to run them on different machines. How did operating
systems help? If you have a standard operating system and you tweak it so it will work on
any machine, all you have to do is write applications that work on the operating system.
4/11
Then any application will work on any machine. The operating system that definitively
made this breakthrough was, of course, Microsoft Windows, spawned by Bill Gates. (It's
important to note that there were earlier operating systems too. You can read more of that
story in our article on the history of computers.)
Photo: Inside the case of a typical PC showing four key areas of components, described
below. Photo by ArmadniGeneral courtesy of Wikimedia Commons, published under a
Creative Commons License.
It all looks pretty scary and confusing inside a typical PC: circuit boards like little "cities"
with the chips for buildings, rainbow tangles of wires running between them, and
goodness knows what else. But work through the components slowly and logically and it
all starts to make sense. Most of what you can see divides into four broad areas, which
I've outlined in green, blue, red, and orange on this photo.
5/11
computer case near the power socket (or a much smaller fan on a laptop, usually on one
side). In this machine, there are two external fans (colored green and blue) just to the left,
cooling both the power supply and the mainboard.
Mainboard (blue)
As its name suggests, this is the brain of a computer—where the real work gets done.
The main processor (central processing unit) is easy to spot because there's typically a
large fan sitting right on top of it to cool it down. In this photo, the processor is directly
underneath the black fan with the red central spindle. Exactly what's on the mainboard
varies from machine to machine. As well as the processor, there's the BIOS, memory
chips, expansion slots for extra memory, flexible ribbon connections to the other circuit
boards, IDE (Integrated Drive Electronics) connections to the hard drives and CD/DVD
drives, and serial or parallel connections to things like the USB ports, and other ports on
the computer case (often soldered onto the mainboard, especially in a laptop).
Drives (orange)
6/11
PCs typically have one, two, or three hard drives plus a CD/DVD reader/writer. Although
some machines have only one hard drive and a single combined CD/DVD drive, most
have a couple of empty expansion slots for extra drives.
PC makers tend to design and build their own motherboards, but most of the components
they use are off-the-shelf and modular. So, for example, your Lenovo PC or Asus laptop
might have a Toshiba hard drive, an Nvidia graphics card, a Realtek sound card, and so
on. Even on the motherboard, the components may be modular and plug-and-play: "Intel
Inside" means you've got an Intel processor sitting under the fan. All this means it's very
easy to replace or upgrade the parts of a PC either when they wear out or grow obsolete;
you don't have to throw the whole machine out. If you're interested in tinkering, there are
a couple of good books listed in the "How computers work" section below that will walk
you through the process.
You can connect your computer to peripherals (external gadgets like inkjet printers,
webcams, and flash memory sticks) either with a wired connection (a serial or parallel
cable) or with wireless (typically Bluetooth or Wi-Fi). Years ago, computers and
peripherals used a mind-boggling collection of different connectors for linking to one
another. These days, virtually all PCs use a standard way of connecting together called
USB (universal serial bus). USB is meant to be "plug and play": whatever you plug into
your computer works more or less out of the box, though you might have to wait while
your machine downloads a driver (an extra piece of software that tells it how to use that
particular piece of hardware).
Photo: USB ports on computers are very robust, but they do break from time to time,
especially after years of use. If you have a laptop with a PCMCIA slot, you can simply
slide in a USB adapter card like this to create two brand new USB ports (or to add two
more ports if you're running short).
Apart from making it easy to swap data, USB also provides power to things like external
hard drives. The two outer pins of a USB plug are +5 volt and ground power connectors,
while the inner pins carry the data. When you plug your phone into a USB port on a bus
or a train, you're just using the outer pins to charge the battery.
7/11
USB gives you much more connectivity than old-fashioned serial computer ports. It's
designed so you can connect it in many different ways, either with one peripheral plugged
into each of your USB sockets or using USB hubs (where one USB plug gives you access
to a whole series of USB sockets, which can themselves have more hubs and sockets
plugged into them). In theory, you can have 127 different USB devices attached to one
computer.
It was probably the worst prediction in history. Back in the 1940s, Thomas Watson, boss
of the giant IBM Corporation, reputedly forecast that the world would need no more than
"about five computers." Six decades later and the global population of computers has
now risen to something like one billion machines!
To be fair to Watson, computers have changed enormously in that time. In the 1940s,
they were giant scientific and military behemoths commissioned by the government at a
cost of millions of dollars apiece; today, most computers are not even recognizable as
such: they are embedded in everything from microwave ovens to cellphones and digital
radios. What makes computers flexible enough to work in all these different appliances?
How come they are so phenomenally useful? And how exactly do they work? Let's take a
closer look!
Photo: NASA runs some of the world's most powerful computers—but they're just super-
scaled up versions of the one you're using right now. Photo by Tom Tschida courtesy of
NASA.
What is a computer?
8/11
Photo: Computers that used to take up a huge room now fit comfortably on your finger!.
Imagine if a computer were a person. Suppose you have a friend who's really good at
math. She is so good that everyone she knows posts their math problems to her. Each
morning, she goes to her letterbox and finds a pile of new math problems waiting for her
attention. She piles them up on her desk until she gets around to looking at them. Each
afternoon, she takes a letter off the top of the pile, studies the problem, works out the
solution, and scribbles the answer on the back. She puts this in an envelope addressed to
the person who sent her the original problem and sticks it in her out tray, ready to post.
Then she moves to the next letter in the pile. You can see that your friend is working just
like a computer. Her letterbox is her input; the pile on her desk is her memory; her brain is
the processor that works out the solutions to the problems; and the out tray on her desk is
her output.
Once you understand that computers are about input, memory, processing, and output, all
the junk on your desk makes a lot more sense:
9/11
Artwork: A computer works by combining input, storage, processing, and output. All the
main parts of a computer system are involved in one of these four processes.
Input: Your keyboard and mouse, for example, are just input units—ways of getting
information into your computer that it can process. If you use a microphone and
voice recognition software, that's another form of input.
Memory/storage: Your computer probably stores all your documents and files on a
hard drive: a huge magnetic memory. But smaller, computer-based devices like
digital cameras and cellphones use other kinds of storage such as flash memory
cards.
Processing: Your computer's processor (sometimes known as the central
processing unit) is a microchip buried deep inside. It works amazingly hard and gets
incredibly hot in the process. That's why your computer has a little fan blowing away
—to stop its brain from overheating!
Output: Your computer probably has an LCD screen capable of displaying high-
resolution (very detailed) graphics, and probably also stereo loudspeakers. You may
have an inkjet printer on your desk too to make a more permanent form of output.
On this website
Computers (a list of all our computing articles)
Computer memory (RAM, ROM, etc)
Buying a new computer
History of computers
Integrated circuits
Internet
Supercomputers
Books
How Computers Work The Evolution of Technology (10th Edition) by Ron White and
Timothy Downs. QUE, 2014. A good introduction with plenty of text supported by
good photos and illustrations.
Haynes: Build Your Own Computer by Kyle MacRae and Gary Marshall. Haynes,
2012. This is a more technical guide for people who like to tinker with their
machines, but it's also good for getting an insight into how a computer works under
the covers.
Hackers: Heroes of the Computer Revolution by Steven Levy. O'Reilly, 2010. The
human, all-too-human stories behind the computer revolution: the key people who
put computers in your home.
10/11
Accidental Empires : How the Boys of Silicon Valley Make Their Millions, Battle
Foreign Competition, and Still Can't Get a Date by Robert X. Cringely. New York:
HarperBusiness, 1996. How the personal computer revolution happened in the
1970s and 1980s.
A World of Computers and Coding: Discover Amazing Computers and the Power of
Coding by Clive Gifford. Hachette, 2019. An overview of hardware and software for
ages 7–11.
The Science of Computers by Clive Gifford. Wayland, 2016. A basic introduction for
ages 8–10.
Computer Coding for Kids by Carol Vorderman. Dorling Kindersley, 2014. Mostly
conceived and written by Jon Woodcock, this is a colorfully funky introduction to
coding that will appeal to ages 9–12.
Coding Games in Scratch by Jon Woodcock. Dorling Kindersley, 2015. A simple
introduction to games design.
Eyewitness Computer by Mike Goldsmith and Tom Jackson. Dorling Kindersley,
2011. A 72-page, photo-rich introduction combining computer and Internet history
with basic concepts. Good for ages 9–12.
Please do NOT copy our articles onto blogs and other websites
Articles from this website are registered at the US Copyright Office. Copying or otherwise
using registered works without permission, removing this or other copyright notices,
and/or infringing related rights could make you liable to severe civil or criminal penalties.
Text copyright © Chris Woodford 2007, 2018. All rights reserved. Full copyright notice and
terms of use.
11/11