3.1 Computer Architecture
Last updated
Last updated
A computer system includes hardware & software. The main hardware components are the input devices (keyboard, mouse, etc.), the , primary memory, secondary storage, and output devices (monitor, speakers, etc.).
The CPU processes data by executing instructions and the results are outputted to an output device.
The microprocessor is a type of on a single chip. This circuit contains a CPU designed to perform arithmetic and logic operations. It also contains memory and input and output interfaces.
Van Neumann developed the concept of the stored program computer in 1940 Even the most modern computers use architecture based on this concept
In this concept, data and instructions are stored in the same memory () as binary code. The CPU fetches instructions from the memory and executes them one at a time (serially). Then the CPU stores the results back into the memory.
The two main components are the Arithmetic & Logic Unit (ALU) and the Control unit (CU).
The CU controls the flow of data around the CPU and sends control signals to the different components instructing them what to do. It decodes operations (into an and ) and controls the timings of operations (the clock speed).
The ALU performs the calculations required to execute the instructions and can carry out logical operations like COMPARE. It has a built-in register where it stores interim results of calculations. After completing the calculations, it sends the data to the .
A summarised version and a sample answer for this entire process can be viewed at the end of the FDE Cycle chapter which can be found here.
Program Counter (PC)
Stores the address of the next instruction to be fetched from memory
Memory Address Registers (MAR)
Stores the address of the instruction or data to be fetched from or written to memory
Memory Data Register (MDR)
Stores the data that has been fetched or being written to memory. Data from MDR is sent to ALU to be executed
Current Instruction Register (CIR)
Stores the instruction the CPU is currently decoding or executing
Accumulator
Temporarily stores the results of the calculations performed by the ALU
If you are asked about the purpose of the MDR, MAR, or PC; explain how the data is being fetched or written to memory.
Components within the CPU and wider computer components are connected by buses. These are wires down which electronic signals and data travel. All the buses together are called the system bus.
There are 3 different buses:
The data bus Transmits data from the CPU to memory or input / output controllers and it's bidirectional
The control bus Transmits control signals from the CU to other components and it's bidirectional
The address bus Transfers addresses from the CPU to memory and it's unidirectional
This stands for the Fetch, Decode & Execute Cycle. The CPU executes instruction by performing it:
The CPU fetches an instruction from the memory
The instruction is decoded by the CPU
The instruction is executed
The whole cycle is repeated
Fetch
The memory address is stored in the MAR and is sent to the address bus. The data in transferred back to the CPU via the data bus where it's stored in the MDR. Then instruction is copied into the CIR and the PC increments.
Decode
The instruction in the CIR is decoded by the CU into an opcode and operand.
Execute
The instruction is executed by the ALU and the results is stored to the Accumulator or written to memory.
Sample answer (How is an instruction fetched in the Von Neumann model):
The PC (Program Counter) holds the address of the instruction The address held in the PC is sent to the MAR (Memory Address Register) This is done via the address bus The MAR goes to the location in memory where the instruction is stored The instruction is then sent to the MDR (Memory Data Register) This is done via the data bus The instruction is then passed to the CIR (Current Instruction Register) The CU sends the signals to manage the entire process via the control bus
A CPU can have multiple cores. Each core runs separate FDE cycles independently and simultaneously. Multiple cores enables multitasking but some programs cannot be split between cores. The more cores a computer has, the higher performance.
Each core has a clock speed (how many instructions per second). This is measured in Hz. Modern clock speeds can be measured in GHz (gigahertz - billion instructions per second).
Cache is a small amount of memory situated within or very close to the CPU. It has very fast read and write speeds. It is used for frequently used instructions or data and instructions that are to be fetched next. If the amount of cache is increased, the more data can be stored there and accessed faster which improves the performance.
Just because you have double the cores, it doesn't mean double the performance. The cores might have different clock speeds and cache sizes.
This is a list of all the commands that can be processed by a CPU. Each command has a unique binary code. After an instruction has been decoded, the CPU can execute it.
These sets or lists are machine specific so a program created with one individual's computer set is not likely to run on a different individual computer set who is using a CPU made by a different manufacturer (Intel & AMD).
This is a computer system with either one function or a limited set of functions built in a big mechanical device (e.g. microprocessor). The purpose of it is to allow the user to interact with it. Some embedded systems are .
Some advantages to this system are:
Low power consumption
Small size
Low cost to manufacturer
Can be controlled remotely
Can operate in real time and respond quickly