Contorl Unit
Contorl Unit
UNIT-3
CONTROL UNIT
Control Unit is the part of the computer’s central processing unit (CPU), which directs
the operation of the processor. It was included as part of the Von Neumann
Architecture by John von Neumann.
It is the responsibility of the Control Unit to tell the computer’s memory, arithmetic/logic
unit and input and output devices how to respond to the instructions that have been
sent to the processor.
It fetches internal instructions of the programs from the main memory to the processor
instruction register, and based on this register contents, the control unit generates a
control signal that supervises the execution of these instructions.
CONTROL UNIT TYPES
Hardwired Control Unit: When the control signals are generated by hardware
using conventional logic design techniques, the control unit is said to be
hardwired.
Micro programmed control unit: A control unit whose binary control variables
are stored in memory is called a micro programmed control unit.
HARDWIRED CONTROL UNIT MICROPROGRAMMED CONTROL UNIT
Hardwired control unit generates the control signals needed for the Micrprogrammed control unit generates the control signals with the
processor using logic circuits help of micro instructions stored in control memory
Difficult to modify as the control signals that need to be generated are Easy to modify as the modification need to be done only at the
hard wired instruction level
Used in computer that makes use of Reduced Instruction Set Used in computer that makes use of Complex Instruction Set
Computers(RISC) Computers(CISC)
HARDWIRED CONTROL UNIT
MICROPROGRAMMED CONTROL UNIT
Organization of micro programmed control unit
External
input
Next- Control
Control
Control Control Control
address word
word
address memory data
generator (ROM) register
(sequencer) register
Next-address information
Microinstruction Format
3 3 3 2 2 7
F1 F2 F3 CD BR AD
11
ADDRESS SEQUENCING
Mapping
logic
Status MUX
Branch Multiplexers
bits logic select
Subroutine
Register
Control Address Register (SBR)
(CAR)
I Incrementer
select a status
bit
Microoperations
Branch address 14
Mapping of Instruction
Each computer instruction has its own microprogram routine stored in a given
location of the control memory
Mapping
Transformation from instruction code bits to address in control memory
where routine is located
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 for an instruction is located.
The status bits for this type of branch are the bits in the operation code part of the
instruction.
For example, a computer with a simple instruction format as shown in figure has an
operation code of four bits which can specify up to 16 distinct instructions.
Assume further that the control memory has 128 words, requiring an address of seven
bits.
Contd..
One simple mapping process that converts the 4-bit operation code to a 7-bit address for control memory is
shown in figure.
This mapping consists of placing a 0 in the most significant bit of the address, transferring the four
operation code bits, and clearing the two least significant bits of the control address register.
This provides for each computer instruction a microprogram routine with a capacity of four
microinstructions.
MAPPING OF INSTRUCTIONS TO MICROROUTINES
Machine OP-code
Instruction 1 0 1 1 Address
Mapping bits 0 x x x x 0 0
Microinstruction Figure : Mapping from instruction
address 0 1 0 1 1 0 0 code to microinstruction address
Mapping logic
Control Memory
Mapping of Instruction
Example
Mapping 4-bit operation code to 7-bit address
OP-codes of Instructions
ADD 0000
AND 0001
LDA 0010 Control
memory
Mapping bits 0 xxxx 00
Address
0 0000 00 ADD Routine
MICROPROGRAM SEQUENCER
External
(MAP)
L
I0 3 2 1 0
Input Load
I1 S1 MUX1 SBR
logic
T S0
1 Incrementer
I MUX2 Test
S
Z Select
Clock CAR
Control memory
Microops CD BR AD
... ...
Microinstruction Types
HORIZONTAL MICROINSTRUCTION
VERTICAL MICRO;INSTRUCTION