Computer System Architecture
Computer System Architecture
Computer Architecture refers to those attributes of a system that have a direct impact on
the logical execution of a program. Examples:
o the instruction set
o the number of bits used to represent various data types
o I/O mechanisms
o memory addressing techniques
Computer Organization refers to the operational units and their interconnections that
realize the architectural specifications. Examples are things that are transparent to the
programmer:
o control signals
o interfaces between computer and peripherals
o the memory technology being used
So, for example, the fact that a multiply instruction is available is a computer architecture
issue. How that multiply is implemented is a computer organization issue.
o Data processing: Computer must be able to process data which may take a wide
variety of forms and the range of processing.
o Data storage: Computer stores data either temporarily or permanently.
o Data movement: Computer must be able to move data between itself and the
outside world.
o Control: There must be a control of the above three functions.
Fig: Functional view of a computer
Peripherals
Computer
Central
Computer Main
Processing
Memory
Unit
Systems
Interconnection
Communication lines
Fig: Computer: Top level structure Input
Output
CPU
Arithmetic
Computer
Registers and
I/O
System
CPU
Login Unit
Bus Internal CPU
Memory
Interconnection
Control unit
CPU
Sequencing
ALU
Decoders
Control
COMPUTER COMPONENTS
• The Control Unit (CU) and the Arithmetic and Logic Unit (ALU) constitute the Central
Processing Unit (CPU)
• Data and instructions need to get into the system and results need to get out
o Input/output (I/O module)
• Temporary storage of code and results is needed
o Main memory (RAM)
• Program Concept
o Hardwired systems are inflexible
o General purpose hardware can do different tasks, given correct control signals
o Instead of re-wiring, supply a new set of control signals
COMPUTER FUNCTION
The basic function performed by a computer is execution of a program, which consists of a set of
instructions stored in memory.
• Two steps of Instructions Cycle:
o Fetch
o Execute
• Execute Cycle
o Processor interprets instruction and performs required actions, such as:
Processor - memory
o data transfer between CPU and main memory
Processor - I/O
o Data transfer between CPU and I/O module
Data processing
o Some arithmetic or logical operation on data
Control
o Alteration of sequence of operations
o e.g. jump
Combination of above
Fig: Example of program execution (consists of memory and registers in hexadecimal)
• The PC contains 300, the address of the first instruction. The instruction (the value 1940
in hex) is loaded into IR and PC is incremented. This process involves the use of MAR
and MBR.
• The first hexadecimal digit in IR indicates that the AC is to be loaded. The remaining
three hexadecimal digits specify the address (940) from which data are to be loaded.
• The next instruction (5941) is fetched from location 301 and PC is incremented.
• The old contents of AC and the contents of location 941 are added and the result is stored
in the AC.
• The next instruction (2941) is fetched from location 302 and the PC is incremented.
• The contents of the AC are stored in location 941.
BUS INTERCONNECTION
• A bus is a communication pathway connecting two or more devices
• Usually broadcast (all components see signal)
• Often grouped
o A number of channels in one bus
o e.g. 32 bit data bus is 32 separate single bit channels
• Power lines may not be shown
• There are a number of possible interconnection systems
• Single and multiple BUS structures are most common
• e.g. Control/Address/Data bus (PC)
• e.g. Unibus (DEC-PDP)
• Lots of devices on one bus leads to:
o Propagation delays
o Long data paths mean that co-ordination of bus use can adversely affect
performance
o If aggregate data transfer approaches bus capacity
• Most systems use multiple buses to overcome these problems
• Data Bus
o Carries data
Remember
that there is no difference between “data” and “instruction” at this
level
o Width is a key determinant of performance
8, 16, 32, 64 bit
• Address Bus
o Identify the source or destination of data
o e.g. CPU needs to read an instruction (data) from a given location in memory
p Bus width determines maximum memory capacity of system
e.g. 8080 has 16 bit address bus giving 64k address space
• Control Bus
q Control and timing information
Memory read
Memory write
I/O read
I/O write
Transfer ACK
Bus request
Bus grant
Interrupt request
Interrupt ACK
Clock
Reset
PCI
PCI is a popular high bandwidth, processor independent bus that can function as mezzanine
or peripheral bus.
PCI delivers better system performance for high speed I/O subsystems (graphic display
adapters, network interface controllers, disk controllers etc.)
PCI is designed to support a variety of microprocessor based configurations including both
single and multiple processor system.
It makes use of synchronous timing and centralised arbitration scheme.
PCI may be configured as a 32 or 64-bit bus.
Current Standard
o up to 64 data lines at 33Mhz
o requires few chips to implement
o supports other buses attached to PCI bus
o public domain, initially developed by Intel to support Pentium-based systems
o supports a variety of microprocessor-based configurations, including multiple
processors
o uses synchronous timing and centralized arbitration
Note: Bridge acts as a data buffer so that the speed of the PCI bus may differ from that of the processor’s
I/O capability.
These registers are the top of the memory hierarchy, and are the fastest way for the system to manipulate
data. In a very simple microprocessor, it consists of a single memory location, usually called
an accumulator. Registers are built from fast multi-ported memory cell. They must be able to drive its
data onto an internal bus in a single clock cycle. The result of ALU operation is stored here and could be
re-used in a subsequent operation or saved into memory.
Registers are normally measured by the number of bits they can hold, for example, an “8-bit register” or a
“32-bit register”. Registers are now usually implemented as a register file, but they have also been
implemented using individual flip-flops, high speed core memory, thin film memory, and other ways in
various machines.
The term is often used to refer only to the group of registers that can be directly indexed for input or
output of an instruction, as defined by the instruction set. More properly, these are called the “architected
registers“. For instance, the x86 instruction set defines a set of eight 32-bit registers, but a CPU that
implements the X86 instruction set will contain many more hardware registers than just these eight.
(a) Accumulator: It is most frequently used register used to store data taken from memory. Its number
varies from microprocessor to microprocessor.
(b) General Purpose registers: General purpose registers are used to store data and intermediate results
during program execution. Its contents can be accessed through assembly programming.
(c) Special purpose Registers: Users do not access these registers. These are used by computer system at
the time of program execution. Some types of special purpose registers are given below:
Memory Address Register (MAR): It stores address of data or instructions to be fetched from
memory.
Memory Buffer Register (MBR): It stores instruction and data received from the memory and
sent from the memory.
Instruction Register (IR): Instructions are stored in instruction register. When one instruction is
completed, next instruction is fetched in memory for processing.
Program Counter (PC): It counts instructions.
The instruction cycle is completed into two phases:
There are two parts in instruction- opcode and operand. In fetch cycle opcode of instruction is fetched
into CPU. The opcode, at first, is reached to Data Register (DR), then to Instruction Register (IR).
Decoder accesses the opcode and it decodes opcode and type of operation is declared to CPU and
execution cycle is started.
INSTRUCTION FORMATS
The computer can be used to perform a specific task, only by specifying the necessary steps to complete
the task. The collection of such ordered steps forms a ‘program’ of a computer. These ordered steps are
the instructions. Computer instructions are stored in central memory locations and are executed
sequentially one at a time. The control reads an instruction from a specific address in memory and
executes it. It then continues by reading the next instruction in sequence and executes it until the
completion of the program. A computer usually has a variety of Instruction Code Formats. It is the
function of the control unit within the CPU to interpret each instruction code and provide the necessary
control functions needed to process the instruction. An n bit instruction that k bits in the address field and
m bits in the operation code field come addressed 2k location directly and specify 2m different operation
The bits of the instruction are divided into groups called fields.
The most common fields in instruction formats are:
o An Operation code field that specifies the operation to be performed.
o An Address field that designates a memory address or a processor register.
o A Mode field that specifies the way the operand or the effective address is determined.
Types of Instruction
Computers may have instructions of several different lengths containing varying
number of addresses.
The number of address fields in the instruction format of a computer depends on
the internal organization of its registers.
Most computers fall into one of 3 types of CPU organizations:
General register organization:- The instruction format in this type of computer needs
three register address fields. For example: ADD R1,R2,R3
Computers may have instructions of several different lengths containing varying number of
addresses. Following are the types of instructions.
1. Three address Instruction
With this type of instruction, each instruction specifies two operand location and a result
location. A temporary location T is used to store some intermediate result so as not to
alter any of the operand location. The three address instruction format requires a very
complex design to hold the three address references.
Format: Op X, Y, Z; X Y Op Z
Example: ADD X, Y, Z; X Y + Z
ADVANTAGE: It results in short programs when evaluating arithmetic
expressions.
DISADVANTAGE: The instructions requires too many bits to specify 3
addresses.
Example: To illustrate the influence of the number of address on computer programs, we will
evaluate the arithmetic statement X=(A+B)*(C+D) using Zero, one, two, or three address
instructions.
1. Three-Address Instructions:
ADD R1, A, B; R1 M[A] + M[B]
ADD R2, C, D; R2 M[C] + M[D]
MUL X, R1,R2; M[X] R1 * R2
It is assumed that the computer has two processor registers R1 and R2. The symbol M[A]
denotes the operand at memory address symbolized by A.
2. Two-Address Instructions:
MOV R1, A; R1 M[A]
ADD R1, B; R1 R1 + M[B]
3. One-Address Instruction:
LOAD A; Ac M[A]
ADD B; Ac Ac + M[B]
STORE T; M[T] Ac
LOAD C; Ac M[C]
ADD D; Ac Ac + M[D]
MUL T; Ac Ac * M[T]
STORE X; M[X] Ac
Here, T is the temporary memory location required for storing the intermediate result.
4. Zero-Address Instructions:
PUSH A; TOS A
PUSH B; TOS B
ADD; TOS (A + B)
PUSH C; TOS C
PUSH D; TOS D
ADD; TOS (C + D)
MUL; TOS (C + D) * (A + B)
POP X ; M[X] TOS
ADDRESSING MODES
Specifies a rule for interpreting or modifying the address field of the instruction before
the operand is actually referenced.
Computers use addressing mode techniques for the purpose of accommodating the
following purposes:-
o To give programming versatility to the user by providing such facilities as
pointers to memory, counters for loop control, indexing of data and various other
purposes.
o To reduce the number of bits in the addressing field of the instructions.
Other computers use a single binary for operation & Address mode.
The mode field is used to locate the operand.
Address field may designate a memory address or a processor register.
There are 2 modes that need no address field at all (Implied & immediate
modes).
Instruction
Opcode Register Register
Operand
Operand
Operand
Operand
Register Memory
+ Operand
Implicit
Top of Stack
Data transfer instructions cause transfer of data from one location to another without changing
the binary information. The most common transfer are between the
Memory and Processor registers
Processor registers and input output devices
Processor registers themselves
Arithmetic Instructions
LOGICAL AND BIT MANIPULATION INSTRUCTIONS
SHIFT INSTRUCTIONS
The trend into computer hardware complexity was influenced by various factors:
o Upgrading existing models to provide more customer applications
o Adding instructions that facilitate the translation from high-level language
into machine language programs
o Striving to develop machines that move functions from software
implementation into hardware implementation
A computer with a large number of instructions is classified as a complex
instruction set computer (CISC).
One reason for the trend to provide a complex instruction set is the desire to
simplify the compilation and improve the overall computer performance.
A computer uses fewer instructions with simple constructs so they can be executed much
faster within the CPU without having to use memory as often. It is classified as a reduced
instruction set computer (RISC).
RISC concept – an attempt to reduce the execution cycle by simplifying the
instruction set
Small set of instructions – mostly register to register operations and simple
load/store operations for memory access
Each operand – brought into register using load instruction, computations are
done among data in registers and results transferred to memory using store
instruction
Simplify instruction set and encourages the optimization of register
manipulation
May include immediate operands, relative mode etc.
CONTROL UNIT
To execute an instruction, the control unit of the CPU must generate the required control signal in the
proper sequence. There are two approaches used for generating the control signals in proper sequence as
Hardwired Control unit and Micro-programmed control unit.
The control hardware can be viewed as a state machine that changes from one state to another in every
clock cycle, depending on the contents of the instruction register, the condition codes and the external
inputs. The outputs of the state machine are the control signals. The sequence of the operation carried out
by this machine is determined by the wiring of the logic elements and hence named as “hardwired”.
Fixed logic circuits that correspond directly to the Boolean expressions are used to generate the
control signals.
Hardwired control is faster than micro-programmed control.
A controller that uses this approach can operate at high speed.
The control signals associated with operations are stored in special memory units inaccessible by
the programmer as Control Words.
Control signals are generated by a program are similar to machine language programs.
Micro-programmed control unit is slower in speed because of the time it takes to fetch
microinstructions from the control memory.
1.Control Word : A control word is a word whose individual bits represent various control signals.
2.Micro-routine : A sequence of control words corresponding to the control sequence of a machine
instruction constitutes the micro-routine for that instruction.
3.Micro-instruction : Individual control words in this micro-routine are referred to as microinstructions.
4.Micro-program : A sequence of micro-instructions is called a micro-program, which is stored in a
ROM or RAM called a Control Memory (CM).
5.Control Store : the micro-routines for all instructions in the instruction set of a computer are stored in a
special memory called the Control Store.
TYPES OF MICRO-PROGRAMMED CONTROL UNIT –
Based on the type of Control Word stored in the Control Memory (CM), it is classified into two types :
MICROPROGRAMMED CONTROL
Hardwired Control Microprogrammed Control
Technology is circuit based. Technology is software based.
It is implemented through flip-flops, Microinstructions generate signals to control the
gates, decoders etc. execution of instructions.
Fixed instruction format. Variable instruction format (16-64 bits per instruction).
Instructions are register based. Instructions are not register based.
ROM is not used. ROM is used.
It is used in RISC. It is used in CISC.
Faster decoding. Slower decoding.
Difficult to modify. Easily modified.
Chip area is less. Chip area is large.