0% found this document useful (0 votes)
4 views15 pages

CST202 Lect. Note 4

The document discusses control logic design in computer architecture, focusing on the organization and functioning of control units, including hardwired and microprogrammed controls. It outlines various methods for control organization, such as one flip-flop per state, sequence register and decoder, PLA control, and microprogram control, detailing their advantages and disadvantages. Additionally, it explains the design of hardwired control, the role of microinstructions, and the microprogram sequencer in managing control signals and operations within a processor unit.

Uploaded by

xocije3152
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views15 pages

CST202 Lect. Note 4

The document discusses control logic design in computer architecture, focusing on the organization and functioning of control units, including hardwired and microprogrammed controls. It outlines various methods for control organization, such as one flip-flop per state, sequence register and decoder, PLA control, and microprogram control, detailing their advantages and disadvantages. Additionally, it explains the design of hardwired control, the role of microinstructions, and the microprogram sequencer in managing control signals and operations within a processor unit.

Uploaded by

xocije3152
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

1

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.

1. Control Unit organization


• The main responsibility of control unit is the generation of timing and control signals.
• The control unit is the circuitry that controls the flow of information through the processor, and
coordinates the activities of the other units within it.
• The control unit directs the entire computer system to carry out stored program instructions.
• The control unit must communicate with both the arithmetic logic unit (ALU) and main memory.
• The control unit instructs the arithmetic logic unit that which logical or arithmetic operation is to be
performed.
• The control unit co-ordinates the activities of the all other units as well as all peripherals and
auxiliary storage devices linked to the computer.
• Goal of control logic design should be development of a circuit that implements the desired control
sequence in a logical and straight forward manner.
• Designers used specialized methods for control logic design which is considered as the extension of
the classical sequential logic method combined with register transfer method.
• The four methods of control organization are:
1. One flip-flop per state method
2. Sequence register and decoder method
3. PLA Control
4. Microprogram control
• The first two methods result in a circuit that must use SSI and MSI circuits for the implementation.
• A control unit implemented with SSI and MSI devices is said to be a hard-wired control.
• If any alterations or modifications are needed, the circuits must be rewired to fulfill the new
requirements.
• The PLA or micro-program control which uses an LSI device such as a programmable logic array or
a read-only memory.
• Any alterations or modifications in a micro-program control can be easily achieved without wiring
changes by removing the ROM from its socket and inserting another ROM programmed to fulfill the
new specifications.
2

1.1 One flip flop per state method


• One flip flop per state in the control sequential circuit
• One flip flop is set at any particular time; all others are cleared
• A single bit is made to propagate from one flip flop to other under the control of a decision logic
• Each flip flop represents a state and is activated only when the control bit is transferred to it
• Uses maximum number of flip flops
• Eg:- A sequential circuit with 12 states requires a minimum of 4 flip flop because 23 < 12 < 24.
Control circuit uses 12 flip flops one for each state

• 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

1.2 Sequence Register and Decoder Method


• Uses register to sequence the control states
• The register is decoded to provide one output for each state
• For n flip flops in the sequence register the circuit will have 2n states and decoder will have 2n
outputs. Eg :- A 4 bit register can be in any one of 16 states
• A 4X16 decoder will have 16 outputs one for each state of the register

Figure: Control logic with sequence register and decoder

• 4 state sequential control logic


• The sequence register has 2 flip flops and the decoder establishes separate outputs for each state in
the register
4
• The transition to the next state in the sequence register is a function of the present state and the
external input conditions
• If the control circuit does not need external inputs the sequence register reduces to a counter that
continuously sequence through the four states so called counter decoder method

1.3 PLA Control


• The programmable logic array (PLA) control is essentially similar to the sequence register and
decoder method except that all combinational circuit are implemented with the PLA, including the
decoder and decision logic.
• By using PLA for combinational circuit reduce the number of ICs and the number of interconnection
wires.

Figure: PLA control logic


• The external sequence register establishes the present state of the control circuit
• The PLA outputs determine which microoperations should be initiated depending on the external
input conditions and the present state of the sequence register
• At the same time other PLA outputs determine the next state of the sequence register
• The sequence register is external to the PLA if the unit implements only combinational circuits

1.4 Microprogram Control


• Purpose of control unit is to initiate a series of sequential steps of microoperations
• Any given time certain operations are to be initiated while all others remain idle
• Control variable at any given time can be represented by a string of 1's and 0's called control word
• Control words can be programmed to initiate the various components in the system in an organized
manner
• A control unit whose control variables are stored in a memory called a Microprogrammed control
unit
5
• Microinstruction :- Each control word of memory
• Microprogram :- Sequence of microinstructions

Figure: Microprogram control logic

• Control memory is usually ROM since alterations of Microprogram is seldom needed


• Use of Microprogram involves placing all control variables in words of the ROM for use by the
control unit through successive read operations.
• The content of the word in the ROM at a given address specifies the microoperations for the system.
• A ROM, PLA or WCM when used in a control unit is referred as a control memory.
• Control memory address register specifies the control word read from control memory
• ROM operates as a combinational circuit with address value as the input and the corresponding
word as the output
• The content of the specified word remains on the output wires as long as the address value remains
in the address register
• The word out of the ROM should be transferred to a buffer register if the address register changes
while the ROM word is still in use
• If the change in address and ROM word can occur simultaneously no buffer register is needed
• The word read from memory represents a microinstruction.
• The microinstruction specifies one or more microoperations for the components of the system
• Once these operations are executed the control unit must determine its next address
• The location of the next microinstruction may be next one in the sequence or it may locate
somewhere else in the control memory
• Some bits of the microinstruction to control the generation of the address for the next
microinstruction
• The next address may be function of external input conditions
• The next address is computed in the next address generator circuit and then transferred into the
control address register to read the next microinstruction.
6
2. Design of hardwired control
• The main objective of control unit is to generate the control signal in proper sequence.
• The control hardware 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 the operation carried out by this machine is determined by the wiring of the
logic elements and hence named as “hardwired”.
• In this hardwired control techniques, the control signals are generated by means of hardwired
circuit.
• The control signals depend on the instruction, i.e. the contents of the instruction register.
• The execution of some of the instructions depends on the contents of condition code or status
flag register.
• The status flags represent the various state of the CPU and various control lines connected to it,
such as MFC status signal.
• The structure of control unit can be represented in a simplified view by putting it in block
diagram.

• 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

Figure: Microprogram control for processing unit


• Control memory of 64 words with 26 bits
• To select 64 words require an address of 6 bits
• To select 8 status bits 3 selection lines for multiplexer
• 1 bit of the microinstruction selects between an external address and address field of the
microinstruction
• First 16 bits of the microinstruction select the microoperation for the processor
• The other 10 bits select the next address for the control address register
• The status bits from the processor are applied to the inputs of the multiplexer
• Both normal and complement values are used for status bits except for overflow bit V
• Input 0 of the of MUX2 is connected to a binary constant which is always 1
8
• The load of CAR is enabled when the input is selected by bits 18,19 and 20 in the microinstruction
causes a transfer of information from output of MUX1 into CAR
• The input into CAR is a function of bit 17 in the microinstruction Bit 17 = 1: CAR receives the
address field of microinstruction Bit 17 = 0: External address is loaded into CAR
• External address is for the purpose of initiating a new sequence of microinstructions which can be
specified by the external environment

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.

• The micro programmed control unit consists of


 Control memory :
o In micro programmed control, the micro programs for all instructions are stored in
the control memory (CM)
o The control signals to be activated at any time are specified by a microinstruction,
which is fetched from Control memory (CM).
9
 Control address register
o The control address register holds the address of the next microinstruction to be
read.
o When address is available in control address register, the sequencer issues READ
command to the control memory.
 Microinstruction register
o After issue of READ command, the word from the addressed location is read into the
microinstruction register.
o Now the content of the micro instruction register generates control signals and next
address information for the sequencer.
 Microprogram sequencer
o A sequence of one or more micro operations designed to control specific operation,
such as addition, multiplication is called a micro program.
o The sequencer loads a new address into the control address register based on the
next address information
Advantages of Micro programmed control
• It simplifies the design of control unit. Thus it is both, cheaper and less error prone implement.
• Control functions are implemented in software rather than hardware.
• The design process is orderly and systematic
• More flexible, can be changed to accommodate new system specifications or to correct thedesign
errors quickly and cheaply.
• Complex function such as floating point arithmetic can be realized efficiently.
Disadvantages
• A micro programmed control unit is somewhat slower than the hardwired control unit,because time
is required to access the microinstructions from CM
• The flexibility is achieved at some extra hardware cost due to the control memory and itsaccess
circuitry.
5. Microinstructions
Each Microprogram is the sequence of microinstructions. And these microinstructions are executed in
sequence. The execution sequence is maintained by Microprogram counter.
Example: Control Sequence for instruction Add (R3), R1:

1. PCout, MARin, Read, Select4, Add, Zin


2. Zout, PCin, Wait for the MFC
3. MDRout, IRin
10
4. R3out, MARin, Read
5. R1out, Yin, Wait for MFC
6. MDRout, Select Y, Add, Zin
7. Zout, R1in, End
Techniques of grouping of Control Signals
• The grouping of control signal can be done either by using technique called
a) Horizontal organization
b) Vertical organization
a) Horizontal Micro-Instructions
• The scheme of micro-instruction by assigning one bit position to each control signal is called
horizontal micro-instructions.

• 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.

Comparison between Horizontal and Vertical Organization

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.

Fig: Block diagram of Microprogram Sequencer

 The following function diagram illustrates the operation of a sequencer.

7. Microprogrammed CPU Organization


Digital computer consists of
1. Central Processing Unit (CPU)
2. Memory unit
3. Input-output devices
13
• CPU can be divides into 2 distinct and interactive sections
1. Processing section
 Useful device for constructing the processor section of a CPU
2. Control section
 Controlling the entire units of computer
 Microprogram sequencer - constructing a Microprogram control of CPU
• Microprogrammed computer
A computer CPU use the Microprogram sequencer
• Microprogrammed computer consists of
1. Memory unit
 Stores instructions and data supplied by the user through an input device
2. Two processor unit
 Data processor :- Manipulates data
 Address processor :- Manipulates the address information received from memory
3. A Microprogram sequencer
4. A control memory
5. Other digital functions
• An instruction extracted from memory unit during fetch cycle goes into instruction register.
• Code transformation constitutes a mapping function that is needed to convert the operation code bits
of an instruction into a starting address for the control memory and is implemented with ROM or PLA
• Mapping concept provides flexibility for adding instructions or microoperations for control memory
as need arises.
• The address generated in code transformation mapping function is applied to the external address
(EXA) input of the sequencing
Microprogram control unit consists of
1. The sequencer
 Generates next address
2. A control memory
 Reads the next macroinstruction while present macroinstruction are being executed in the other
units of the CPU
 For storing microinstructions
14
3. A multiplexer
 Selects one of the many status bits and applies to the T(test) input of the sequencer
 One of the input of the multiplexer is always I to provide an unconditional branch operation
4. A pipeline register
 Speed up the control operation
 Allows next address to be generated and the output of control memory to change while the
control word in pipeline register initiates the micropertaions given by present microinstruction
 Not always necessary
 The output of control memory can go directly to the control inputs of the various units in the
CPU

• 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

You might also like