CST202 Lect. Note 4
CST202 Lect. Note 4
MODULE – IV
Control Logic Design: Control organization – Hardwired control-microprogram control –control
of processor unit - Microprogram sequencer, microprogrammed CPU organization -horizontal
and vertical micro instructions.
• 4 stage sequential control logic that uses 4 D-type flip flops: one flip flop per state Ti , i=0, 1, 2, 3
• At any given time interval between 2 clock pulses only one flip flop is equal to 1 all others are 0
• The transition from the present state to next state is a function of the present Ti that is a 1 and
certain input conditions
• The next state is manifested when the previous flip flop is cleared and a new one is set
• Each of the flip flop is connected to the data processing section of the digital system to initiate
certain microoperations
• The control outputs are a function of the T's and external inputs
• These outputs may also initiate microoperations
3
• If control circuit does not need external inputs for its sequencing, the circuit reduces to straight shift
register with a single bit shifted from one position to the next
• If control sequence must repeated over and over again the control reduces to ring counter
• Ring counter is a shift register with the output of last flip flop connected to the input of the first flip
flop.
• Also called ring counter controller. In a ring counter single bit continuously shifts from one position
to the next in a circular manner.
Advantages
• Simple to design by inspecting the state diagram that describes the control sequence
• Offers a savings in design effort.
• An increase in operational simplicity.
• Decrease in the combinational circuits required to implement the complete sequential circuit.
Disadvantage
• Increase system cost since more flip flops are used
• The decoder/encoder block is simply a combinational circuit that generates the required control
outputs depending on the state of all its input.
• Control step counter keeps tracks of the count of control steps.
• It is required to generate many control signals by the control unit. These are basically coming
out from the encoder circuit of the control signal generator. The control signals are lie PCin
PCout, ZIn, Zout , MARin , Add , End etc.
7
3. Control of Processor Unit
• General purpose Microprogram control unit must have control memory large enough to store many
microinstructions
• Include all possible control variables in the system - controlling ALU, Multiplexer, status bits
• Provision must be available to accept an external address to initiate many operations
• Advantage of Microprogram control
Once the hardware configuration is established there should be no need for further
hardware or wiring changed
Only change Microprogram reside in the control memory for different operations
4. Micro-programmed Control
• Each micro operation is associated with a specific set of control lines which, when
activated, causes that micro operation to take place.
• Since the number of instructions and control lines is often in the hundreds, the
complexity of hardwired control unit is very high.
• The hardwired control unit is relatively inflexible because it is difficult to change the
design, if one wishes to correct design error or modify the instruction set.
• Each microinstruction is nothing but the combination of 0’s and 1’s which is known as control word.
• Each position of control word specifies a particular control signal. On the control word means that a
low signal value is generated for that control signal at that particular instant of time, similarly 1
indicates a high signal.
Example: 0111000111000000
Advantage: It is suitable when operating speed of computer is a critical factor
b) Vertical Micro-Instructions
• We can reduce the length of the horizontal micro-instruction so easily by implementing another
method known as vertical micro-instructions.
• In this case, Most signals are not needed simultaneously and many others are mutually
exclusive.
11
Advantage
• Fewer bits are required in the microinstruction.
Disadvantage
• Vertical approach results in slower operations speed.
6. Microprogram Sequencer
• Micro program sequencer is a control unit which does the tasks of Microprogram sequencing.
• There are two important factors must be considered while designing the micro program sequencer.
o The size of the microinstruction
o The address generation time
• Microprogram sequencer is attached to the control memory.
• It inspects certain bits in the microinstruction to determine the next address for control memory.
• A typical sequencer has the following address sequencing capabilities.
1. Increments the present address of control memory
2. Branches to an address which will be specified in the bits of microinstruction
3. Branches to a given address if a specified status bit is equal to 1.
4. Transfers control to a new address as specified by an external source
5. Has a facility for subroutines calls and returns.
• The block diagram of Microprogram Sequencer is shown in the below figure.
• It consists of a multiplexer that selects an address from four sources and routes it into a control
address register.
• The O/P from CAR provides the address for control memory.
• The contents of CAR are incremented and applied to the multiplexer and to the stack register file.
12
• The register selected in the stack is determined by stack pointer. Inputs (I0-I2) specify the operation
for the sequencer and input T is the test point for a status bit.
• Initially the address register is cleared to zero and clock pulse synchronizes the loading into registers.
• Microinstruction format:-
Contains 6 fields
First 3 fields(I,SL, BRA) provide information to the sequencer to determine the next address for
control memory
I field ( 3 bits) :- Supplies input information for the sequencer
SL field :- Selects a status bit for the multiplexer
BRA field :- Address field of microinstruction and supplies a branch address(BRA) to the
sequencer
15
The next 3 fields(MC, PS, DF) are for controlling microoperations in the processor and the
memory units
Memory control (MC) field :- Controls the address processor and the read and write
operations in the memory unit
The processor select(PS) field :- Controls the operations in the data processor unit
The data field(DF) :- Used to introduce constants into the processor
Output from data field may be used to set up control registers and introduce data in processor
registers