Professional Documents
Culture Documents
Lemard
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 (very tiny processor) and this accounts for their name. Microprocessors
can also be found in electronic devices/machines such as fuel injection systems for
automobiles, aeroplanes and even microwaves.
The first microprocessor was the Intel 4004, introduced in 1971. The 4004 as not very
powerful all it could do was add and subtract 4 bits at a time.
The first microprocessor to make a real splash in the market was the Intel 8088,
introduced in 1979 and incorporated into the IBM PC (which came out around 1982
the first pc).
We then had the 80286, then the 80386 then the 80486. The naming then changed to the
Pentium, Pentium II, Pentium III and Pentium 4 and the Celeron. Also Xeon and
Itanium(used in servers mostly). All of these processors were made by Intel who have
now introduced a Dual Core and a Quad Core processor in their line of processors.
In the meantime they now have competition in the form of another major company
manufacturing processor- AMD. AMD calls its chips Athlon and Duron. AMDs chips
are cheaper than Intels. (Also Cyrix and IBM)
The microprocessor is what determines the generation of the computer.
Microprocessors are put onto a special socket on the motherboard but they are not
interchangeable, so an Intel chip can not be replaced by an AMD chip unless the
motherboard itself is also changed.
1
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. In fact the processor is really the compute-er as it is the unit
that interprets and carries out the instructions that operate a computer. Because of its
importance we are going to spend some time getting to know more about it.
It has several subunits but we are concerned principally with the
Control unit
Arithmetic logic unit and
Registers
Components
Control Unit
- Sequentially accesses and decodes program instructions
- Coordinates the flow of data in and out of the ALU, registers, RAM, storage and
input and output devices.
Arithmetic/Logic Unit
- performs mathematical operations
- makes logical comparisons
- stores current data / results
Registers - a small number of very high speed special-purpose 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. So the register is the storage unit inside the processor. The
register is where the data is actually stored while it is being processed.
Registers are specialized to just one task i.e. a particular register stores just one piece of
data. Examples of registers :
Memory data register MDR stores the current piece of data
Memory address register MAR stores the address of the place of memory
to look for the next item of data needed
Instruction register / program counter PC stores the current statement in the
program being executed.
Accumulator - stores the results of calculations (in the ALU)
2
Y. C. Lemard
2.
instruction types
There are generally three types of instructions :
- Data manipulation these include
o Arithmetic operations such as add, subtract, multiply, divide, increment
and decrement
o Logical operations such as AND, OR, NOT and X-OR
o Compare, shift
- Control these include
o Testing and branching
Conditional JUMP IF, loops
Unconditional JUMP - subroutine calls, returns
Y. C. Lemard
3. Instruction format
Every computer program has to be translated to machine language before it can be
executed. Each statement in this program is called a machine code instruction.
Instructions have 2 main parts :
- the operation code (the function that is to be done)
- the operand (consists of the address or the data to be operated on)
The operation code tells the control unit what to do with the rest of the data.
The exact format of the statements in the machine language version (object code)
of the program will vary depending on the type of processor which will carry out
the instruction.
E.g. of a machine code instruction
0
Lets suppose that in this processor of the 16 bits the op-code is the first 4 bits and
the rest of the instruction is the operand.
An instruction may be configured in one of several ways :
a)
Y. C. Lemard
Addressing modes
Note that while our discussion below relate to a one address machine 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 exhaustive.
b)
0 1
Y. C. Lemard
This could mean go to 000000101000 and there you will find the address
of the data that is to be added to the contents of the accumulator
indexed addressing in index addressing the required 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.
e)
0 1
Address register
In this case the operand 000000101000 is to be added to 000001000110 in
order to obtain the address of the actual data to be used
Some books may also mention register addressing. In this mode the the operand is
the name of the register that holds the data
Note that one single machine may use more than one addressing mode. In such cases
a mechanism is needed to indicate to the processor for each instruction how it should
be interpreted. One way is to use one or more bits in the instruction code to indicate
the addressing mode
Y. C. Lemard
The instruction size the number of bits or bytes in one instruction for a particular
machine. This is naturally related to the word size of the processor. Recall that the
word size is the number of bits that the processor can handle at one time. This in turn
is the size of each memory location in RAM. The instruction size therefore can be in
multiples of words.
The address range of an instruction is the range of possible memory locations which
may be specified in the instruction, usually stated as 0 to 2 power of the number of
bits used for the memory address.
Questions :
1.
A microprocessor has 8 bit function codes (operators) and 8 bit addresses. How
many different instructions can it handle and how many addresses can be directly
addressed?
The number of operators range from 00000000 to 11111111 => 28 => 256
The number of addresses range from 00000000 to 11111111 => 28 => 256
2.
A microprocessor has 4 bit function codes (operators) and 12 bit addresses. How
many different instructions can it handle and how many addresses can be directly
addressed?
The number of operators range from 0000 to 1111 => 24 => 16
The number of addresses range from 000000000000 to 111111111111
=> 212 => 4096
Y. C. Lemard
3.
A microprocessor has 12 bit function codes (operators) and 4 bit addresses. How
many different instructions can it handle and how many addresses can be directly
addressed?
The number of operators range from 000000000000 to 111111111111
=> 212 => 4096
The number of addresses range from 0000 to 1111 => 24
4.
5.
=> 16
Using the examples above justify the need for the indirect addressing mode/scheme
Research and know the name and purpose of at least 6 CPU registers
Y. C. Lemard
The clock - is a simple electronic mechanism inside the processor which regularly
produces a pulse of electricity used to synchronize operations in the processor.
The clock speed is the number of pulses generated per second. It is measured in MHz or
GHZ and is one feature of a processor to be aware of when buying a machine.
Generally the performance of a processor is determined by the clock speed, the
bandwidth and the size of the data bus. A larger clock speed should in theory result in a
faster machine.
Older machines have clock speeds in the region of 50MHz, 300MHz, 500MHz
Newer values 1400MHz, 2400MHz, 2800MHz, 3200MHz i.e. GHz
The clock pulse is like the heart beat of the processor.
Y. C. Lemard
10
Y. C. Lemard
In indirect addressing, the size of the address becomes an entire word instead of just a
part of a word. Because the address is stored in one slot in memory, its size range from 0
to word-size. If it is 116 bits it will now be 216 => 65,535
11