Professional Documents
Culture Documents
Computer Organization and Architecture
Computer Organization and Architecture
Architecture
Presented by
Dr. Preetha K G
Department of Computer Science & Engineering
Rajagiri School of Engineering & Technology
Module 4
2
Introduction
• To execute an instruction, the control unit of
the CPU must generate the required control
signal in the proper sequence.
• There are two approaches used for generating
the control signals in proper sequence as
Hardwired Control unit and Micro-
programmed control unit.
3
Introduction
4
Control Organization
5
Control Organization
6
One flip-flop per state methods
9
Sequence register and decoder method
10
PLA Control
11
PLA Control
12
Microprogrammed control
• Control signals are generated by a program are similar
to machine language programs.
• The control signals associated with operations are
stored in special memory units inaccessible by the
programmer as Control Words (CW).
• A sequence of CWs corresponding to the control
sequence of a machine instruction constitutes the
micro routine for that instruction, and the individual
control words in this micro routine are referred to as
microinstructions.
• Micro-programmed control unit is slower in speed
because of the time it takes to fetch microinstructions
from the control memory.
13
Microprogrammed control
15
Hardwired Control
• 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.
16
Hardwired Control
• 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”.
• Fixed logic circuits that correspond directly to the
Boolean expressions are used to generate the control
signals.
• A controller that uses this approach can operate at
high speed.
17
Hardwired Control
• Example
• Zin=T1+T6.Add+T4.BR+…..
• END= T7.Add+T5.BR+(T5.N+T4.N’)BRN 18
Hardwired Control
Zin
END
19
Hardwired Control
• Run control signal set to 1
• Counter incremented by 1 at the end of each clock
cycle.
• When Run=0, the counter stops counting
• This is needed whenever the WMFC signal is issued-
The processor waits for reply from memory
20
Hardwired Control
21
Hardwired Control
23
Hardwired Control
24
Hardwired Control
25
Hardwired Control
26
Hardwired Control
27
Hardwired Control
• Data-processor with the required control variables.
• This ALU has four selection variables,
• The variable Is loads the output of the ALU into register
A and also the output carry into E.
• Variables y, z. and w complement B, and A, and clear E,
respectively.
28
Hardwired Control
• The control receives five inputs: two from the external environment
and three from the data-processor.
• The control provides an output x for the external circuit.
• It also selects the operations in the ALU through the four selection
variables S2, S1, S0, and Cin.
• The other four outputs go to registers in the data-processor
29
Hardwired Control
• Control State Diagram
• The micro-operations that must be executed at a given state are specified
within the function box.
• The conditions for the next state transition are specified inside the decision
box or in the directed lines between two function boxes.
31
Hardwired Control
• Hardwired system can operate at high speed; but with
little flexibility.
• A hardwired control as the name implies, requires
changes in the wiring if the design has to be modified
or changed.
• Costly
• Difficult to implement complex instructions
• Example: RISC (Reduced Instruction Set Computer)
architecture
32
Microprogrammed control
• Control signals are generated by a program are similar
to machine language programs.
• The control signals associated with operations are
stored in special memory units inaccessible by the
programmer as Control Words (CW).
• A sequence of CWs corresponding to the control
sequence of a machine instruction constitutes the
micro routine for that instruction, and the individual
control words in this micro routine are referred to as
microinstructions.
• Micro-programmed control unit is slower in speed
because of the time it takes to fetch microinstructions
from the control memory.
33
Microprogrammed control
35
Microprogrammed control
• The micro programmed control unit consists of
following components.
36
Microprogrammed control
• Control memory: In micro programmed control, the micro
programs for all instructions are stored in the control memory (CM).
The control signals to be activated at any time are specified by a
microinstruction, which is fetched from Control memory (CM).
• Control address register : The control address register holds the
address of the next microinstruction to be read. When address is
available in control address register, the sequencer issues READ
command to the control memory.
• Microinstruction register : After issue of READ command, the
word from the addressed location is read into the microinstruction
register. Now the content of the micro instruction register generates
control signals and next address information for the sequencer.
• Micro-program sequencer : A sequence of one or more micro
operations designed to control specific operation, such as addition,
multiplication is called a micro program. The sequencer loads a new
address into the control address register based on the next address
information
37
Microprogrammed control
38
Microprogrammed control
Advantages
• 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 the design 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 its access circuitry.
39
Microprogrammed control
40
Microprogrammed control
41
Microprogrammed control
42
Horizontal and Vertical Microinstructions
• It is better to encode the microinstructions such that a group
of bits represent many control sequence, a particular pattern
of these bits represents a particular microinstruction.
• A horizontal microinstruction is a minimally encoded
scheme
• The scheme of micro-instruction by assigning one bit position
to each control signal is called horizontal micro-instructions.
Example: 011101001101001110
• In a horizontal microinstruction every bit in the control field
attaches to a controller. Horizontal microinstructions
represent several micro-operations that are executed at the
same time.
• A horizontal approach involves a wider control store, but is
capable of greater speed.
43
Horizontal and Vertical Microinstructions
•We can reduce the length of the horizontal micro-instruction
so easily by implementing another method known as
vertical micro-instructions
• Vertical microinstruction is a tightly encoded scheme
• The vertical approach requires a narrow control store, but
must be decoded in order to drive the actual control lines,
thus introducing a delay in driving the control lines.
44
Horizontal and Vertical Microinstructions
45
Micro program Sequencer
46
Micro program Sequencer
47
Micro program Sequencer
48
Micro program Sequencer
50
Advantages
• It can more systematic design of the control unit.
• It is simpler to debug and change.
• It can retain the underlying structure of the control
function.
• It can make the design of the control unit much
simpler. Hence, it is inexpensive and less error-
prone.
• It can orderly and systematic design process.
• It is used to control functions implemented in
software and not hardware.
• It is more flexible.
• It is used to complex function is carried out easily.
51
Disadvantages
52
Micro-programmed CPU Organization
53
Micro-programmed CPU Organization
54
Micro-programmed CPU Organization
55
Micro-programmed CPU Organization
• Microinstruction format contains six 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.
• The next 3 fields (MC, PS, DF) are for controlling micro-
operations 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.
56
57