Download - 08 - The Processor - Students Version
-
7/24/2019 08 - The Processor - Students Version
1/11
Y. C. Lemard
COMPUTER SCIENCE - UNIT ONE
MODULE 1 - COMPUTER ORGANISATION
THE PROCESSOR
The processor or central processing unit(CPU) is a silicon chip containing the electronic
circuits capable of executing instructions. Microcomputers typically contain one
microprocessor (ery tiny processor) and this accounts for their name. Microprocessors
can also be found in electronic deices!machines such as fuel in"ection systems for
automobiles# aeroplanes and een micro$aes.
The first microprocessor $as the %ntel &'' introduced in *. The &''& as not ery
po$erful + all it could do $as add and subtract & bits at a time.
The first microprocessor to ma,e a real splash in the mar,et $as the %ntel -'--#
introduced in * and incorporated into the %M PC ($hich came out around -/ +
the first pc).
0e then had the -'/-1# then the -'2-1 then the -'&-1. The naming then changed to the
Pentium# Pentium %%# Pentium %%% and Pentium & and the Celeron. 3lso 4eon and
%tanium(used in serers mostly). 3ll of these processors $ere made by %ntel $ho hae
no$ introduced a 5ual Core and a 6uad Core processor in their line of processors.
%n the meantime they no$ hae competition in the form of another ma"or company
manufacturing processor7 3M5. 3M5 calls its chips 3thlon and 5uron. 3M58s chips
are cheaper than %ntel8s. (3lso Cyrix and %M)
The microprocessor is $hat determines the generation of the computer.
Microprocessors are put onto a special soc,et on the motherboard but they are not
interchangeable# so an %ntel chip can not be replaced by an 3M5 chip unless the
motherboard itself is also changed.
-
7/24/2019 08 - The Processor - Students Version
2/11
Y. C. Lemard
The processor is regarded as the brain of the computer as it is the part of the computer
that executes the programs. %n fact the processor is really the compute7er as it is the unit
that interprets and carries out the instructions that operate a computer. ecause of its
importance $e are going to spend some time getting to ,no$ more about it.
%t has seeral subunits but $e are concerned principally $ith the
Control unit
3rithmetic logic unit and
9egisters
Components
Control Unit
7 :e;uentially accesses and decodes program instructions
7 Coordinates the flo$ of data in and out of the 3LU# registers# 93M# storage and
input and output deices.
3rithmetic!Logic Unit
7 performs mathematical operations
7 ma,es logical comparisons
7 stores current data ! results
7
9egisters 7 a small number of ery high speed special7purpose memory units found in
the CPU capable of temporarily storing a single piece of data!instruction!address. The
register holds one unit of program instruction or data# immediately before or during
processing by the CPU. :o the register is the storage unit inside the processor. The
register is $here the data is actually stored $hile it is being processed.
9egisters are specialiMemory data register M59 + stores the current piece of data
Memory address register M39 + stores the address of the place of memory
to loo, for the next item of data needed
%nstruction register ! program counter PC + stores the current statement in the
program being executed.
3ccumulator 7 stores the results of calculations (in the 3LU)
/
-
7/24/2019 08 - The Processor - Students Version
3/11
Y. C. Lemard
Processors are differentiated by >7
. their instruction set> the set of basic instructions that a particular
microprocessor can understand and execute. These are predetermined by and built
in by the manufacturer of the chip and cannot be changed.
Processors can be C%:C or 9%:C.
CISC+ complex instruction set computer > the instructions are complex i.e. a
single instruction results in seeral operations being done by the processor e.g.
MULT + load the data into the register from memory# multiply them and place the
result bac, into the appropriate register. This is at least three steps but it is
accomplished by one instruction ,no$n to the processor. C%:C computers use lessmemory space and are slo$er to execute# but they can carryout more complex
operations $ithout the interention of soft$are.
RISC+ reduced instruction set > this is a ne$er approach in $hich eery
instruction is a simple one step operation. 3 9%:C processor $ould not recogni
7 5ata manipulation + these include
o 3rithmetic operations such as add# subtract# multiply# diide# increment
and decrement
o Logical operations such as 3@5# ?9# @?T and 47?9o Compare# shift
7 Control + these include
o Testing and branching
Conditional AUMP + %B# loops
Unconditional AUMP 7 subroutine calls# returns
2
-
7/24/2019 08 - The Processor - Students Version
4/11
Y. C. Lemard
7 %nput!output + these include
o 5ata transfer operations such as moe# load# store
Moing data from memory to secondary storage
Moing data bet$een registers or from register to memory
! Instruction "or#$t
=ery computer program has to be translated to machine language before it can be
executed. =ach statement in this program is called a machine code instruction.
%nstructions hae / main parts >
7 the operation code (the function that is to be done)
7 the operand (consists of the address or the data to be operated on)
The operation code tells the control unit $hat to do $ith the rest of the data8.
The exact format of the statements in the machine language ersion (ob"ect code)
of the program $ill ary depending on the type of processor $hich $ill carry out
the instruction.
=.g. of a machine code instruction
Lets8 suppose that in this processor of the 1 bits the op7code is the first & bits and
the rest of the instruction is the operand.
3n instruction may be configured in one of seeral $ays >
a) the entire machine code is the
operation!instruction. This is possible $ith instructions such as
CLC + clear
9T: + return3:L + shift left one bit
They re;uire no additional information.
Most machine code instructions hae the t$o basic parts (at least) ho$eer. There
are seeral schemes of addressing called +
' ' ' ' ' ' ' ' ' ' ' '
&
-
7/24/2019 08 - The Processor - Students Version
5/11
Y. C. Lemard
A%%ressin& #o%es
Note that while our discussion below relate to a one addressmachine code (if the
operation needs a second operand it can be found in the accumulator); lots of
operators require 2 operands. The instruction code can therefore be a two-address
instruction in which the operand specifies where both pieces of data can be found so
that the operand is really two addresses. In this schema one address is usually in
memory and the other a register. The following list is far from exhaustie.
b) i##e%i$te $%%ressin&+ in immediate addressing the operand is not an
address# it is the actual data to be used.
This could therefore mean add '''''''''' to the contents of the
accumulator
c) %irect $%%ressin&+ in direct addressing# the operand is the address in
memory $here the data to be used is located. This means that one or more
extra access of memory is re;uired before the operation can be completed.
This could therefore mean add $hateer is stored in memory location
'''''''''' to the contents of the accumulator
d) in%irect $%%ressin&+ in indirect addressing the operand is the address of
the location $here the address of the data can be found. 9am $ill first haeto be accessed at that address to pic, up the address of the dataD then the
data location is found and that data is read into the processor.
' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' '
E
-
7/24/2019 08 - The Processor - Students Version
6/11
Y. C. Lemard
This could mean go to '''''''''' and there you $ill find the address
of the data that is to be added to the contents of the accumulator
e) in%e'e% $%%ressin&+ in index addressing the re;uired address is found by
adding the operand to the contents of a special address register or index
register. The operand is therefore regarded as an offset from that base
address. This method is actually used to process arrays.
3ddress register
%n this case the operand '''''''''' is to be added to ''''''''' in
order to obtain the address of the actual data to be used
!ome boo"s may also mention register addressing. In this mode the the operand is
the name of the register that holds the data
3ll of this of course assumes "i'e% (en&th $%%ressin&.
:ome processors use )$ri$*(e (en&th $%%ressin&. That means that the number of bits
used for the operation code s the operand can ary from instruction to instruction.
0e8ll leae the details for our first year uniersity computer science course.
@ote that one single machine may use more than one addressing mode. %n such cases
a mechanism is needed to indicate to the processor for each instruction ho$ it should
be interpreted. ?ne $ay is to use one or more bits in the instruction code to indicatethe addressing mode
' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' '
1
-
7/24/2019 08 - The Processor - Students Version
7/11
Y. C. Lemard
The instruction si#e+ the number of bits or bytes in one instruction for a particular
machine. This is naturally related to the $ord si
-
7/24/2019 08 - The Processor - Students Version
8/11
Y. C. Lemard
2. 3 microprocessor has / bit function codes (operators) and & bit addresses. Fo$
many different instructions can it handle and ho$ many addresses can be directly
addressedG
The number of operators range from '''''''''''' to
HI // HI &'1
The number of addresses range from '''' to HI /& HI 1
&. Using the examples aboe "ustify the need for the indirect addressing mode!scheme
E. 9esearch and ,no$ the name and purpose of at least 1 CPU registers
-
-
7/24/2019 08 - The Processor - Students Version
9/11
Y. C. Lemard
?ther %mportant Processor Concepts
C$che #e#ory+ The processor is the fastest element in a computer system. ?ften it is
idly $aiting on data or instructions. Cache is one $ay to proide ready access to data for
the processor. y locating it near to or inside the processor and storing the most
fre;uently used pieces of data in it# the processor8s $ait time is reduced
The c(oc7 is a simple electronic mechanism inside the processor $hich regularly
produces a pulse of electricity used to synchroni
-
7/24/2019 08 - The Processor - Students Version
10/11
Y. C. Lemard
uses are dedicated to one ,ind of tas,. Microprocessors hae
7 an address bus > sends addresses to and from memory
7 a data bus > sends data to and form memory
7 a control bus > carries control information from the control unit to and
from other deices
'
-
7/24/2019 08 - The Processor - Students Version
11/11
Y. C. Lemard
%n indirect addressing# the si