Page 1
The control unit is responsible for decoding the opcode and operand bits in the
instruction register, and then generating the control signals necessary to drive all
other hardware in the CPU to perform the sequence of micro-operations that
comprise the instruction.
Design of Control Unit
The function of the control unit in a digital computer, is to initiate sequences of
micro operations (the operations executed on data stored in registers are called
micro operations).
• The number of different types of micro operations that are available in a given
system is finite.
• When the control signals are generated by hardware using conventional logic
design techniques, the control unit is said to be hardwired.
• Micro-programming is a second alternative for designing the control unit of a
digital computer.
Block diagram of a control unit
• The control unit initiates a series of sequential steps of micro operations.
During any given time certain micro operations are to be initiated, while others
remain idle.
• The control variables at any given time can be represented by a string of 1 s
and 0 s called a control word:
Approaches for Designing Control Unit
Page 2
The control unit is responsible for decoding the opcode and operand bits in the
instruction register, and then generating the control signals necessary to drive all
other hardware in the CPU to perform the sequence of micro-operations that
comprise the instruction.
Design of Control Unit
The function of the control unit in a digital computer, is to initiate sequences of
micro operations (the operations executed on data stored in registers are called
micro operations).
• The number of different types of micro operations that are available in a given
system is finite.
• When the control signals are generated by hardware using conventional logic
design techniques, the control unit is said to be hardwired.
• Micro-programming is a second alternative for designing the control unit of a
digital computer.
Block diagram of a control unit
• The control unit initiates a series of sequential steps of micro operations.
During any given time certain micro operations are to be initiated, while others
remain idle.
• The control variables at any given time can be represented by a string of 1 s
and 0 s called a control word:
Approaches for Designing Control Unit
Hardwired Control
• Fixed logic circuits that correspond directly to the Boolean expressions are
used to generate the control signals.
• Hardwired control is faster than microprogrammed control.
• A controller that uses this approach can operate at high speed.
• The control hardwire 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 operations
carried out by this machine is determined by the wiring of the logic elements,
hence the name "hardwired".
Instruction register
Micro-programmed Control
• 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 similar to machine language
programs.
• It leads to a slower operating speed because of the time it takes to fetch
microinstructions from the control store.
• Control word: A control word is a word whose individual bits represent the
various control signals.
• Micro-routine: A sequence of control words corresponding to the control
sequence of a machine instruction constitutes the microroutine for that
instruction,
• Micro-instruction: Individual control words in this microroutine are referred to
as microinstructions.
• Micro-program: A sequence of microinstructions is called a microprogram,
which is stored in a ROM or RAM called a control memory CM.
Page 3
The control unit is responsible for decoding the opcode and operand bits in the
instruction register, and then generating the control signals necessary to drive all
other hardware in the CPU to perform the sequence of micro-operations that
comprise the instruction.
Design of Control Unit
The function of the control unit in a digital computer, is to initiate sequences of
micro operations (the operations executed on data stored in registers are called
micro operations).
• The number of different types of micro operations that are available in a given
system is finite.
• When the control signals are generated by hardware using conventional logic
design techniques, the control unit is said to be hardwired.
• Micro-programming is a second alternative for designing the control unit of a
digital computer.
Block diagram of a control unit
• The control unit initiates a series of sequential steps of micro operations.
During any given time certain micro operations are to be initiated, while others
remain idle.
• The control variables at any given time can be represented by a string of 1 s
and 0 s called a control word:
Approaches for Designing Control Unit
Hardwired Control
• Fixed logic circuits that correspond directly to the Boolean expressions are
used to generate the control signals.
• Hardwired control is faster than microprogrammed control.
• A controller that uses this approach can operate at high speed.
• The control hardwire 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 operations
carried out by this machine is determined by the wiring of the logic elements,
hence the name "hardwired".
Instruction register
Micro-programmed Control
• 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 similar to machine language
programs.
• It leads to a slower operating speed because of the time it takes to fetch
microinstructions from the control store.
• Control word: A control word is a word whose individual bits represent the
various control signals.
• Micro-routine: A sequence of control words corresponding to the control
sequence of a machine instruction constitutes the microroutine for that
instruction,
• Micro-instruction: Individual control words in this microroutine are referred to
as microinstructions.
• Micro-program: A sequence of microinstructions is called a microprogram,
which is stored in a ROM or RAM called a control memory CM.
Microinstruction From main memory
Control signals
• 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 format for control word is as follows:
Branch Condition Flag Control Field
Control Memory
Address
Micro-instructions are commonly divided into two categories: horizontal and
vertical.
Horizontal Micro-Programmimg Control: Each micro-instruction is a series of bits
each of which represents a single control line.
• In this design, Control signal is expressed with decoded binary format per
Control Signal.
• There is no need of external decoder to generate the control signal.
• It is bit flexible as compared to hardwired control unit since it allows
modification easily as compared to hardwired control unit.
• This concept is not in practice since managing the signals in the decoded
format is not easy as it leads to longer instructions.
Horizontal micro-instructions are characterized by:
• Long formats;
• Ability to express a high degree of parallelism;
• Minimally encoded scheme
• Many resources can be controlled
• Operating speed is low
Vertical Micro-Programming Control: Groups of bits in the micro-instruction
represent commands. This requires decoding or de-multiplexing before the control
commands can be issued. •
• In this Control Unit, Control signal are expressed in encode binary format.
• it requires external decoder to decode the signal and process them.
• It provides the ease for implementation of new instructions because of
encoded binary format
Vertical micro-instructions are characterized by:
Short formats;
Page 4
The control unit is responsible for decoding the opcode and operand bits in the
instruction register, and then generating the control signals necessary to drive all
other hardware in the CPU to perform the sequence of micro-operations that
comprise the instruction.
Design of Control Unit
The function of the control unit in a digital computer, is to initiate sequences of
micro operations (the operations executed on data stored in registers are called
micro operations).
• The number of different types of micro operations that are available in a given
system is finite.
• When the control signals are generated by hardware using conventional logic
design techniques, the control unit is said to be hardwired.
• Micro-programming is a second alternative for designing the control unit of a
digital computer.
Block diagram of a control unit
• The control unit initiates a series of sequential steps of micro operations.
During any given time certain micro operations are to be initiated, while others
remain idle.
• The control variables at any given time can be represented by a string of 1 s
and 0 s called a control word:
Approaches for Designing Control Unit
Hardwired Control
• Fixed logic circuits that correspond directly to the Boolean expressions are
used to generate the control signals.
• Hardwired control is faster than microprogrammed control.
• A controller that uses this approach can operate at high speed.
• The control hardwire 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 operations
carried out by this machine is determined by the wiring of the logic elements,
hence the name "hardwired".
Instruction register
Micro-programmed Control
• 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 similar to machine language
programs.
• It leads to a slower operating speed because of the time it takes to fetch
microinstructions from the control store.
• Control word: A control word is a word whose individual bits represent the
various control signals.
• Micro-routine: A sequence of control words corresponding to the control
sequence of a machine instruction constitutes the microroutine for that
instruction,
• Micro-instruction: Individual control words in this microroutine are referred to
as microinstructions.
• Micro-program: A sequence of microinstructions is called a microprogram,
which is stored in a ROM or RAM called a control memory CM.
Microinstruction From main memory
Control signals
• 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 format for control word is as follows:
Branch Condition Flag Control Field
Control Memory
Address
Micro-instructions are commonly divided into two categories: horizontal and
vertical.
Horizontal Micro-Programmimg Control: Each micro-instruction is a series of bits
each of which represents a single control line.
• In this design, Control signal is expressed with decoded binary format per
Control Signal.
• There is no need of external decoder to generate the control signal.
• It is bit flexible as compared to hardwired control unit since it allows
modification easily as compared to hardwired control unit.
• This concept is not in practice since managing the signals in the decoded
format is not easy as it leads to longer instructions.
Horizontal micro-instructions are characterized by:
• Long formats;
• Ability to express a high degree of parallelism;
• Minimally encoded scheme
• Many resources can be controlled
• Operating speed is low
Vertical Micro-Programming Control: Groups of bits in the micro-instruction
represent commands. This requires decoding or de-multiplexing before the control
commands can be issued. •
• In this Control Unit, Control signal are expressed in encode binary format.
• it requires external decoder to decode the signal and process them.
• It provides the ease for implementation of new instructions because of
encoded binary format
Vertical micro-instructions are characterized by:
Short formats;
• Limited ability to express microoperation parallelism;
• Highly encoded schemes, hence considerable lightly encoded.
• Operating speed is high
Comparison between Horizontal and Vertical Micro-programming
• Horizontal microinstruction control is faster but requires greater length
microinstructions.
• Horizontal programming allows more than one signal to be activated at a
same time without any hardware modifications but vertical microproramming
require modification to the instruction format.
Operations
Instruction Fetch Step: Read into Instruction Register from Memory at address
indicated by Program Counter register. Then increment program counter to point to
the next instruction.
IR <= lnstrCache[PC];
PC <= PC + 4;
Instruction Decode and Register Read Step:
RS <= RegFile[IR[25:21]];
RT <= RegFile[IR[20:16]];
Immediate <= sign-extend(IR[15:0]);
pcALUOut <= PC + (Immediate « 2);
ALU Operation: This is instruction-specific, since control knows the instruction
type.
R-Type Instruction: ALUOut <= RS op RT
Memory-Reference Instr: ALUOut <= RS + Immediate
Branch Instruction: If (RS/x compare RT/y) PC <= ALUOut
Jump Instruction: PC <= (PC(31:28), (IR[25:0],2*b00))
Data Cache Access
R-Type Instruction: RegFile[IR[15:11]] <= ALUOut
Memory-Reference Instr:
Load Instr: DataCacheOut <= DataCache[ALUOut]
Store Instr: DataCache[ALUOut] <=RT/Y
Register Write-Back
Load Instr: RegFile[IR[20:16]] <= DataCacheOut
Fetch Instruction: The following sequence of events in fetching an instruction:
1. The contents of the PC are loaded into the MAR.
2. The value in the PC is incremented. (This operation can be done in parallel
with a memory access.)
3. As a result of a memory read operation, the instruction is loaded into the
MDR.
4. The contents of the MDR are loaded into the IR.
Using single bus data path:
Page 5
The control unit is responsible for decoding the opcode and operand bits in the
instruction register, and then generating the control signals necessary to drive all
other hardware in the CPU to perform the sequence of micro-operations that
comprise the instruction.
Design of Control Unit
The function of the control unit in a digital computer, is to initiate sequences of
micro operations (the operations executed on data stored in registers are called
micro operations).
• The number of different types of micro operations that are available in a given
system is finite.
• When the control signals are generated by hardware using conventional logic
design techniques, the control unit is said to be hardwired.
• Micro-programming is a second alternative for designing the control unit of a
digital computer.
Block diagram of a control unit
• The control unit initiates a series of sequential steps of micro operations.
During any given time certain micro operations are to be initiated, while others
remain idle.
• The control variables at any given time can be represented by a string of 1 s
and 0 s called a control word:
Approaches for Designing Control Unit
Hardwired Control
• Fixed logic circuits that correspond directly to the Boolean expressions are
used to generate the control signals.
• Hardwired control is faster than microprogrammed control.
• A controller that uses this approach can operate at high speed.
• The control hardwire 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 operations
carried out by this machine is determined by the wiring of the logic elements,
hence the name "hardwired".
Instruction register
Micro-programmed Control
• 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 similar to machine language
programs.
• It leads to a slower operating speed because of the time it takes to fetch
microinstructions from the control store.
• Control word: A control word is a word whose individual bits represent the
various control signals.
• Micro-routine: A sequence of control words corresponding to the control
sequence of a machine instruction constitutes the microroutine for that
instruction,
• Micro-instruction: Individual control words in this microroutine are referred to
as microinstructions.
• Micro-program: A sequence of microinstructions is called a microprogram,
which is stored in a ROM or RAM called a control memory CM.
Microinstruction From main memory
Control signals
• 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 format for control word is as follows:
Branch Condition Flag Control Field
Control Memory
Address
Micro-instructions are commonly divided into two categories: horizontal and
vertical.
Horizontal Micro-Programmimg Control: Each micro-instruction is a series of bits
each of which represents a single control line.
• In this design, Control signal is expressed with decoded binary format per
Control Signal.
• There is no need of external decoder to generate the control signal.
• It is bit flexible as compared to hardwired control unit since it allows
modification easily as compared to hardwired control unit.
• This concept is not in practice since managing the signals in the decoded
format is not easy as it leads to longer instructions.
Horizontal micro-instructions are characterized by:
• Long formats;
• Ability to express a high degree of parallelism;
• Minimally encoded scheme
• Many resources can be controlled
• Operating speed is low
Vertical Micro-Programming Control: Groups of bits in the micro-instruction
represent commands. This requires decoding or de-multiplexing before the control
commands can be issued. •
• In this Control Unit, Control signal are expressed in encode binary format.
• it requires external decoder to decode the signal and process them.
• It provides the ease for implementation of new instructions because of
encoded binary format
Vertical micro-instructions are characterized by:
Short formats;
• Limited ability to express microoperation parallelism;
• Highly encoded schemes, hence considerable lightly encoded.
• Operating speed is high
Comparison between Horizontal and Vertical Micro-programming
• Horizontal microinstruction control is faster but requires greater length
microinstructions.
• Horizontal programming allows more than one signal to be activated at a
same time without any hardware modifications but vertical microproramming
require modification to the instruction format.
Operations
Instruction Fetch Step: Read into Instruction Register from Memory at address
indicated by Program Counter register. Then increment program counter to point to
the next instruction.
IR <= lnstrCache[PC];
PC <= PC + 4;
Instruction Decode and Register Read Step:
RS <= RegFile[IR[25:21]];
RT <= RegFile[IR[20:16]];
Immediate <= sign-extend(IR[15:0]);
pcALUOut <= PC + (Immediate « 2);
ALU Operation: This is instruction-specific, since control knows the instruction
type.
R-Type Instruction: ALUOut <= RS op RT
Memory-Reference Instr: ALUOut <= RS + Immediate
Branch Instruction: If (RS/x compare RT/y) PC <= ALUOut
Jump Instruction: PC <= (PC(31:28), (IR[25:0],2*b00))
Data Cache Access
R-Type Instruction: RegFile[IR[15:11]] <= ALUOut
Memory-Reference Instr:
Load Instr: DataCacheOut <= DataCache[ALUOut]
Store Instr: DataCache[ALUOut] <=RT/Y
Register Write-Back
Load Instr: RegFile[IR[20:16]] <= DataCacheOut
Fetch Instruction: The following sequence of events in fetching an instruction:
1. The contents of the PC are loaded into the MAR.
2. The value in the PC is incremented. (This operation can be done in parallel
with a memory access.)
3. As a result of a memory read operation, the instruction is loaded into the
MDR.
4. The contents of the MDR are loaded into the IR.
Using single bus data path:
Step Micro-operation
to
M AR «— (PC); A < - (PC)
h
M DR McmfMARl; PC (A)+ 4
h IR (MDR)
Using Three bus data path:
Step M icro-operation
to
M AR < — (PC); PC (PC)+ 4
M DR Mem[M AR]
t2 IR + — (M DR)
Execution of an Instruction:
Simple Arithmetic Operation: Add R1, R2, RO
This instruction adds the contents of source registers R1 and R2, and stores the
results in destination register RO.
This addition can be executed as in the following sequence:
1. The registers RO, R1, R2 , are extracted from the IR.
2. The contents of R1 and R2 are passed to the ALU for addition.
3. The output of the ALU is transferred to RO .
Using single bus datapath:
Step M icro-operation
to
A
(/f,)
B (R2)
t2
Ro
(A) + (£f)
Using two bus datapath:
Step Micro-operation
to A (/?, ) + (/?*)
tx R o < - (A)
Using three bus datapath:
Step Micro-operation
to Ro <tf,) + ( * 2)
Fetching a Word from memory
Read More