Sunteți pe pagina 1din 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 (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

Processors are differentiated by :1.

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 CISC or RISC.
CISC complex instruction set computer : the instructions are complex i.e. a
single instruction results in several operations being done by the processor e.g.
MULT load the data into the register from memory, multiply them and place the
result back into the appropriate register. This is at least three steps but it is
accomplished by one instruction known to the processor. CISC computers use less
memory space and are slower to execute, but they can carryout more complex
operations without the intervention of software.
RISC reduced instruction set : this is a newer approach in which every
instruction is a simple one step operation. A RISC processor would not recognize
MULT. It is more likely to have LOAD, PROD, and STORE which is used to
perform the same multiplication. The set of instructions is therefore simpler,
barer, more basic. RISC processors are faster but memory gets filled up easier.
The operating system has a heavier workload in a RISC machine.

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

Input/output these include


o Data transfer operations such as move, load, store
Moving data from memory to secondary storage
Moving data between registers or from register to memory

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)

zero address instructions : the entire machine code is the


operation/instruction. This is possible with instructions such as
CLC clear
RTS return
ASL shift left one bit
They require no additional information.
Most machine code instructions have the two basic parts (at least) however. There
are several schemes of addressing called

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)

immediate addressing in immediate addressing the operand is not an


address, it is the actual data to be used.
0

This could therefore mean add 000000101000 to the contents of the


accumulator
c)

direct addressing in direct addressing, the operand is the address in


memory where the data to be used is located. This means that one or more
extra access of memory is required before the operation can be completed.
0

This could therefore mean add whatever is stored in memory location


000000101000 to the contents of the accumulator
d)

indirect addressing in indirect addressing the operand is the address of


the location where the address of the data can be found. Ram will first have
to be accessed at that address to pick up the address of the data; then the
data location is found and that data is read into the processor.
0

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

All of this of course assumes fixed length addressing.


Some processors use variable length addressing. That means that the number of bits
used for the operation code vs the operand can vary from instruction to instruction.
Well leave the details for our first year university computer science course.

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

Other Important Processor Concepts


Cache memory The processor is the fastest element in a computer system. Often it is
idly waiting on data or instructions. Cache is one way to provide ready access to data for
the processor. By locating it near to or inside the processor and storing the most
frequently used pieces of data in it, the processors wait time is reduced

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.

Microprocessors (and motherboards ) also have buses.


A bus is a set of parallel connectors inside the computer along which electronic signal
can flow. Buses transmit data, programs and control information between devices. Buses
can be classified as internal or external.
Internal buses are found inside a component e.g there are buses inside the CPU
connecting its various parts.
External buses connect different motherboard components and also external devices to
the motherboard. Every port has a bus behind it. This is how peripherals communicate
with the motherboard/CPU. There are also buses between RAM and the CPU; the hard
disk controller and RAM, etc.
Buses can be parallel or serial and they are not necessarily point to point, they can form a
network on the motherboard. The bus size should correspond to the word size so that bus
sizes can be 16 bit, 32 bit, 64 bit or 128 bit in width.

Y. C. Lemard

Buses are dedicated to one kind of task. Microprocessors have


an address bus : sends addresses to and from memory
a data bus : sends data to and form memory
a control bus : carries control information from the control unit to and
from other devices

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

S-ar putea să vă placă și