Last Sync: 2022-08-08 08:00:04

This commit is contained in:
tactonbishop 2022-08-08 08:00:04 +01:00
parent 84d45a71a4
commit f3e909cf80
3 changed files with 39 additions and 31 deletions

View file

@ -1,8 +1,8 @@
---
tags:
- Theory_of_Computation
- Hardware
- cpu
- von-neumann
- von_neumann
---
# CPU architecture
@ -18,7 +18,7 @@ The CPU comprises three core components:
> 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.
ontrollers.md). It takes the instructions in binary form from RAM memory (s
## Registers
This is the part of the CPU that stores data. The memory cells that comprise it do not have capacitors (unlike RAM) so they cannot store very much data but they work faster, which is what is important.
@ -50,6 +50,12 @@ Below is a schematic of a series of logical circuits within the CPU core:
![74181aluschematic.png](/img/74181aluschematic.png)
### Processor cores
The vast majority of general purpose computers are multi-core. This means that the CPU contains more than one processing unit. They are best thought of as mini-CPUs within the main CPU since they each have the same overall Von Neumann architecture.
With Intel processors the two main consumer processors are the i5 and i7. The latter has more cores than the former. Consequently it has faster clock speeds and greater concurrency due to increased threads.
## Control Unit
The CPU's [controller](/Hardware/Chipset_and_controllers.md). It takes the instructions in binary form from RAM memory (separate from the CPU, but connected) and then signals to the to ALU and memory registers what it is supposed to do to execute the instructions. Think of it as the overseer that gets the ALU and registers to work together to run program instructions.
@ -65,6 +71,8 @@ The CPU's [controller](/Hardware/Chipset_and_controllers.md). It takes the instr
3. As the first instruction has been fetched, the system reaches the end of the first cycle. Thus the Program counter increments by 1 to log this.
4. The next fetch cycle begins.
### Decode
1. Now that the instruction is fetched and stored in the RAM it needs to be decoded. It is therefore sent from the RAM to the Control Unit of the CPU. There are two parts to the instruction:
@ -79,31 +87,3 @@ Now the command will be executed. The operand is copied to the Memory Address Re
## The Clock
// TODO: Explain the above cycle in relation to the system clock. Explain Hertz and cycles per second drawing on notes on buses and kernel actions.
## The Little Man Computer
// TODO: Improve notes and learn how to use
The [Little Man Computer](https://peterhigginson.co.uk/lmc/) is a simplified computer that works on Von Neuman principles. It has all the CPU components we have detailed above. It is programmed in machine code but for simplicity it uses the denary rather than the binary number system.
![LMC_5.gif](/img/LMC_5.gif)
On the left is the instruction set. Each number constitutes and execution routine and the `xx` stand for the address in RAM that the execution will work on.
Each row of the RAM has a denary address, 1 through to 99. Each address can hold three digits.
* So the instruction `560` would mean *load the number at address 60.*
* The instruction `340` would mean *store a datum at address 40*
### Working through a basic computation
We are going to add two numbers together as a basic example.
1. First we need to place the two numbers in RAM we are going to use `5` and `3`
* At address `60` we will put the number `5` and at address `61` we will put the number `3`
* We are going to start at address `0` in the top left of the RAM grid
1. The first instruction will be *load address 60* which in the assembly will be `560` . We put this in address `0`, our starting point.
1. This first instruction is now stored in the accumulator.
1. Now we want to *add this number (in the accumulator) to the number in address 61*
1. This second instruction is `161` . We write this in address `1`
1. Finally we want to store the output of the calculation in the RAM, let's say at address `62`
1. So we store the command `362` at address `2`

View file

View file

@ -0,0 +1,28 @@
## The Little Man Computer
// TODO: Improve notes and learn how to use
The [Little Man Computer](https://peterhigginson.co.uk/lmc/) is a simplified computer that works on Von Neuman principles. It has all the CPU components we have detailed above. It is programmed in machine code but for simplicity it uses the denary rather than the binary number system.
![LMC_5.gif](/img/LMC_5.gif)
On the left is the instruction set. Each number constitutes and execution routine and the `xx` stand for the address in RAM that the execution will work on.
Each row of the RAM has a denary address, 1 through to 99. Each address can hold three digits.
* So the instruction `560` would mean *load the number at address 60.*
* The instruction `340` would mean *store a datum at address 40*
### Working through a basic computation
We are going to add two numbers together as a basic example.
1. First we need to place the two numbers in RAM we are going to use `5` and `3`
* At address `60` we will put the number `5` and at address `61` we will put the number `3`
* We are going to start at address `0` in the top left of the RAM grid
1. The first instruction will be *load address 60* which in the assembly will be `560` . We put this in address `0`, our starting point.
1. This first instruction is now stored in the accumulator.
1. Now we want to *add this number (in the accumulator) to the number in address 61*
1. This second instruction is `161` . We write this in address `1`
1. Finally we want to store the output of the calculation in the RAM, let's say at address `62`
1. So we store the command `362` at address `2`