Chapter 4 Processor Fundamentals A Levels
Chapter 4 Processor Fundamentals A Levels
Processor Fundamentals
Central Processing Unit Architecture
Von Neumann realized data & programs are indistinguishable and can therefore use same
memory.
It follows a linear sequence of fetch–decode–execute operations for the set of instructions i.e.
the program.
Registers: smallest unit of storage of microprocessor; allows fast data transfer between other
registers
Used to temporarily store data values which have been read from memory or some processed
result
Memory Data Register (MDR): holds data value fetched from memory
3
Memory Address Register (MAR): Holds address of memory cell of program which is to be
accessed
Accumulator (ACC): holds all values that are processed by arithmetic & logical operations.
Current Instruction Register (CIR): Once program instruction fetched, it is stored in CIR and
Status Register: holds results of comparisons to decide later for action, intermediate and
Arithmetic and Logic Unit (ALU): part of processor that processes instructions which require
Control Unit (CU): part of CPU that fetches instructions from memory, decodes them &
synchronizes operations before sending signals to computer’s memory, ALU and I/O devices to
Immediate Access Store (IAS): memory unit that can be directly accessed by the processor
System Clock: timing device connected to processor that is needed to synchronize all
components.
Buses
4
set of parallel wires that allow the transfer data between components in a computer system
Data bus: bidirectional bus that carries data instructions between processor, memory, and I/O
devices.
Address bus: unidirectional bus that carries address of main memory location or input/output
Control bus
used to transmit control signals from control unit to ensure access/use of data & address buses
Clock Speed
number of pulses the clock sends out in a given time interval, which determines the number of
If the clock speed is increased, then execution time for instructions decreases. Hence, more
However, there is a limit on clock speed since the heat generated by higher clock speeds cannot
Bus Width
Increasing bus width increases number of bits transferred at one time, hence increasing
Cache Memory
Commonly used instructions are stored in the cache memory area of the CPU.
If cache memory size is increased, more commonly executed instructions can be stored and the
need for the CPU to wait for instructions to be loaded reduces, hence CPU executes more cycles
Number of Cores
Most CPU chips are multi-core — have more than one core (essentially a processor)
computer performance
Ports
Hardware which provides a physical interface between a device with CPU and a peripheral
device
6
Peripheral (I/O) devices cannot be directly connected to CPU, hence connected through ports
Universal Serial Bus (USB): Can connect both input and output devices to processor through a
USB port
Can only connect output devices (e.g. LCD display) to the processor through a HDMI port
HDMI cables transmit high-bandwidth and high-resolution video & audio streams through
HDMI ports
Can only connect output devices (e.g. second monitor/display) to the processor through a VGA
port
VGA ports allows only the transmission of video streams, but not audio components
Fetch stage
PC is incremented
Decode stage: The opcode and operand parts of instruction are identified
Execute stage: Instructions executed by the control unit sending control signals
MAR ← [PC]
7
PC ← [PC] + 1
MDR ← [[MAR]]
CIR ← [MDR]
Decode
Execute
Return to start
Double square brackets: CPU must do a logical process and then copy this value
Interrupts
The processor checks interrupt register for interrupt at the end of the F-E cycle for the current
instruction
If the interrupt flag is set in the interrupt register, the interrupt source is detected
All contents of registers of the running process are saved on the stack
Once ISR is completed, the processor restores registers’ contents from the stack, and the
Assembly Language
and an operand
Machine code: code written in binary that uses the processor’s basic machine operations
Relationship between machine and assembly language: every assembly language instruction
(source code) translates into exactly one machine code instruction (object code)
Symbolic addressing
Assembler
Software that changes assembly language into machine code for the processor to understand
The assembler replaces all mnemonics and labels with their respective binary values (that are
Assembler converts mnemonic source code into machine code in one sweep of program
Symbol table created to enter symbolic addresses and labels into specific addresses
Adressing
Data Movement
Arithmetic
Operations
Comparing
Conditional Jumps
Unconditional Jumps
I/O Data
Ending
B denotes a binary number, e.g. B01001010 & denotes a hexadecimal number, e.g. &4A
Modes of Addressing
Indirect Addressing: The address to be used is at given address. Load contents of this second
address to ACC
Relative addressing: next instruction to be carried out is an offset number of locations away,
relative to address of current instruction held in PC; allows for relocatable code
Conditional jump: has a condition that will be checked (like using an IF statements)
specified
11
Bit Manipulation
Arithmetic shift: Used to carry out multiplication and division of signed integers represented by
bits in the accumulator by ensuring that the sign-bit (usually the MSB) is the same after the
shift.
12
Cyclic shift: the bit that is removed from one end by the shift is added to the other end.
Bit Masking
Masking: an operation that defines which bits you want to keep and which bits you want to
clear.
Matching: an operation that allows the accumulator to compare the value it contains to the
Mask the content of the register with a mask pattern which has 0 in the ‘mask out’ positions
Set the result with the match pattern by using the AND command with a direct address.
Mask the content of the register with a mask pattern which has 0 in the ‘mask out’ positions
Compare the result with the match pattern by using the CMP command or by “Checking the
pattern”.
The final ‘non-zero’ result confirms the patterns are not the same else vice versa.