Co Unit-2
Co Unit-2
SC [SEM-3]
UNIT-2
CPU and Micro Programmed Control: Central Processing unit: Introduction, instruction
formats, addressing modes. Control memory, address sequencing, design of control unit -
hard wired control, micro programmed control.
Contents
Control memory
Address Sequencing
Micro program Example
Design of Control Unit
Introduction:
The function of the control unit in a digital computer is to initiate sequence of
microoperations.
When the control signals are generated by hardware using conventional logic design
techniques, the control unit is said to be hardwired.
The key characteristics are
o High speed of operation
o Expensive
o Relatively complex
o No flexibility of adding new instructions
Examples of CPU with hardwired control unit are Intel 8085, Motorola 6802, Zilog 80, and
Microprogrammed Control:
operations.
Examples of CPU with micro programmed control unit are Intel 8080, Motorola
9
Downloaded by Mohan Computers world ([email protected])
lOMoARcPSD|47907492
1. Control Memory:
2. Address Sequencing:
Microinstructions are stored in control memory in groups, with each group specifying a
routine.
Each computer instruction has its own microprogram routine to generate the
microoperations.
The hardware that controls the address sequencing of the control memory must be
capable of sequencing the microinstructions within a routine and be able to branch from
one routine to another
Steps the control must undergo during the execution of a single computer instruction:
o Load an initial address into the CAR when power is turned on in the computer.
This address is usually the address of the first microinstruction that activates
the instruction fetch routine – IR holds instruction
o The control memory then goes through the routine to determine the effective
address of the operand– AR holds operand address
o The next step is to generate the microoperations that execute the
instruction by considering the opcode and applying a mapping process.
The transformation of the instruction code bits to an address in
control memory where the routine of instruction located is referred to
as mapping process.
11
Downloaded by Mohan Computers world ([email protected])
lOMoARcPSD|47907492
12
Downloaded by Mohan Computers world ([email protected])
lOMoARcPSD|47907492
Conditional Branching:
Mapping of Instruction:
A special type of branch exists when a microinstruction specifies a branch to the
first word in control memory where a microprogram routine is located.
The status bits for this type of branch are the bits in the opcode.
Assume an opcode of four bits and a control memory of 128 locations. The mapping
process converts the 4-bit opcode to a 7-bit address for control memory shown in
below figure.
Subroutines:
13
Downloaded by Mohan Computers world ([email protected])
lOMoARcPSD|47907492
Microprograms that use subroutines must have a provision for storing the return
address during a subroutine call and restoring the address during a subroutine
return.
A subroutine register is used as the source and destination for the addresses
3. Microprogram Example:
The process of code generation for the control memory is called microprogramming.
The block diagram of the computer configuration is shown in below figure.
Two memory units:
Main memory – stores instructions and data
Control memory – stores microprogram
Four processor registers
Program counter – PC
Address register – AR
Data register – DR
Accumulator register - AC
Two control unit registers
Control address register – CAR
Subroutine register – SBR
Transfer of information among registers in the processor is through MUXs rather
than a bus.
14
Downloaded by Mohan Computers world ([email protected])
lOMoARcPSD|47907492
The example will only consider the following 4 of the possible 16 memory instructions
The microinstruction format for the control memory is shown in below figure.
15
Downloaded by Mohan Computers world ([email protected])
lOMoARcPSD|47907492
The branch field (BR) consists of two bits and is used with the address field to choose
the address of the next microinstruction.
16
Downloaded by Mohan Computers world ([email protected])
lOMoARcPSD|47907492
Fetch Routine:
17
Downloaded by Mohan Computers world ([email protected])
Computer Organization UNIT-2 II B.SC [SEM-3]
The main function of a control unit is to fetch the data from the main memory, determine the devices
and the operations involved with it, and produce control signals to execute the operations.
Types of Control Unit: -There are two types of control organization that are as follows −
1) Hardwired Control: -
In the hardwired organization, the control logic is executed with gates, flip-flops, decoders, and
other digital circuits. It can be optimized to make a quick mode of operation. In the micro-
programmed organization, the control data is saved in the control memory.
The control memory is programmed to start the needed sequence of micro-operations. A hardwired
control requires changes in the wiring among the various elements if the design has to be modified
or changed.
The block diagram of the control unit is displayed in the figure. It includes two decoders, a sequence
counter, and several control logic gates.
Some instruction that is read from the memory is placed in the Instruction Register (IR). Therefore,
the IR is divided into three elements such as I bit, opcode, and bits from 0 through 11. The opcodes
are decoded with a 3 * 8 decoder whose outputs are indicated by symbols D0 through D7.
SVR Degree College-Sattenapalli 18 Mohan Computer Education
Computer Organization UNIT-2 II B.SC [SEM-3]
The binary value of the respective opcode is the subscripted number in the symbol. The symbol I
which is the 15th bit of the instruction is transferred to a flip flop. The control logic gates have the
bits that are used from 0 through 11.
The sequence counter is 4-bit counts in binary from 0 through 15. It can be incremented or cleared
synchronously. The timing signals from T0 through T15 are the decoded outputs of the decoder.
2) Microprogrammed Control: -
The microprogrammed control stores its control data in the control memory. It can start the
important set of micro-operations; the control memory is programmed. The changes and
modifications in a micro-programmed control can be completed by upgrading the microprogram in
the control memory.
The control is pretended to be a Read-Only Memory (ROM), where all the control data is saved
permanently. ROM supports the address of the microinstruction. The other register is the control
data register that stores the microinstruction that is read from the memory. It includes a control
word that holds one or more microoperations for the data processor.
The next address should be evaluated during this operation is done. It is evaluated in the next
address generator. Therefore, it is transferred to the control address register to be read. The next
address generator is referred to as the microprogram sequencer. It depends on the inputs to a
sequencer; it decides the address of the next microinstruction. The microinstructions can be
determined in different approaches.