Sei sulla pagina 1di 35

CONTROL UNIT ORGANIZATION

DEFINITION
DESIGN OF CONTROL UNIT
HARDWIRED CONTROL UNIT
MICROPROGRAMMED CONTROL UNIT
DEFINITION
• 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.
• A control unit works by receiving input information to which it converts into control signals,
which are then sent to the central processor. The computer’s processor then tells the attached
hardware what operations to perform.
• The functions that a control unit performs are dependent on the type of CPU because the
architecture of CPU varies from manufacturer to manufacturer.
FUNCTIONS OF CONTROL UNIT

• The control unit performs two elementary tasks.


• Sequencing
• Causing the CPU to step through a series of micro-operations

• Execution
• Causing the performance of each micro-op

• This is done using Control Signals


FUNCTIONS OF CONTROL UNIT

• It coordinates the sequence of data movements into, out of, and between a
processor’s many sub-units.
• It interprets instructions.
• It controls data flow inside the processor.
• It receives external instructions or commands to which it converts to sequence of
control signals.
• It controls many execution units(i.e. ALU, data buffers and registers) contained
within a CPU.
• It also handles multiple tasks, such as fetching, decoding, execution handling and
storing results.
DESIGN OF CONTROL UNIT
• HARDWIRED CONTROL UNIT
• MICROPROGRAMMED CONTROL UNIT
HARDWIRED CONTROL UNIT
• In the Hardwired control unit, the control signals that are important for instruction execution control are
generated by specially designed hardware logical circuits, in which we can not modify the signal
generation method without physical change of the circuit structure.
• The operation code of an instruction contains the basic data for control signal generation. In the
instruction decoder, the operation code is decoded. The instruction decoder constitutes a set of many
decoders that decode different fields of the instruction opcode.
• Design is based on a fixed architecture.
• It is implemented with the help of gates, flip flops, decoders etc. in the hardware.
• The inputs to control unit are the instruction register, flags, timing signals etc.
• This organization can be very complicated if we have to make the control unit large.
• If the design has to be modified or changed, all the combinational circuits have to be modified which is
a very difficult task.
• This is preferred in a reduced instruction set computing (RISC) architecture, which only has a small
number of instructions.
Control unit organization

HARDWIRED CONTROL (CONTD..)

CLK Control step


Clock counter

•Control unit consists of


External a decoder/encoder block to
inputs
accept the following inputs:
Decoder/
IR - Control step counter.
encoder
- Instruction Register.
Condition
codes - Condition codes
- External inputs.
•Generates control signals.

8
Control signals
HARDWIRED CONTROL (CONTD..)

• Control hardware can be viewed as a state machine:


• Changes state every clock cycle depending on the contents of the instruction register,
condition codes, and external inputs.
• Outputs of the state machine are control signals:
• Sequence of control signals generated by the machine is determined by wiring of logic
elements, hence the name “hardwired control”.
• Speed of operation is one of the advantages of hardwired control is its speed of operation.
• Disadvantages include:
• Little flexibility.
• Limited complexity of the instruction set it can implement.

10
PROBLEMS WITH HARD WIRED DESIGNS

• Complex sequencing & micro-operation logic


• Difficult to design and test
• Inflexible design
• Difficult to add new instructions
MICROPROGRAMMED CONTROL UNIT
• The control unit whose control signals are generated by the data stored in control memory and constitute a
program on the small scale is called a microprogrammed control unit.
• Micrprogrammed control unit generates the control signals with the help of micro instructions stored in
control memory
• It is implemented by using programming approach.
• A sequence of micro operations is carried out by executing a program consisting of micro-instructions.
• Control signals are generated by a program are similar to machine language programs.

• In this organization any modifications or changes can be done by updating the micro program in the
control memory by the programmer.
• Micro-programmed control unit is slower in speed because of the time it takes to fetch microinstructions
from the control memory.
• It can handle complex instructions
• Less costlier than hardwired control as only micro instructions are used for generating control signals
• Control signals for many instructions can be generated
• Used in computer that makes use of Complex Instruction Set Computers(CISC)
BLOCK DIAGRAM OF OF MICROPROGRAMMED
CONTROL UNIT
Basic organization of a microprogrammed control unit.

Starting
address
Starting •Microprogram counter (mPC) is used to
IR generator
address read CWs from control store sequentially.
generator •When a new instruction is loaded into IR,
Starting address generator generates the
starting address of the microroutine.
•This address is loaded into the mPC.
mPC is automatically incremented by the
Clock mPC clock, so successive microinstructions are
read from the control store.

Control
store CW

14
ADVANTAGES AND DISADVANTAGES OF
MICROPROGRAMMING
• Simplifies design of control unit
• Cheaper
• Less error-prone

• Slower
DIFFERENCE B/W HARDWIRED CU & MICROPROGRAMMED CU
Hardwired cu Microprog cu
• Hardwired control unit generates the control signals
• Micrprogrammed control unit generates the control
needed for the processor using logic circuits.
signals with the help of micro instructions stored in control
• Hardwired control unit is faster when compared to memory
microprogrammed control unit as the required
• This is slower than the other as micro instructions are used
control signals are generated with the help of
for generating signals here.
hardwares.
• Easy to modify as the modification need to be done only at
• Difficult to modify as the control signals that need to
the instruction level.
be generated are hard wired
• Less costlier than hardwired control as only micro
• More costlier as everything has to be realized in
instructions are used for generating control signals.
terms of logic gates.
• It can handle complex instructions.
• It cannot handle complex instructions as the circuit
design for it becomes complex. • Control signals for many instructions can be generated.

• Only limited number of instructions are used due to • Used in computer that makes use of Complex Instruction
the hardware implementation. Set Computers(CISC)

• Used in computer that makes use of Reduced


Instruction Set Computers(RISC)
SOME IMPORTANT TERMS

• Control Word : A control word is a word whose individual bits represent various
control signals.
• Micro-routine : A sequence of control words corresponding to the control sequence
of a machine instruction constitutes the micro-routine for that instruction.
• Micro-instruction : Individual control words in this micro-routine are referred to as
microinstructions.
• 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).
• 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.
• Control Memory:
• The set of microinstruction is stored in control Memory (CM) also called as control store.
• 6) Control Address Register (CAR):
• It contains the address of next microinstruction to be read. This is similar to the program
counter(PC) which stores the address of the next instruction.
• 7) Control Buffer Register(CBR):
• When microinstruction is read from the control memory, it is transferred to a control Buffer
Register (CBR), which is similar to the instruction Register (IR) that stores the opcode of the
instruction read from the memory.
• 8) Sequencing:
• It loads the control Address register with the address of the next instruction to be read and
issues a read command to control memory.
Inputs:

 Clock
IR
Control signals
 Instruction Register (IR)
within CPU
Flags
 Flags •
• Control signals
• Control from system bus
 Control Signals from Control Bus Unit
Clock
Control signals
Outputs: to system bus

 Control Signals to Control Bus


Control bus
 Control Signals within processor
MICRO-INSTRUCTIONS
• An instruction that controls data flow and instruction-execution sequencing in
a processor at a more fundamental level than machine instructions is called a
microinstruction.
• A series of microinstructions is necessary to perform an individual machine
instruction.
• The micro-instruction contains a control word that specifies one or more micro-
operations for the data processor.
• Microinstruction is a single instruction in microcode.
• It is the most elementary instruction in the computer, such as moving the contents of a
register to the arithmetic logic unit (ALU).
• It takes several microinstructions to carry out one complex machine instruction (CISC).
Also called a "micro-op" or "µop," microinstructions differ within the same computer
family and even the same vendor.
MICROINSTRUCTIONS CNTD:

• A straightforward way to structure microinstructions is to assign one bit


position to each control signal.
• However, this is very inefficient.
• The length can be reduced: most signals are not needed simultaneously,
and many signals are mutually exclusive.
• All mutually exclusive signals are placed in the same group in binary
coding.
• A sequence of microinstructions constitutes a microprogram.
• The microinstruction in control memory contains
A set of bits to initiate micro-operations in computer regiters.
Other bits to specify the method by which the next address is obtained.
24
MICRO-INSTRUCTION TYPES

• Each micro-instruction specifies single (or few) micro-operations to be performed


• (vertical micro-programming)

• Each micro-instruction specifies many different micro-operations to be performed in


parallel
• (horizontal micro-programming)
ADDRESS SEQUENCING
CONTROL MEMORY

Control Memory is the storage in the microprogrammed control unit to store the
microprogram.
Writeable Control Memory: Control Storage whose contents can be modified, allow
the change in microprogram and Instruction set can be changed or modified is
referred as Writeable Control Memory.
Control Word: The control variables at any given time can be represented by a control
word string of 1 's and 0's called a control word.

Potrebbero piacerti anche