You are on page 1of 15

A & AS Level Computer Science – Processor Fundamental

Von Neumann architecture


Von Neumann architecture uses the concept of stored program, which refers to a machine that
would hold in a single store (main memory) both instructions (program) and data on which the
instructions were to be carried out.

bus

A bus is a set of parallel wires connecting two or more components of the computer.

Data Bus: A bi-directional bus to access data to and from memory address mentioned in MAR.

Address Bus: This bus is used to carry the address from where data needs to be fetched or
placed in main memory. This is a one directional bus whose width defines the range of
addresses a microprocessor can reach to.

For example an address bus of 12 bits can reach to 212=4096 (4k) addresses whereas 32 bit bus
can reach 232 =4 GB addresses.

Control bus: A bi-directional bus that carries signals from the CU to all the other computer
components. It is usually 8-bits wide since it only carries control signals.

Bus width - the number of bits of information a bus can carry at one time.

1
A & AS Level Computer Science – Processor Fundamental

Processor refers to the brain of computer. It does all of the thinking and tells all the other
components what to do.
The processor contains the control unit, the arithmetic and logic unit (ALU) and register.

Control unit coordinates and controls all the operations carried out by computer. It operates by
repeating three operations:
 Fetch - get the next instruction from main memory
 Decode - make sense to the instructions
 Execute - perform the instructions

ALU perform arithmetic operation (addition, subtraction, multiplication, division) and logical
operation (comparison of data - >=, <=,>, <).

Registers are special storage locations to hold information temporarily, while it is being decoded
or manipulated. These are:

Programs counter - an incrementing counter that keeps track of the memory address of which
instruction is to be executed next.

Memory Address Register - the address in main memory that is currently being read or written.

Memory Data Register - acts like a buffer between memory and CPU to hold data/ instructions
fetch from memory ready for the processor to use it.

Current instructions register - a temporary holding ground for the instruction that has just been
fetched from memory.

Accumulator - performs the arithmetic and logical operations and stores the result of processing.

Index register (IX) - used when carrying out index addressing operations. (adjust the address
part of an instruction)

Status register – hold values of “flag” – bits indicating information about the state of the
processor.

Each bit is known as a flag. Most systems have the following four flags.
 Carry flag (C) is set to 1 if there is a CARRY following an addition operation.
 Negative flag (N) is set to 1 if the result of a calculation yields a NEGATIVE value.
 Overflow flag (V) is set to 1 if an arithmetic operation results in an OVERFLOW being
produced.
 Zero flag (Z) is set to 1 if the result of an arithmetic or logic operation is ZERO.

2
A & AS Level Computer Science – Processor Fundamental

The fetch decode execute cycle

 Load the address that is in the program counter into the memory address register
 Increment pc by 1
 Load the instruction that is in the memory address given by the MAR into the memory data
Register
 Load the instruction that is now in the MDR into the current instruction register
 Decode the instructions that is in the CIR
 If the instructions is a jump instruction then
 Load the address part of the instructions into the pc
 Reset by going to step 1
 Execute the instruction.

https://www.youtube.com/watch?v=IL44-Mfp8x4

Register notation

MAR ← [PC]
PC ← [PC] + 1
MBR ← [[ MAR ]]
CIR ← [MBR]
CIR, decode then execute

3
A & AS Level Computer Science – Processor Fundamental
Use of interrupts in the fetch-execute cycle

A special register called the interrupt register is used in the fetch-execute cycle. While the CPU
is in the middle of carrying out this cycle, an interrupt could occur, which will cause one of the
bits in the interrupt register to change its status. For example, the initial status might be 0000
0000 and a fault might occur while writing data to the hard drive; this would cause the register to
change to 0000 1000.

The following sequence now takes place:

 At the next fetch-execute cycle, the interrupt register is checked bit by bit.
 The contents 0000 1000 would indicate an interrupt occurred during a previous cycle and
it still needs servicing. The CPU would now service this interrupt or ignore it for now,
depending on its priority.
 Once the interrupt is serviced by the CPU, it stops its current task and stores the contents
of its registers.
 Control is now transferred to the interrupt handler (or interrupt service routine, ISR).
 Once the interrupt is fully serviced, the register is reset and the contents of registers are
restored.

Other Components of the processor

Immediate access store (IAS) - The IAS holds all the data and programs that the processor
(CPU) needs to access.

The CPU takes data and programs held in backing store and put them into the IAS temporarily.
This is done because read/write operations carried out using the IAS are considerably faster than
read/write operations to backing store.

System clock - a timing devices connected to the processor that synchronizes when the fetch,
decode execute cycle runs. It send the processor a signal at regular times telling it to start the
fetch decode execute routine.

Clock speed – determines the number of cycles that are performed by the CPU per second.

4
A & AS Level Computer Science – Processor Fundamental
Computer ports
1. USB ports

A Universal Serial Bus (USB) is a common interface that enables communication between devices
and a host controller such as a personal computer (PC) or smartphone. It connects peripheral devices
such as digital cameras, mice, keyboards, printers, scanners, media devices, external hard drives and
flash drives.

When a device is plugged into a computer using one of the USB ports

 the computer automatically detects that a device is present (this is due to a small change in
the voltage level on the data signal wires in the cable)
 the device is automatically recognized, and the appropriate device driver is loaded up so that
computer and device can communicate effectively
 If a new device is detected, the computer will look for the device driver which matches the
device. If this is not available, the user is prompted to download the appropriate software.

Advantages of USB Disadvantages of USB


 devices plugged into the computer are  the present transmission rate is limited to less
automatically detected and device drivers are than 500 megabits per second
automatically loaded up  the maximum cable length is presently about five
 the connectors can only fit one way, which metres
prevents incorrect connections being made
 this has become the industry standard, which
means that considerable support is available to
users
 several different data transmission rates are
supported
 newer USB standards are backward compatible
with older USB standards

2. High-definition multimedia interface (HDMI)

High-definition multimedia interface (HDMI) – a type of port connecting devices to a computer. It


allow output (both audio and visual) from a computer to an HDMI-enabled device. They support
high-definition signals.

Modern HD (high definition) televisions have the following features:

 They use a widescreen format (16:9 aspect ratio).


 The screens use a greater number of pixels (typically 1920 × 1080).
 The screens have a faster refresh rate (such as 120 Hz or 120 frames a second).
 The range of colours is extremely large (some companies claim up to four million different
colour variations).

5
A & AS Level Computer Science – Processor Fundamental
HDMI was introduced as a digital replacement for the older Video Graphics Array (VGA) analogue
system.

3. Video Graphics Array (VGA)


Video Graphics Array (VGA) – type of port connecting devices to a computer. It supports 640 × 480
pixel resolution on a television or monitor screen. It can also handle a refresh rate of up to 60 Hz (60
frames a second) provided there are only 16 different colours being used.

6
A & AS Level Computer Science – Processor Fundamental
Assembly language
Before a program written in assembly language (source code) can be executed, it needs to be
translated into machine code. The translation is performed by a program called an assembler.
An assembler translates each assembly language instruction into a machine code instruction.
There are two types of assembler: single pass assemblers and two pass assemblers.
A single pass assembler puts the machine code instructions straight into the computer memory to
be executed.
A two pass assembler produces an object program in machine code that can be stored, loaded
then executed at a later stage. This requires the use of another program called a loader. Two pass
assemblers need to scan the source program twice, so they can replace labels in the assembly
program with memory addresses in the machine code program.

Addressing modes

7
A & AS Level Computer Science – Processor Fundamental

Bit Manipulation
Binary shift
1. Left shift

8
A & AS Level Computer Science – Processor Fundamental
2. Right shift

9
A & AS Level Computer Science – Processor Fundamental
3. Arithmetic shift

10
A & AS Level Computer Science – Processor Fundamental
4. Cyclic shift

Exercises

a) Write 24 as an 8-bit register.


Show the result of a logical shift 2 places to the left.
Show the result of a logical shift 3 places to the right.

11
A & AS Level Computer Science – Processor Fundamental
b) Convert 19 and 17 into binary.
Carry out the binary addition of the two numbers.
Shift your result from part b two places left and comment on the result.
Shift your result from part b three places right and comment on the result.

12
A & AS Level Computer Science – Processor Fundamental
Logical shifts in assembly language programming

Instructions used to check, set and clear a single bit or group of bits.

13
A & AS Level Computer Science – Processor Fundamental
Specimen 2021 P1

14
A & AS Level Computer Science – Processor Fundamental

Answer:

15

You might also like