Escolar Documentos
Profissional Documentos
Cultura Documentos
The CPU
In terms of computing power, the CPU is the most
important element of a computer system. The CPU
actually carries out the fetching, decoding and
executing of instruction (one instruction at a time).
The following diagram is one of the best possible representations of the internal
structure of the CPU:
System Clock
The main clock that controls the timing within a computer by generating a series of
pulses that are used to synchronize its circuits and operations
The clock rate is the frequency at which the clock generates pulses. The higher the
clock rate, the faster the computer may work. Each pulse is also referred to as cycle.
The frequency of pulse generation is measured in Hertz (Hz). One pulse is
equivalent to 1Hz.
CPU Speed
CPU speed is measured in Cycles per Second (Hertz). 1 Hz means cycle per
second.
A processor, whose speed is of 3 GHz, is able to process 3,000,000,000 (3 billion)
cycles in one second. The device which tracks the cycles is the system clock. The
following tables illustrate the units of measure used in measuring CPU speed:
CPU Speed
KHz – Kilo hertz 1,000 Hz 1 x 103Hz
MHz – Mega hertz 1,000,000 Hz 1 x 106Hz
GHz – Giga hertz 1,000,000,000 Hz 1 x 109Hz
Page 1 of 8
Student notes - CPU Theory
Units of Time
ms – millisecond 1ms = 0.1s = 1 x 10-1s
µs – microsecond 1 x 10-6s
ns - nanosecond 1 x 10-9s
Registers
Registers are special memory locations found inside the CPU, normally used for
specific purposes, where data or control information is temporarily stored. Some
registers are used in the different parts of the fetch execute cycle whilst others may
be available for use by the program being executed.
The registers handle/store the data currently used in the CPU. If data needs to be
stored for near future reference it is transferred to main memory and in case it is not
needed in the near future it is transferred to backing store, e.g. Hard disk.
Cache Memory
In between the registers and the main memory we usually find Cache Memory which
is a type of memory found in the CPU and holds that portion of data which is used
from the main memory. Both registers and cache memory offer high speed data
transfer.
Page 2 of 8
Student notes - CPU Theory
Memory Address Register (MAR) stores the address of the memory location
currently in use. In the fetch phase this would be the address of the instruction being
read and in the execute phase the address of the data being written to the main
memory.
Memory Data Register (MDR) stores the data being transferred to and from the
immediate access store (i.e. the data stored or which is going to be stored at the
address shown in the MAR). It acts as a buffer allowing the central processor and
memory unit to act independently without being affected by minor differences in
operation
Don’t forget that both instructions and data are simply groups of binary digits.
Page 3 of 8
Student notes - CPU Theory
System Buses
There are three basic buses in the computer and are demonstrated in the diagram
below.
Every memory location where data is stored, has its own unique address. Therefore
since the memory has two parts – the address and the data store – we need to have
two separate busses: address bus and data bus.
Once the main memory receives the address of a particular memory location, it
prepares itself to either copies and sends the data of that memory location to the
microprocessor (read process). Or start receiving data from the microprocessor to be
stored or written in the memory location specified by the address received from the
address bus (write process). All this is done via the data bus. Thus the data bus is
a two-way traffic road.
You are probably wondering how the data knows which way to go! This is the
function of the final connection, which forms part of the control bus. This particular
wire carries the signal to tell the memory whether a read or write operation is going to
take place (in practice a ‘1’ signal might mean read and a ‘0’ signal might mean
write).
The Pentium has a 32-bit address bus. Hence it can handle 232 memory locations or
a total of 4GB of memory.
Page 4 of 8
Student notes - CPU Theory
The width of the data bus refers to the ‘WORD LENGTH’ of the CPU, i.e. the
maximum data the CPU can handle at a time.
Example:
Let’s say we have two processors, one is 633MHz and the other is 1.4GHz. How
much time would a 1 CPU cycle take in each processor?
Processor 1: 633MHz
633MHz = 633 million cycles per second = 633 x 106 = 633 000 000
Therefore 1 cycle takes 1/633 000 000 seconds (actual result in micro seconds)
Processor 2: 1.4GHz
1.4GHz = 1 billion and 400 million cycles per second = 1.4 x 109 = 1 400 000 000
Therefore 1 cycle takes 1/1 400 000 000 seconds (actual result in nano seconds)
Obviously the higher the frequency determined by the system clock (in Hz), the faster
the computer can go.
Page 5 of 8
Student notes - CPU Theory
Fetch-Execute Cycle
Further reading: Merlin pg 203, 204
Refers to the process whereby the control unit must first fetch an instruction
from main memory before it can execute (interpret) that instruction
6. GOTO step 2
Page 6 of 8
Student notes - CPU Theory
2. The OPERAND – the value part on which an opcode is working. this part
might not be present in a particular instruction but in the case of an addition
(as an example) the value/s to be added must be supplied as operands
MACHINE CODE is another example of a Low Level Language. It is actually the first
language used to make programs. This type of language contained strictly codes
made from 1’s and 0’s.
Machine Code and Assembly Language are the only two languages considered to
be Low Level Languages. Note also that ultimately ALL languages have to be
converted to Machine code for execution.
Page 7 of 8
Student notes - CPU Theory
Exercise
1. Draw and label a block diagram of CPU and Memory unit, showing clearly the
following items: ALU, Accumulator, Control unit, Program counter, Memory Data
register, Memory Address register, Data bus, Address bus and control bus
2. Explain the terms :
i. instruction set
ii. Opcodes and operands
3. Describe briefly the sequence of steps carried out during the fetch-execute cycle.
In your answer refer to the Program counter, main memory and instruction
register.
4. What do the following letters stand for?
•CPU
•CU
•ALU
5. What is a Bus? Name the 3 types of buses.
6. What are the two types of Main Memory? give their properties
7. What is the difference between Main Memory and Backing Storage.
8. What is the function of the System Clock?
Page 8 of 8