CS-iGCSE-CIE-Notes

Central Processing Unit

The CPU executes and processes the instructions and data in a computer application.

The CPU is responsible for executing and processing instructions and data from an application so that a system can complete certain operations. 

The CPU contains the:

A microprocessor (also CPU) is an electrical device that works on an integrated system on a single device and contains the circuitry necessary for a computer to perform logical operations. Memory is connected externally, so there is only a CPU on the chip. 

Main functions:

  1. Receives input data

  2. Processes data

  3. Provides output data

****

Von Neumann Model:

Fetch  →  Decode  →  Execute

Random Access Memory

A volatile storage unit; volatile meaning dependent on a power source. It is called random because any storage location can be accessed at any time. When running, it stores data, instructions, and the operating system. 

The information in the RAM can be swapped and rewritten at any time. It is also known as the immediate access store as read/write operations can be completed considerably faster than a hard disk/ssd due to the way it functions.

Stores a value/instruction and its address in binary code.

Opcode and Operand 

Opcode: instruction

Operand: data to be processed

   
Address Value
1101 0101
0110 0010
1011 1101

The stored program concept refers to instructions and data stored on the same RAM memory and both are fetched sequentially one at a time.

ROM

ROM (Read only memory) and contains the BIOS and Bootstrap. It stores data (instructions and memory) that is necessary for the computer to run and startup. This is non-volatile..

The BIOS (basic input/output system) is a component in the computer that is used whenever a computer is booted up; 

checks initialisation settings for the computer;

checks if the hardware is running correctly;

Bootstrap loads the operating system into the RAM. 

CPU Registers

These are high-speed storage units within the CPU

Units

ALU - Arithmetic logic unit

CU - Control unit

Buses

Paths/wires for data to be transferred between the components of a computer through parallel data transmission.

CPU <-> RAM (bi-directional)

CPU -> RAM (uni-directional)

Fetch-Decode-Execute

Fetch

The address of the next instruction is stored in the PC and stores the address in the MAR.

Data from the address in MAR is fetched from the RAM

Data is read and placed into the MDR (memory data register) via the data bus.

The current instruction is stored in the CIR

Decode

The CU reads the data in the CIR and checks if it is a valid instruction in its instruction set (each CPU has its own instruction set which may vary between different computers). It will then decode the instruction so that the computer understands it.

Execute

ALU performs a logical operation and the result is stored in the ACC. Additional data may be fetched from the RAM to complete the instruction.

Data in ACC is then transferred to the MDR and then written into RAM.

Fill in the blanks:

PC, CIR, MDR, MAR, ACC

The address of the next instruction to be fetched is stored in the ____. This address is then moved to the ____. Data in that address is moved into the ____ and placed in the ____. The ____ then increments by one to prepare for the next instruction. 

PC, MAR, MDR, CIR, PC

     
Stage Address  
LOAD 10 Fetches value in [10]
ADD 11 Adds value in [11]
STORE 12 Stores value in [12]

In the example above, lets say:

   
Instruction Address
LOAD 10 10
ADD 2 11
ADD 3 12
SUBTRACT 2 13

PC: [10] - address of memory

MAR: [10] - copies memory address in PC

MDR: LOAD 10 - fetches data in address at MAR

CIR: LOAD 10 - copies data in MDR

Cores, cache, clock

Clock speed/clock cycle: The number of times the CPU’s clock ticks per second // measured in hertz. Whenever this clock ticks, the CPU processes an instruction. A common clock speed is 3.5 to 4.0 GHz.

When this clock speed changes, the settings within the BIOS are altered.

A higher clock speed typically means that the computer is faster as is processes instructions at a faster rate.

Overclocking

Changing the clock speed in the bios to a value higher than the manufacturer’s settings. This will allow the CPU to execute more instructions at a time however this will generate much more heat than it was designed to handle. 

The cache is very high performance memory stored in the CPU. This has the fastest access rate within the system which improves the CPU performance. The RAM is not able to pass data to the CPU fast enough. The cache allows it to operate at its optimum speed by feeding it data to the MDR. Data buses.  

Cores are the CPU’s processors. Each of these cores read and execute instructions. Multi-core processors can execute multiple instructions simultaneously, meaning that the more cores a CPU has the more instructions it can execute at a time, and the more efficient it is. 

Instruction sets

These are a set of simple, low-level instructions that the CPU can understand (ADD, JMP). These are also referred to as opcodes. Opcodes inform the CPU what needs to be done. Operands are the data required to complete the task. This is what an operation is made up from. 

These instruction sets can be read during the fetch-decode-execute, fetched in the CU and then decoded in the CIR. 

Embedded systems

A combination of software and electrical/electro-mechanical hardware to perform a specific task. 

Feedback oriented:

Analogue sensor where ADC (analogue to digital converter)  converts these signals to digital values

  1. Transmits the digital signals to input

  2. Decision is made in processor - input value compared to stored or decision value

  3. Output - sends a signal to actuator

It then resamples after a given amount of time - receives and test the value from the input again

Ambient value: referring to the immediate surroundings

Embedded systems only do specific sets of functions, unlike a PC. They may be on microcontrollers, microprocessors, or microchips. It is always embedded into a single chip. The system will take an input either automatically through a sensor or manually by an operator, process it, then produce an output which will be the function of the system. 

Rom drive - mb

Ram - gb

Hard disk drive - tb 

Perfect sensor response:

The {sensor} will take in/record/measure the {what the sensor records} of a/the {area/person/target} to/trying to {goal}, for example {>3 examples}, this analogue data is then sent to an ADC (analogue to digital converter) which turns it into machine code/digital format/binary code so the microprocessor can understand. The signal is sent to the microprocessor which {what is done with values} so {goal} can be achieved. {IF CONDITIONS} Depending on if {condition}, do {goal} otherwise do {other goal}. To do these goals, a signal is sent to a DAC, then to a {device} that {does goal}


As this is still a work in progress, feel free to view the roadmap here to check for future updates.

If you have any features you would like to suggest, or notice any issues with the website, please submit an issue on Github.

If you like the work, consider supporting us by following both Madelyn’s Github and Valentina’s Github