Processing is the function that transforms the inputs into outputs. Control is the function that directs the other components within the processor to perform their functions at the correct time and in the correct order. Both these functions are integrated within the central processing unit (CPU). Both processing and control functions are performed by transistors, millions of transitors. Each transistor can be thought of as a switch, just like a light switch. Either electrons flow through the switch or they do not. By connecting these switches in complex ways microprocessors are able to perform complex and varied tasks. 
The CPU contains
- the ALU (Arithmetic Logic Unit)
- the control unit and
- registers.
The registers are memory areas used to store instructions, addresses and data currently being used by the CPU. The control unit makes sense of each instruction it receives and directs the ALU to perform the appropriate process. The data and the result from the ALU’s processing are stored in the CPU’s internal registers. The control unit, ALU and the registers are hardwired into the CPU, each design of CPU having its own unique instruction set. Modern CPU’s also contain one or more cache areas to speed up the interface between the CPU and RAM. Most also have an integrated floating point unit (FPU) to perform real number computations.  Let us consider the function of each component shown on this diagram. Remember each of these components are hardware components. They are hardwired to perform their functions.
- Bus interface – provides a communication channel between the CPU and primary storage (RAM). Both instructions and data are received and sent via this interface. Information moves faster within the CPU than into and out of the CPU, the bus interface must sort out this inconsistency.
- Code cache – a storage area for instructions that are likely to be needed in the near future. Most programs involve repeating the same instructions, these instructions are retained in the code cache where they can be accessed quickly.
- Branch predictor – attempts to guess the most likely next instruction and determine its reliance on previous instructions. This is particularly useful when there is a jump within the code to a set of new instructions. The Branch Predictor assists the Decode/Prefetch Unit to get instructions ready in advance.
- Decode/Prefetch Unit – performs most of the control functions and handles the execution of some instructions. This unit makes sense of instructions and directs the other components to perform their functions. A number of instructions are being fetched and decoded at the same time in a modern CPU.
- ALU – modern CPUs have more than one arithmetic logic unit, so more than one instruction can be executing at the same time. The ALUs perform the bulk of the actual processing functions. Essentially the ALU can add binary numbers, shift them left or right, and compare them. Combinations of these tasks allow ALUs to subtract, multiply, divide and perform logical comparisons such as greater than, less than, and equal to.
- Registers – temporary storage areas used by the ALUs during execution. Registers hold the operands required to execute instructions and also the results obtained after execution.
- Data Cache – very fast memory area for storage of data that may soon be needed or is needed repeatedly.
- Floating Point Unit (FPU) – performs all non-integer calculations. The FPU is a processing unit dedicated to performing computations involving floating point numbers.
Later in this chapter we examine how the software instructions sent to the CPU are understood and executed by the CPU’s hardware.
|