The operating system is a go-between, between the physical
machine and the users/programs.
If you take a big picture view of a computer, you get three
things:
- the physical computer
- the operating system
- the user and programs running on the user's behalf
In this lesson we'll learn a bit about the physical computer.
What is a computer?
Basically, a computer is a device that can read in data,
process data, output data, and, optionally, store data.
Is a calculator a computer by this definition? It has keys for
inputting number and operations, a screen for outputting
results, and it processes data by performing the mathematical
operations you request, so ... it meets the definition.
Usually when we think "computer", we're thinking of a PC, a
laptop, or maybe a big server.
A typical PC, laptop or server consists of a number basic
components:
This an Intel Core i5 CPU.
-
CPU - this stands for Central Processing Unit. It is
essentially the brain of the computer.
What CPU does your laptop have? Your smartphone? An iPad?
- Memory (or RAM) - this is the CPU's short term memory,
it can only really compute with values it has loaded into
RAM, because the CPU itself can only remember a very small
number of things. When the power goes off, anything stored in RAM is lost.
RAM is usually measured in MB's or GB's (mega bytes and
giga bytes, remember?)
-
Harddrive - this is the computer's long-term memory.
Things stored here are remembered even after the power's
been turned off. Why bother with RAM then? Mostly
because the harddrive is much slower than RAM. If the
CPU needs to access a value often, it would slow down the
machine way too much to keep having to grab the value off
the harddrive.
Harddrive space is usually measured in GB's or TB's (giga bytes and
tera bytes, remember?)
-
Peripherals - These components are attached to the computer in some way to increase
the capabilities of your computer but are not a part of the core architecture of your
computer. These are things like webcams, printers,
scanners, and many others.
The harddrive is a peripheral, but it plays a central role
in how the computer functions, so we talk about it separately.
In order to find out what CPU and how much RAM you have, follow these steps.
- After clicking on the Windows Start button, select Control Panel.
- Click on System and Security.
- Under the System section, click View amount of RAM and processor speed.
In the description of your System the description may say "32-bit"
and it may say "64-bit". A CPU is called "32-bit" if it stores
memory addresses in 32-bits. This allows for a maximum of 4GB of memory.
Most CPUs for PCs now are "64-bit", meaning the CPU uses 64 bits
to store memory addresses. This allows for a maximum of 16
billion GB of memory ... which is a lot. The Operating System (OS) is
either written to make full use of 64 bits for addresses, or only
32. If you see "32-bit", it probably means the OS is 32-bit.
In order to see what peripherals you have, follow these steps.
- After clicking on the Windows Start button, select Control Panel.
- Click on System and Security.
- Click on System.
- Click on Device Manager.
If you click to expand things like "Network adapters" or
"DVD/CD-ROM drives" you'll get some details about these peripherals.
To see how much storage space you have on your hard drive, do these steps.
- After pressing the Windows Start button, right click on Computer and select Manage.
- On the left, under Storage, select Disk Management.
- Your hard drive should be listed as a storage device with its capacity.
Question: how many bits of storage is available on your harddrive?
fetch, decode, execute and the pulse of a CPU
A CPU leads a boring life. It performs the same three steps over,
and over and over and over and over ...
- fetch the next instruction from memory as a block of bytes
- decode the bytes to determine what action the instruction specifies
- execute the action encoded in the instruction
... and it performs these steps at something like hundreds of
millions of times per second. A CPU's "clock speed" tells you
(not quite literally, but close) how many of these steps it can
perform each second. So a 1 GHz clock speed means roughly a
billion steps per second. Pretty fast, eh? There is a crystal
inside the CPU that vibrates at a given rate, and it provides
the "tick" for the CPU's clock. It is, if you will, the beating
heart of the CPU.
You can get a graph of how busy your CPU is over time:
a) press control+alt+delete,
b) choose Start Task Manager,
c) click on the Performance tab.
You may well ask how the instructions the CPU loads from memory
in the fetch step got there in the first place.
These instructions are loaded into memory initially from a file
— namely the file that is "the program" the CPU is running.
And so we come full circle, back to the previous lesson!