The computers we use every day are all designed around the same general idea of cooperation among three base elements: processor, memory and peripheral devices. Their names represent their functions in the system: memory stores data and program code, the processor manipulates data by executing programs, and peripherals maintain contact with the user, the environment and other systems. To exchange information, these elements communicate through interconnections named buses. The generic block schematic diagram of the exemplary computer is shown in Fig. 1.
It is often called “the brain” of the computer. Although it doesn’t think, the processor is the element which controls all other units of the computer. The processor is the device that manages everything in the machine. Every hardware component of the computer is controlled, to some extent, by the main processor. Even if the device has its own processor - for example, a keyboard - it works under the control of the main one. The processor handles events. We can say that synchronous events are those that the processor handles periodically. The processor can’t stop. Of course, when it has the power, even when you don’t see anything special happening on the screen. On a PC with an operating system without a graphical user interface, for example, plain Linux, or in a command box in Windows, if you see only „C:\>”, the processor is working. In this situation, it executes the system's main loop. In such a loop, it’s waiting for the asynchronous events. Such an asynchronous event occurs when the user presses a key or moves the mouse, when the sound card stops playing a sound, or when the hard disk begins transmitting data. For all of those actions, the processor handles executing the programs - or, if you prefer, procedures.
A processor is characterised by its main parameters, including its operating frequency and class.
Frequency is crucial information which tells the user how many operations can be executed in a time unit. To obtain the detailed information on the number of instructions per second, it must be combined with the average number of clock cycles per instruction. Older processors required a few or even a dozen clock pulses per instruction. Modern machines, thanks to parallel execution, can achieve impressive results, with a few instructions per cycle.
The processor's class indicates the number of bits in the data word. It tells us what the sizes of the arguments the processor can calculate with a single arithmetic, logical, or other operation are. The still-popular 8-bit machines have a data length of 8 bits, whereas the most sophisticated can use 32- or 64-bit arguments. The processor's class determines the size of its internal data registers, the size of instructions' arguments and the number of data bus lines.
Memory is the element of the computer that stores data and programs. It is visible to the processor as a sequence of data words, with each word having its own address. Addressing allows the processor to access simple and complex variables and to read the instructions for execution. Intuitively, the size of a memory word should correspond to the class of the processor, but this is not always true. For example, in PCs, regardless of the processor class, memory is always organised as a sequence of bytes, and its size is reported in megabytes or gigabytes.
The size of the memory installed on the computer does not have to match the size of the address space, the maximum size of memory which is addressable by the processor. In modern machines, it would be impossible or hardly achievable. For example, for x64 architecture, the theoretical address space is 2^64 (16 exabytes). Even the address space currently supported by processors' hardware is as large as 2^48, which equals 256 terabytes. On the opposite side, in constrained devices, the physical memory size can exceed what the processor supports. To enable access to memory beyond the processor's addressing space or to support flexible placement of programs in a large address space, the paging mechanism is used. It is a hardware support unit that maps the processor's address into the physical memory installed in the computer.
Called also input-output (I/O) devices. There is a variety of units belonging to this group. It includes timers, communication ports, general-purpose inputs and outputs, displays, network controllers, video and audio modules, data storage controllers and many others. The main function of peripheral modules is to exchange information between the computer and the user, collect information from the environment, send and receive data to and from elements of the computer that are not directly connected to the processor, and exchange data with other computers and systems. Some of them are used to connect the processor to the computer's functional unit. For example, the hard disk drive is not connected directly to the processor. It uses the specialised controller, which is the peripheral module that operates as an interface between the computer's central elements and the hard drive. Another example can be the display. It uses a graphics card, which serves as a peripheral interface between the computer and the monitor.
The processor, memory and peripherals exchange information using interconnections called buses. Although you can find in the literature and on the internet a variety of bus types and their names, at the very lowest level, there are three buses connecting the processor, memory, and peripherals.
Address bus delivers the address generated by the processor to memory or peripherals. This address specifies the single memory cell or peripheral register that the processor wants to access. The address bus is used not only to address the data which the processor wants to transmit to or from memory or a peripheral. Instructions are also stored in memory, so the address bus also selects the instruction that the processor fetches and later executes. The address bus is one-directional. The address is generated by the processor and delivered to other units.
The number of lines in the address bus is fixed for the processor and determines the size of the addressing space the processor can access. For example, if the address bus of some processor has 16 lines, it can generate up to 16^2 = 65536 different addresses.
Data bus is used to exchange data between the processor and the memory or peripherals. The processor can read data from memory or peripherals, or write data to these units, previously sending their addresses on the address bus. As data can be read or written, the data bus is bi-directional.
The number of data bus bits usually corresponds to the processor class. It means that an 8-bit class processor has 8 lines of the data bus.
Control bus is formed by lines mainly used for synchronisation between the elements of the computer. The minimal implementation includes the read and write lines. Read line (#RD) is the information that other elements use to indicate that the processor wants to read data from the unit. In such a situation, the element, e.g. memory, puts the data from the addressed cell on the data bus. Active write signal (#WR) informs the element that the data which is present on the data bus should be stored at the specified address. The control bus can also include other signals specific to the system, e.g., interrupt signals, DMA control lines, clock pulses, signals distinguishing memory and peripheral access, signals activating selected modules, and others.