Architecture of a CPU (Von Neuman Architecture)
Now that you know how logic gates can be used to perform calculations and to store data, let’s have look at how this all fits together to make a computer.
At the heart of the computer there is a unit called the Central Processing Unit (CPU).
You’ve probably heard of CPUs before. They’re made by companies like Intel, AMD and Qualcomm, and have technical data associated with them such as Quad Core, 3.2GHz with 6Mb of cache.
The CPU can be further divided into three main parts: the Arithmetic Logic Unit (ALU), the Control Unit (CU), and what are known as Registers. We’ll look at these first.
Registers are parts of the CPU that can store data. They operate a little like RAM, but rather than use capacitor-based memory cells, the memory cells are only composed of logic gates. Registers can’t hold as much data as RAM can, but they operate considerably faster.
There are five different types of register within the CPU. The table below gives you some basic details, but you will see how these registers operate in the next section.
|Accumulator||AC||Stores the results of calculations|
|Instruction Register||IR||Stores the address in RAM of the instruction to be processed|
|Memory Address Register||MAR||Stores the address in RAM of the data to be processed|
|Memory Data Register||MDR||Stores the data that is being processed|
|Program Counter||PC||Stores the address in RAM of the next instruction|
The Arithmetic Logic Unit
The ALU is the core of the CPU. It is made up of all those logic circuits that we have been learning about for the past three weeks.
The ALU uses these logic circuits to perform a variety of operations. It can perform addition of binary numbers. It can also perform a variety of other arithmetic operations, such as subtraction and incrementation. The ALU can also perform logical operations, such as comparing two binary numbers to see if they are the same or not.
The Control Unit
The control unit decodes what each instruction means, and can then control how the other components operate. So when the control unit receives an instruction, which is just a binary number, it will then signal what the ALU and memory is supposed to do. It might be that the instruction is to add two numbers together, or it might be that the instruction is to store a number in RAM.
The control unit also contains a clock. This is a tiny oscillating crystal, which controls the rate at which calculations are performed by the CPU.
This is the RAM that was talked about in the previous section. The RAM stores both the instructions that the computer needs to perform, and the data on which to perform it; you’ll see how this works in the next section. The idea of storing both data and instructions in the same memory is the basis of what is known as the stored-program computer. When reading from or writing to RAM, two registers are needed: one to store the address in RAM that is being read from or written to, and another register to store the data itself.
All of these components are connected together by bundles of wires that are collectively known as buses. So there is a bus to carry data, another for addresses and another for instructions.
Input and Output
Additionally a computer would usually have some input and output devices that can receive external data and then output the results of the calculation. This could be something as simple as a data connection, or something more complicated such as a keyboard and monitor.
This method of putting together a computer is known as the Von Neumann Architecture. It was devised by John von Neumann in about 1945, well before any of the components that would be needed to produce it had actually been invented.