Friday, February 21, 2014

Hardware


Hardware is the name given to the physical, touchable, material parts of a computer system; the keyboard, the mouse, the motherboard, CPU, etc. The term is used to distinguish these fixed parts from the more changeable software or data components which the hardware executes, stores or carries.
The CPU
The diagram below is taken from a CPU simulator but it has many of the features found in a typical CPU and will be used to explain the various concepts.
The different sections of a CPU (see CPUSIM notes) are connected by groups of wires known as a “bus”. These wires normally work in parallel so that as much data is transferred as quickly as possible. Some buses work in one direction only – others are bi-directional. There are three main sets: the data bus, address bus and control bus.
Data bus
As you might suspect the data bus transfers data from one part of the CPU to another. It can also transfer the data to and from memory and even to other parts on the computer such as graphics cards or disc drives. The original home computers worked with an 8-bit data bus. For byte wise operations this was fine. If the processor required data then 8 bits was brought to and from memory in one cycle. However if the number to be brought in was 16 bits then 2 cycles would be required. This takes time and so the overall time to perform this operation increased. When the data bus in processors increased from 16 to 32 to 64 bits the overall speed increased. The width of the data bus is called the “word-length”. NB Some processors have different sizes of data bus for internal and external operations.
Address bus
With an 8-bit address but the 8 wires can have a range of values from 00000000 to 11111111 ie 256 different values. This means that there can be a maximum of 256 (28)different addresses and data can only be released from or stored in these memory locations. Obviously this very limiting for programming so, even with very early processors, an address bus 16 bits wide was more common. With this arrangement there can be up to 65536 (216) or 64KB. The Commodore 64, one of the early home computers designed and built before you were born sad, indicated by it’s name how much memory it could access. There were several “fiddles” so that a processor could access banks of memory so, when Bill Gates and others developed MSDOS the maximum memory of 640KB seemed a lot. Modern processors and operating systems now can now access many gigabytes of memory. By calculating 264 in decimal you could find out, in principle, what the exact figure in decimal would be.
Memory needs to be “backed up” on to backing store (normally discs or tapes) since memory is volatile ie it looses it’s contents when the power is removed.
Control Bus
These contain fewer wires. In principle one wire could let data travel down the data bus as a memory read or write, another one could be determining if input or output is to take place.
Stored Program Concept
This is the storage of instructions in computer memory to enable it to perform a variety of tasks. So various binary patterns can be stored in memory and, depending upon the order in which they are processed, they can be interpreted as instructions, addresses or data. According to the exam board this can be defined as "instructions fetched from memory and executed by the processor".  Remember this!
The Motherboard
The motherboard generally holds the CPU, memory, clock, BIOS (see later) and, possibly, on-board controllers for I/O, graphics and storage. Most will have some way of expanding these facilities. These, on a modern PC, would include slots so that expansion cards such as those needed for networking (NIC), modems, graphics, scanner controllers, etc.

The clock determines the overall speed of the processor. If “over-clocked” the processor can get too hot and will stop working. The clock is also used together with the control bus to control the timings of various events – for instance the events in fetch/execute cycle. The operating system will also keep referring to it for various timing operations such as time slicing. (See Operating System notes on Priority)
When a typical home computer is turned on the first thing the CPU would do is look for instructions stored in the BIOS (Basic Input Output System). Originally this BIOS program would have been stored in a ROM but, nowadays, most can be re-programmed so that faults can be overcome or new situations accounted for. The program in the BIOS then controls the initial searching for an Operating System. Programmers could use the BIOS to access the hardware but, in order to make programs more portable, the operating system is more generally used. Can you imagine, writing from scratch, a program which would access the disc hardware, check that a file was at a certain sector, track and surface – all before you could save information away. These days it just doesn’t make sense - unless you wear a tanktop!

When a user works on the computer all the work is stored in RAM (Random Access Memory). This is lost if the power is turned off and, so, will need to be placed on backing store (disc or tape). 

No comments:

Post a Comment