Computer systems consist of hardware and software components and follow the concept of the input, process, output and storage model. This means that a computer system takes in some data as input, processes it in a manner that we have requested and outputs the result in some way. During the processing phase, other data, may be needed apart from the inputted. This data will exist in the storage of the computer system and will be used during the processing phase. Furthermore, any new information that may arise from the processing phase may also be saved in the storage.
Data or instructions that are processed by a computer system in the process phase of the input, process, output and storage model are processed by the central processing unit (CPU). The CPU is a hardware component of a computer system and can perform basic arithmetic, logical or input/output operations, in order to process data from input devices into useful information. The CPU is the ”brain” of a computer system and can process data very quickly but can only process data by following instructions — it cannot think for itself. The CPU can also be referred to as the processor or chip. The CPU functions in the process phase of the input, process, output and storage model. It retrieves and saves data and information from and to the storage, which is the primary memory of the computer system. Any data or information that is to be saved on or retrieved from some storage medium (hard drive, USB stick) first has to pass through the primary memory in order to be accessed by the CPU. As such, the CPU can retrieve data only from the input or primary memory of the computer system.
The CPU contains the:
The control unit (CU) is responsible for the operation of the CPU. It controls the retrieval of instructions from the primary memory as well as the sequence of their execution. The arithmetic logic unit (ALU) performs all the basic arithmetic, logical or input/output operations. The CU is responsible for providing the ALU with the data that needs to be processed as well as the instructions of how the data should be processed.
The CU contains various registers. In general, a register is a small storage location that can hold data, usually a multiple of 8 bits. For example, a 64-bit computer has 64-bit registers. The size of the register in bytes is known as a word. For example, the 64-bit register holds 64 * bits = 8 8 bits, and since 1 byte is equal to 8 bits, 64 bits = 8 Bytes. Thus, a 64-bit computer system has a word size of 8 bytes. This means that each memory location will hold 64 bits (or 8 Bytes).
The CU also contains the control signals to/from the bus, the control bus, and clock signals.
The MAR holds the address of the data to be used by the ALU so that the ALU can fetch the corresponding content from the memory and process it accordingly. The MAR may also hold the memory address of where data that has been processed will need to be stored. In order for the MAR to communicate with the primary memory, a connection is necessary. This connection is accomplished by the Memory (Address) Bus.
The MDR memory holds the data that is to be used by the ALU and then saved to the RAM. The MDR is closely related to the MAR, since whichever memory address location the MAR is holding, the corresponding data will be loaded onto the MDR for processing by the ALU. After the processing has taken place, the ALU places the result onto the MDR and the data is copied to the memory address location in RAM specified by the MAR. The connection between the RAM and the MDR is accomplished by the Data Bus.
Now that we have the formal definitions out of the way, let’s look at this in a way that is easier to digest.
Let’s take a restaurant as an analogy. The CPU is the Kitchen, the inputs are raw ingredients(data) + a recipe (source code) and the output is cooked food.
The Kitchen(CPU) is divided into two different sections. The chefs (ALU) and the preparation area (CU).
The preparation area is handled by two people, one holding a recipe (MAR) and the other holding raw ingredients (MDR).
The process would then be: