Professional Documents
Culture Documents
CSA - Chapter 1
CSA - Chapter 1
CSA - Chapter 1
Unit 1 Index
1 Functional Unit Pg 2
3 Instruction Format Pg 6
4 Instruction Cycle Pg 11
5 Addressing Mode Pg 18
6 Subroutines Pg 24
7 Types of Buses Pg 29
Hardwired Vs Microprogrammed
9 Pg 36
Control Unit
10 Microinstruction Format Pg 38
List of instructions are called programs & internal storage is called computer
memory.
4. Enterprise systems: - These are used for business data processing in medium
to large corporations that require much more computing power and storage capacity
than work stations. Internet associated with servers have become a dominant
worldwide source of all types of information.
5. Super computers: - These are used for large scale numerical calculations
required in the applications like weather forecasting etc.,
Functional unit: -
A computer consists of five functionally independent main parts input, memory,
arithmetic logic unit (ALU), output and control unit.
Finally the results are sent to the outside world through output device. All of these
actions are coordinated by the control unit.
Input unit: -
Memory unit: -
Its function into store programs and data. It is basically to 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. These are processed in
a group of fixed site called word.
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 in called memory access time. Memory which
is only readable by the user and contents of which can‟t be altered is called read
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.,
Most of the computer operators are executed in ALU of the processor like addition,
subtraction, division, multiplication, etc. the operands are brought into the ALU from
memory and stored in high speed storage elements called register. Then according
to the instructions the operation is performed in the required sequence.
The control and the ALU are may times faster than other devices connected to a
computer system. This enables a single processor to control a number of external
devices such as key boards, displays, magnetic and optical disks, sensors and other
mechanical controllers.
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.
o These instructions are executed to process data which are already loaded in
the computer memory through some input devices.
o After processing the data, the result is either stored in the memory for further
reference, or it is sent to the outside world through some output port.
o The contents of IR are available to the control unit, which generate the timing
signals that control, the various processing elements involved in executing
the instruction.
o The two registers MAR and MDR are used to handle the data transfer between
the main memory and the processor.
o The MAR holds the address of the main memory to or from which data is to
be transferred.
o The MDR contains the data to be written into or read from the addressed
word of the main memory.
o One way is to use the polling routine, and the other way is to use an
interrupt.
o Polling enables the processor software to check each of the input and output
devices frequently. During this check, the processor tests to see if any
devices need servicing or not.
Address field which contain the location of operand, i.e., register or memory
location.
3. Stack organization
Expression: X = (A+B)*(C+D)
PUSH A TOP = A
PUSH C TOP = C
PUSH D TOP = D
Expression: X = (A+B)*(C+D)
AC is accumulator
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
Expression: X = (A+B)*(C+D)
MOV R2, C R2 = C
ADD R2, D R2 = R2 + D
MUL R1, R2 R1 = R1 * R2
MOV X, R1 M[X] = R1
This has three address field to specify a register or a memory location. Program
created are much short in size but number of bits per instruction increase. These
instructions make creation of program much easier but it does not mean that
program will run much faster because now instruction only contain more
information but each micro operation (changing content of register, loading
address in address bus etc.) will be performed in one cycle only.
Expression: X = (A+B)*(C+D)
Instruction Cycles
Registers Involved In Each Instruction Cycle:
The Indirect Cycle is always followed by the Execute Cycle. The Interrupt Cycle is
always followed by the Fetch Cycle. For both fetch and execute cycles, the next cycle
depends on the state of the system.
We assumed a new 2-bit register called Instruction Cycle Code (ICC). The ICC
designates the state of processor in terms of which portion of the cycle it is in:-
At the end of the each cycles, the ICC is set appropriately.The above flowchart
of Instruction Cycle describes the complete sequence of micro-operations, depending
only on the instruction sequence and the interrupt pattern(this is a simplified
example). The operation of the processor is described as the performance of a
sequence of micro-operation.
At the beginning of the fetch cycle, the address of the next instruction to be
executed is in the Program Counter(PC).
Step 1: The address in the program counter is moved to the memory address
register(MAR), as this is the only register which is connected to address lines of
the system bus.
Step 2: The address in MAR is placed on the address bus, now the control unit
issues a READ command on the control bus, and the result appears on the data
bus and is then copied into the memory buffer register(MBR). Program counter is
Thus, a simple Fetch Cycle consist of three steps and four micro-operation.
Symbolically, we can write these sequence of events as follows:-
Here „I‟ is the instruction length. The notations (t1, t2, t3) represents successive
time units. We assume that a clock is available for timing purposes and it emits
regularly spaced clock pulses. Each clock pulse defines a time unit. Thus, all time
units are of equal duration. Each micro-operation can be performed within the
time of a single time unit.
Increment content of PC by I.
Note: Second and third micro-operations both take place during the second time
unit.
Once an instruction is fetched, the next step is to fetch source operands. Source
Operand is being fetched by indirect addressing( it can be fetched by
any addressing mode, here its done by indirect addressing). Register-based
operands need not be fetched. Once the opcode is executed, a similar process
may be needed to store the result in main memory. Following micro-
operations takes place:-
Step 1: The address field of the instruction is transferred to the MAR. This is used
to fetch the address of the operand.
Step 2: The address field of the IR is updated from the MBR.(So that it now
contains a direct addressing rather than indirect addressing)
Step 3: The IR is now in the state, as if indirect addressing has not been
occurred.
Note: Now IR is ready for the execute cycle, but it skips that cycle for a moment
to consider the Interrupt Cycle .
The other three cycles(Fetch, Indirect and Interrupt) are simple and predictable.
Each of them requires simple, small and fixed sequence of micro-operation. In
each case same micro-operation are repeated each time around.
Execute Cycle is different from them. Like, for a machine with N different
opcodes there are N different sequence of micro-operations that can occur.
Lets take an hypothetical example :-
Step 3: Now, the contents of R and MBR are added by the ALU.
At the completion of the Execute Cycle, a test is made to determine whether any
enabled interrupt has occurred or not. If an enabled interrupt has occurred then
Interrupt Cycle occurs. The natare of this cycle varies greatly from one machine
to another. Lets take a sequence of micro-operation:-
Step 2: MAR is loaded with the address at which the contents of the PC are to be
saved.
PC is loaded with the address of the start of the interrupt-processing routine.
The construction of this bus system for 4 registers is shown above. The bus
consists of 4×1 multiplexers with 4 inputs and 1 output and 4 registers with bits
As we can see that when S1S0=00, register A is selected because on 00 the 0 data
inputs of all the multiplexers are applied to the common bus.
Since the 0 data inputs of all the multiplexers receive the inputs from the register
A, thus register A gets selected. Similarly for other combinations of S1S0 other
register are selected.
Note-
No. of multiplexers needed = No. of bits in each register
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.
RISC architecture is based on hardwired control unit
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.
The control signals are represented in the decoded binary format that is 1 bit/CS.
Example: If 53 Control signals are present in the processor than 53 bits are
required. More than 1 control signal can be enabled at a time.
It supports longer control word.
It is used in parallel processing applications.
It allows higher degree of parallelism. If degree is n, n CS are enabled at a time.
It requires no additional hardware(decoders). It means it is faster than Vertical
Microprogrammed.
It is more flexible than vertical microprogrammed
The control signals re represented in the encoded binary format. For N control
signals- Log2(N) bits are required.
It supports shorter control words.
It supports easy implementation of new conrol signals therefore it is more
flexible.
It allows low degree of parallelism i.e., degree of parallelism is either 0 or 1.
Requires an additional hardware (decoders) to generate control signals, it implies
it is slower than horizontal micro programmed.
It is less flexible than horizontal but more flexible than that of hardwired control
unit.
Microinstruction Format
The microinstruction format for the control memory is shown in below figure. The 20
bits of the microinstruction are divided into four functional parts as follows:
1. The three fields F1, F2, and F3 specify micro operations for the computer. The
micro operations are subdivided into three fields of three bits each. The three bits in
each field are encoded to specify seven distinct micro operations. This gives a total
of 21 micro operations.
4. The AD field contains a branch address. The address field is seven bits wide, since
the control memory has 128 = 27 words.
F1 F2 F3 CD BR AD
The nine bits of the micro operation fields will then be 000 100 101.
It is used, in conjunction with the address field AD, to choose the address of the
next microinstruction shown in below Table.