Chapter - 1: Basic Structure of Computers: Computer Types
Chapter - 1: Basic Structure of Computers: Computer Types
Computer types: -
A computer can be defined as a fast electronic calculating machine that accepts the
(data) digitized input information process it as per the list of internally stored instructions and
produces the resulting information.
Functional units: -
A computer consists of five functionally independent main parts input, memory,
arithmetic logic unit (ALU), output and control unit.
Input device accepts the coded information as source program i.e. high level language.
This is either stored in the memory or immediately used by the processor to perform the desired
Finally the results are sent to the outside world through output device. All of these
actions are coordinated by the control unit.
Input unit: -
The source program/high level language program/coded information/simply data is fed
to a computer through input devices. Keyboard is a most common type. Whenever a key is
pressed, corresponding word or number is translated into its equivalent binary code & fed either
to memory or processor.
Memory unit: -
Its function into store programs and data. It is basically of two types
1. Primary memory
2. Secondary memory
1. Primary memory: - Is the one exclusively associated with the processor and operates at the
electronics speeds. Programs must be stored in this memory while they are being executed. The
memory contains a large number of semiconductors storage cells. Each capable of storing one bit
of information.
To provide easy access to a word in memory, a distinct address is associated with each
word location. Addresses are numbers that identify a memory location.
Number of bits in each word is called word length of the computer. Programs must
reside in the memory during execution. Instructions and data can be written into the memory or
read out under the control of processor.
Memory in which any location can be reached in a short and fixed amount of time after
specifying its address is called random-access memory (RAM).
The time required to access one word is called memory access time. Memory which is
only readable by the user and contents of which can’t be altered is called read only memory
(ROM)
Caches are the small fast RAM units, which are coupled with the processor and are often
contained on the same IC chip to achieve high performance.
2. Secondary memory: - Is used where large amounts of data & programs have to be stored,
particularly information that is accessed infrequently.
Examples: - Magnetic disks & tapes, optical disks (ie CD-ROM’s), floppies etc.,
Output unit:-
These actually are the counterparts of input unit. Its basic function is to send the
processed results to the outside world.
Control unit:-
It effectively is the nerve center that sends signals to other units and senses their states.
The actual timing signals that govern the transfer of data between input unit, processor, memory
and output unit are generated by the control unit.
This instruction adds the operand at memory location LOCA, to operand in register R 0 &
places the sum into register. This instruction requires the performance of several steps,
1. First the instruction is fetched from the memory into the processor.
2. The operand at LOCA is fetched and added to the contents of R0
3. Finally the resulting sum is stored in the register R0
Transfers between the memory and the processor are started by sending the address of
the memory location to be accessed to the memory unit and issuing the appropriate control
signals. The data are then transferred to or from the memory.
The fig shows how memory & the processor can be connected. In addition to the ALU &
the control circuitry, the processor contains a number of registers used for several different
purposes.
The instruction register (IR):- Holds the instruction that is currently being executed.
The program counter PC:-
This is another specialized register that keeps track of execution of a program. It contains
the memory address of the next instruction to be fetched and executed.
Besides IR and PC, there are n-general purpose registers R0 through Rn-1.
The other two registers which facilitate communication with memory are: -
1. MAR – (Memory Address Register):- It holds the address of the location to be
accessed.
2. MDR – (Memory Data Register):- It contains the data to be written into or read out of
the addressed location.
An interrupt is a request signal from an I/O device for service by the processor. The
processor provides the requested service by executing an appropriate interrupt service routine.
The Diversion may change the internal stage of the processor its state must be saved in
the memory location before interruption. When the interrupt-routine service is completed the
state of the processor is restored so that the interrupted program may continue.
Bus structure: -
A bus structure provides the simplest and most common way of interconnecting various
parts of the computer.
To achieve a reasonable speed of operation, a computer must be organized so that all its
units can handle one full word of data at a given time.
A group of lines that serve as a connecting port for several devices is called a bus.
In addition to the lines that carry the data, the bus must have lines for address and control
purpose.
Since the bus can be used for only one transfer at a time, only two units can actively use
the bus at any given time. Bus control lines are used to arbitrate multiple requests for use of one
bus.
Low cost
Very flexible for attaching peripheral devices
Multiple bus structure certainly increases, the performance but also increases the cost
significantly.
All the interconnected devices are not of same speed & time, leads to a bit of a problem.
This is solved by using cache registers (ie buffer registers). These buffers are electronic registers
of small capacity when compared to the main memory but of comparable speed.
The instructions from the processor at once are loaded into these buffers and then the
complete transfer of data at a fast rate will take place.
Performance: -
The most important measure of the performance of a computer is how quickly it can
execute programs. The speed with which a computer executes program is affected by the design
of its hardware. For best performance, it is necessary to design the compiles, the machine
instruction set, and the hardware in a coordinated way.
The total time required to execute the program is elapsed time is a measure of the
performance of the entire computer system. It is affected by the speed of the processor, the disk
and the printer. The time needed to execute a instruction is called the processor time.
Just as the elapsed time for the execution of a program depends on all units in a
computer system, the processor time depends on the hardware involved in the execution of
individual machine instructions. This hardware comprises the processor and the memory which
are usually connected by the bus as shown in the fig c.
The pertinent parts of the fig. c is repeated in fig. d which includes the cache memory as
part of the processor unit.
Let us examine the flow of program instructions and data between the memory and the
processor. At the start of execution, all program instructions and the required data are stored in
the main memory. As the execution proceeds, instructions are fetched one by one over the bus
into the processor, and a copy is placed in the cache. Later, if the same instruction or data item is
needed a second time, it is read directly from the cache.
The processor and relatively small cache memory can be fabricated on a single IC chip.
The internal speed of performing the basic steps of instruction processing on chip is very high
and is considerably faster than the speed at which the instruction and data can be fetched from
the main memory. A program will be executed faster if the movement of instructions and data
between the main memory and the processor is minimized, which is achieved by using the cache.
Processor clock: -
Processor circuits are controlled by a timing signal called clock. The clock defines the
regular time intervals called clock cycles. To execute a machine instruction the processor divides
the action to be performed into a sequence of basic steps such that each step can be completed in
one clock cycle. The length P of one clock cycle is an important parameter that affects the
processor performance. Its inverse is the clock rate, R = 1/P, which is measured in cycles per
second.
Processor used in today’s personal computer and work station have a clock rates that
range from a few hundred million to over a billion cycles per second.
Suppose that the average number of basic steps needed to execute one machine cycle
instruction is S, where each basic step is completed in one clock cycle. If clock rate is ‘R’ cycles
per second, the program execution time is given by
N ×S
T=
R
this is often referred to as the basic performance equation.
We must emphasize that N, S & R are not independent parameters changing one may
affect another. Introducing a new feature in the design of a processor will lead to improved
performance only if the overall result is to reduce the value of T.
Consider Add R1 R2 R3
This adds the contents of R1 & R2 and places the sum into R3.
The contents of R1 & R2 are first transferred to the inputs of ALU. After the addition
operation is performed, the sum is transferred to R 3. The processor can read the next instruction
from the memory, while the addition operation is being performed. Then of that instruction also
uses, the ALU, its operand can be transferred to the ALU inputs at the same time that the add
instructions is being transferred to R3.
In the ideal case if all instructions are overlapped to the maximum degree possible the
execution proceeds at the rate of one instruction completed in each clock cycle. Individual
instructions still require several clock cycles to complete. But for the purpose of computing T,
effective value of S is 1.
Clock rate:- These are two possibilities for increasing the clock rate ‘R’.
1. Improving the IC technology makes logical circuit faster, which reduces the time of
execution of basic steps. This allows the clock period P, to be reduced and the clock rate
R to be increased.
2. Reducing the amount of processing done in one basic step also makes it possible to
reduce the clock period P. however if the actions that have to be performed by an
instructions remain the same, the number of basic steps needed may increase.
Increase in the value ‘R’ that are entirely caused by improvements in IC technology
affects all aspects of the processor’s operation equally with the exception of the time it takes to
access the main memory. In the presence of cache the percentage of accesses to the main
memory is small. Hence much of the performance gain excepted from the use of faster
technology can be realized.
Performance measurements:-
It is very important to be able to access the performance of a computer, comp designers
use performance estimates to evaluate the effectiveness of new features.
The previous argument suggests that the performance of a computer is given by the
execution time T, for the program of interest.
Inspite of the performance equation being so simple, the evaluation of ‘T’ is highly
complex. Moreover the parameters like the clock speed and various architectural features are not
reliable indicators of the expected performance.
The performance measure is the time taken by the computer to execute a given bench
mark. Initially some attempts were made to create artificial programs that could be used as bench
The program selected range from game playing, compiler, and data base applications to
numerically intensive programs in astrophysics and quantum chemistry. In each case, the
program is compiled under test, and the running time on a real computer is measured. The same
program is also compiled and run on one computer selected as reference.
The ‘SPEC’ rating is computed as follows.
Means that the computer under test is 50 times as fast as the ultra sparc 10. This is
repeated for all the programs in the SPEC suit, and the geometric mean of the result is computed.
Let SPECi be the rating for program ‘i’ in the suite. The overall SPEC rating for the
computer is given by
n 1
Since actual execution time is measured the SPEC rating is a measure of the combined
effect of all factors affecting performance, including the compiler, the OS, the processor, the
memory of comp being tested.