4 - Processor Fundanmentals

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Processor Fundamentals

Von-Neumann Architecture

Arithmetic Logic Unit (ALU):


Allows arithmetic and logic operations to be carried out when a program is being run. A processor can
consist of more than one ALU. One would be responsible for performing fixed point operations while the
other would be responsible for performing floating point operations.
Accumulator (ACC):
It is a temporary storage register which is used when ALU calculations are being carried out.
Control Unit (CU):
It ensures the synchronization and flow of data throughout the computer. This is carried out with the help
of the control bus.
System Clock:
It produces timing signals on the control bus to ensure that swift synchronization takes place. Without the
system clock, the computer would crash.
Immediate Access Store (IAS):
It holds all the data and programs that the computer needs to access. It allows quick read and write
operations as the data is quickly accessed by the computer instead of being stored in backing store.
Registers
They are used to hold data.

Types of Registers:

1
Processor Fundamentals
Current Instruction Register (CIR):
Stores the data of the current instruction being decoded and executed.
Index Register (IX):
Used when carrying out index addressing operations.
Memory Address Register (MAR):
Used to store the address of the current instruction being processed.
Memory Data Register (MDR)/ Memory Buffer Register (MBR):
Stores the data which has just been read from and is about to be written to the memory.
Program Counter (PC):
Stores the address of the next instruction to be processed.
Status Register (SR):
Contains bits whi

ch can be set depending upon the operation. It is used when an instruction needs arithmetic or logical
processing.

Address bus:

 Carries signals related to address between the processor and the memory unit.
 It is unidirectional.

2
Processor Fundamentals
Data Bus:

 Carries signals related to data between the processor and the memory unit.
 It is bi-directional.

Control Bus:

 Carries signals related to control and coordination between the processor, memory unit and I/O
devices.
 It is unidirectional and bidirectional.
Factors increasing the performance of a processor:
1. Increasing the width of the bus- Allows more bits to be transferred.
2. Increasing the clock speed- Allows more instructions to be carried out per second.
3. Use of cache memory- Uses SDRAM which speeds up data access.
4. Increasing the word length- Allows more precise instructions to be carried out.
5. Increasing the number of cores- It reduces the need of overclocking thereby increasing processing
speed for the most part.
Drawbacks of the methods of increasing the performance of a processor:

 Increasing the clock speed makes the computer more unreliable by causing overheating issues.
 Increasing the number of cores means that the computer needs to communicate with more cores
thereby reducing the performance.
Computer ports:
Universal Serial Bus (USB):

Pros Cons
 Drivers of plugged-in devices are  Maximum cable length is up to 5m.
automatically loaded up.  Maximum transmission speeds are up to
 Has a universal connection. 500mbps.
 Connector fits one way; reduces chances  Older devices may not be supported.
of incorrect connections.
 Backwards compatible.
 Industry standard.
 Variable transmission speeds are
supported.

High-Definition Multimedia Interface (HDMI):


Features:

 Widescreen format (16:9)


 Greater number of pixels (1920*1080)
 Higher refresh rate (up to 120Hz)
 Large variety of colors used

3
Processor Fundamentals

Pros Cons
 Current standard for TVs and monitors.  Not a very robust connection.
 Faster transmission rates.  Limited cable length to retain good
 Improved security. connection.
 Better display image.  5 cable standards.

Video Graphics Array (VGA):


Features:
Image resolution up to (640*480).
Maximum refresh rate of 60Hz.
Only 16 colors used.

Pros Cons
 One standard available.  Outdated analog technology.
 Easy to connect multiple monitors from  Easy to bend the pins when making
one source. connections.
 Secure connection.  Cable must be high quality to make good
connection.

The Fetch-Execute Cycle:


1. The PC contains the address of the next instruction to be fetched.
2. The address is copied from the PC to the MAR via the address bus.
3. The contents of the address kept in the MAR are copied to the MDR via the data bus.
4. The contents of the MDR are copied to the CIR.
5. The PC is incremented by 1 and now it points to the next instruction to be fetched.
6. The instruction is finally decoded and executed in the form of signals via the Control Bus.

Register Transfer Notation (RTN) form:

4
Processor Fundamentals

Interrupt:

 It is a signal sent from a device or a software to the processor.


 The computer looks up the type and priority of the interrupt.
 If the interrupt is of a higher grade, then the computer halts the current task and services the
interrupt.
 Meanwhile, the contents of the current task are saved by the interrupt handler.
 Once the interrupt has been serviced, the Interrupt Service Routine is executed.
For example,

 A printer sends a signal to the processor that there is a paper jam or the printer is out of ink.
 A program sends a signal to the processor that the .exe file could not be found.
Interrupts allow multitasking to take place. For example, listening to music while downloading a file.
Assembly Language and Machine Code:

 Assembly language is most closely related to machine code and uses mnemonics (e.g: ADD 20)
instead of binary.
 Each instruction consists of an opcode and an operand.
 Opcode- It is the operation to be carried out.
 Operand- It is the data to be used by the Opcode.

Assembler: It is used to convert assembly language into machine code before execution.
Types of Assembler:

Single Pass Assembler Two Pass Assembler


Puts machine code instructions into the computer Produces an object program which is stored,
memory to be executed. loaded and then executed.
The source program needs to be scanned twice.

5
Processor Fundamentals
Pass 1 Pass 2
 Read the assembly language code.  Read the assembly language code, one
 Ignore unnecessary items. line at a time.
 Allocate a memory address for the code.  Generat object code, including opcode
 Check the opcode of the instruction set. and operand from symbol table.
 Add new labels to the symbol table along  Save and execute the program.
with the address.
 Place the address of the labelled
instruction in the symbol table.

LDM Load the number into the Immediate


Accumulator.
LDD Load the contents of the specified Direct/ Absolute
address into the accumulator.
LDI Load the contents of the contents Indirect
of the given address into the
accumulator.
LDX Load the contents of the calculated Indexed
address into the accumulator.
LDR Load the number into the Index Immediate
Register.
MOV Move the contents of the
accumulator to the register (IX).
STO Store the contents of the
accumulator into the specified
address.
END Return control to the operating
system/ end the task.
IN Enter a character and store its
ASCII value in the accumulator.
OUT Output the character whose ASCII
value is stored in the accumulator.
ADD (#n) Add the denary number into the
Accumulator.
ADD (<address>) Add the contents of the specified
address to the accumulator.
SUB (<address>) Subtract the contents of the
specified address from the
accumulator.
SUB (#n) Subtract the number from the
accumulator.
INC Add 1 to the contents of the
register.
DEC Subtract 1 from the contents of the
register.
JMP Jump to the specified address.
JPE Jump to the specified address if the
comparison being made is true.
JPN Jump to the specified address if the

6
Processor Fundamentals
comparison being made is false.
END Returns control to the operating
system.
CMP Compares the contents of the
accumulator with the contents of
the specified address.
CMP Compare the contents of the
accumulator with the number.
CMI Compare the contents of the
contents of the given address with
the accumulator.

Modes of Addressing:
Absolute Addressing:
The contents of the memory location are used.
Direct Addressing:
The contents of the memory location are used.
Indirect Addressing:
The contents of the contents of the memory location are used.
For example, if the location 200 stored the value 20, and the location 20 stored the value 10, then 10
would be stored in the accumulator.
Indexed Addressing:
The contents of the memory location by adding the contents of the index register are stored in the
accumulator.
Immediate Addressing:
The value of the operand is used only.
Relative Addressing:
The memory address used is the current memory address added to the operand.
Symbolic Addressing:
Labels are used instead of the values.
Bit Manipulation:
Binary shifts
Logical Shift
The shifted out bits are replaced with zeros.

7
Processor Fundamentals
Arithmetic Shift
The shifted out bits are replaced with ones.
Cyclic Shift
Bits shifted out of one end are entered through the other end of the register.
Left Shift
Bits are shifted to the left.
Right Shift
Bits are shifted to the right.
LSL n: Bits are shifted to the left side and 0s are introduced on the right side.
LSR n: Bits are shifted to the right side and 0s are introduced on the left side.
Use of Bit manipulation in monitoring and control
AND is used to check if the bit has been set.
OR is used to set the bit.
XOR is used to clear the bit that has been set.

Opcode Operand Explanation


AND n Mask number n to the selected bit.
AND <address> Mask address to the selected bit.
XOR n
XOR <address>
OR n
OR <address>

Past Papers:
Macro is a sequence of instructions given to an identifier. These may need to be carried out several times.
Directive is an instruction which tells the assembler to do something. It is not a program instruction.

8
Processor Fundamentals
A General Purpose Registers

B System Clock

C ALU

D Data Bus

E Control Bus

F Address Bus

Groups of Instructions
Input Output
Data Movement
Arithmetic operations
Jump instructions
Compare instructions
Modes of Addressing
Handling of Interrupt

You might also like