Unit-2 Slides COA
Unit-2 Slides COA
Unit-2 Slides COA
ADD (R3), R1
Steps 1, 2 and 3. Fetch &
Increase PC
• PCout, MARin, Read, Select 4, Add, Zin
• Load the content of the PC into MAR, and send a read
request
• PCout, MARin, Read
• While waiting for a response, increment PC
• Select constant 4 in MUX
• ALU input B is receiving the current value in PC,
• Specify Add operation
• In step 2, move updated value back into PC and wait MFC
(Zout, PCin, WMFC)
• In step 3, the word fetched from memory is loaded into
IR
• MDRout, IRin
10
Steps 4, 5, 6
and 7
Step 4 and 5:
• Fetch the first operand: the content of the memory location pointed to by R3
• R3out, MARin, Read
• R1out, Yin, WMFC
Step 6:
• Perform the addition
• MDRout, Select Y, Add, Zin
Step 7:
• Load results into R1
• Zout, R1in, End
11
• Store R2,[R1]
MAR<-[R1]
MDR<-R1,
WRITE
WMFC
R2<-MDR
r
Control sequence for ADD (NUM),R1
Hardwired Control Unit
Hardwired Control
Unit
• We can design a circuit which can generate the signal
• The control unit (CU) is a component of a CPU that directs the
operation of the processor
• It tells the computer’s memory, ALU unit and I/P-O/P device-How to
respond to a program’s instructions?
• It direct the operations of the other units by providing timing and
control signals
• All computer resources are manages by the CU.
• It directs the flow of data b/w CPU and other devices.
• Control Unit generates the control signals to perform the
operations
• It also instruct ALU, which operation should be perform on data
Hardwired Control
Unit
• Control unit can be designed by two methods
Hardwired Control Unit
Microprogrammed Control Unit
Hardwired Control
Unit
• It is implemented with the help of physical components which is
hardwired (gates, flip flop, decoders) in H/W.
• The input to the control unit are the Instruction Register, Flags, Timing
Signals, Step Counter
• If designed is modified or changed, all the combinational circuits should
be modified which is a very difficult task.
• Hardwired CU is faster because control signals are generated using logic
circuit
• The sequence of operation carried out by this machine is determined by
wiring the logic elements so it is known as “Hardwired”
• The purpose of CU is to generate the signals, which will direct the
operations
Hardwired Control
Unit
• Block Diagram of Hardwired CU (Sequence Counter Method)
1. Instruction Register(I/P): It is used to store the instruction fetched
from the memory
2. Decoder: Used to decode(Interpret) the operation code of the
instructions
3. Clock: Used to generate a sequence of timing signals using timing
generator
4. Flags: Condition codes/status flags are used to specify the status of
previous ALU Operations
Hardwired Control
Unit
Hardwired Control
Unit register
Instruction
• The instruction register is
processors register that has a
‘instruction’ which is currentlythein
execution. The instruction register
generates the OP-code
bits respective of
the operation and the addressing
modes of the operands,
mentioned in the instruction.
• One of the i/p for the control unit
is IR(Instruction Register).
• In the Instruction Register we can
identify the opcode bits.
• Opcode bits tells about which
operation like ADD, LOAD,
MOV will be performed.
Hardwired Control
Unit
Instruction Decoder
• Instruction decoder receives
Op-code bits generated by the
instruction the
register and interprets the
operation and addressing
modes of the instruction.
• Now, based on operation and
addressing mode of the
instruction in
instruction register it set the
corresponding
Instruction signal
INSi to 1.
Hardwired Control
Unit
Step Counter
• Now, the control unit must be aware of the current
step, the instruction is in. For this, a Step Counter is
implemented which has signals from T1, …, T5. The
step counter sets one of the signals T1 to T5 to 1 on
the basis of the step, the instruction is in.
• Here, the question arises how step counter
knows
the current step of the instruction?
• It means you have to design a machine such that it
can generates
• For this, a stage
Clocksignal within 1CC.
is implemented. This clock
designed
is such that for each step the clock must
complete its one clock cycle.
So, consider if the step counter has set T3 signal
1(enabled) then after a clock cycle completes
step counter will set T4 to 1(enabled).
• There is a periodicity in instruction execution(Fetch,
Decode, Execute, Memory Access, Store). So it can be
synchronized with the Clock.
Hardwired Control
Unit
Step Counter
• Depends on the ‘Step Counter bit patterns’
control signal generator can understand what
is the situation, i.e. instruction
execution is in which state like fetch,
decode, execute etc.
NOTE:
• It means from the output of instruction decoder
we can understand the what type of instruction
we have to perform and from the o/p of step
counter step counter it can be understand
execution is in which state like fetch, decode,
execute etc.
Hardwired Control
Unit
Counter Enable
• What if the execution of instruction has is interrupted due
to some reason?
• Will the clock still continue to trigger step counter?
• The answer is No. The Counter Enable ‘disables’ the step
counter to increment to the next step signal, till
the execution of the current step is completed.
• E.g. Sometimes memory access phase may take 2CC. At
this time Counter Enable ‘disables’ the clock till
the Memory Function Complete. It means CC will
not be increase and all the signals will be stopped for
some time.
• Once Memory interface generates MFC Signal, it means
memory work is over then immediately counter enable
set to 1.
Hardwired Control
Unit
Condition Signal
• Now, suppose the execution of an
instruction depends on some condition
or if it is branch instruction.
• This is determined with the help of
the Condition signals.
• The Condition signals generate the signals
for the conditions greater than, less
than, equal, greater than equal, less than
equal etc.
• During ALU Operations, some conditional
signal is generated.
Hardwired Control
Unit
External Input
• The remaining is External inputs, it
acknowledges the control signal
generator of interrupts which affects
the execution of the instruction.
• Let us keyboard generates the interrupt
signals, it should also be
considered because based on this
execution flow is going to be affected.
Hardwired Control
•Unit
Wrt to given table, write circuit expression for generating signal for
bring the data from memory and keep into MDR . Let only during
the execution of operations LDA,ADD,AND instructions; read from
memory is required. Let Execution Cycle is done when PQ=11.
CYCLE MICRO-OPERATIONS CONTROL SIGNALS
• Here, each row represents the Micro operations (t0,t1,..) and the
columns represent the instructions.
• Here the hardware circuitry is designed for each column(i.e. for every
instruction) for producing control signals in different T-states.
Q. Consider a hypothetical CPU which supports only two
instructions.
Each instruction requires 5-micro operations. The
system employs 4 control signals S0, S1, S2 and S3.
Design the
Time circuit for
I1 S2. I2
T1 S0,S1 S0,S3
T2 S1,S2 S2,S2
T3 S1,S0 S1,S3
T4 S3,S3 S1,S2
T5 S1,S2 S1,S3
Q. Consider a hypothetical CPU which supports only two
instructions.
Each instruction requires 5-micro operations. The
system employs 4 control signals S0, S1, S2 and S3.
Design the
Time circuit for
I1 S2. I2
T1 S0,S1 S0,S3
T2 S1,S2 S2,S2
T3 S1,S0 S1,S3
T4 S3,S3 S1,S2
T5 S1,S2 S1,S3
• This instruction has to add the content of memory location X to Accumulator (A).
• Visit the memory location X
ADD X executional microprogram
• Get the content of X T1 : MAR IR(Reference)
• Perform the addition T2 : MDR
M[MAR] T3 : A
(A) +
(MDR)
Control Signals:
MAR(IN) ;
IR(OUT) ;MDR(IN)
;MDR(OUT)
Micro-program
Control Unit
• Control Memory is a ROM Chip that is used to store the control signals in
the form of micro-instructions.
Control Signals
Microinstruction1
Microinstruction2
Microinstruction3 Micro-Program
.
.
• In main Memory, instructions are
Microinstruction N
stored which is called a program.
• Similarly, In control Memory,
Control Memory instructions are stored which is
(ROM Chip) called as Microinstruction.
Micro-program
Control Unit
• A control memory is a ROM Chip which stores microinstructions as
control word.
• Microprograming is the art of writing microprogram (micro-code) for
the control unit of CPU.
• Each control word consist of micro-operations.
• Each micro instruction when executes, it generates a sequence of
micro-operations to fetch instruction from memory, calculate
effective address, fetch operand etc.
Microprogramming is
Dynamic
• Computer system whose control unit is implemented with a
microprogram in WCS(Writable Control Storage).
• Microprogram can be changed by a systems programmer or
a user.
Micro-program
Control Unit
• Microinstruction: Contains a control word and a sequencing word
Control Word :- Contains all the control information required for
one clock cycle.
• Sequencing Word :- Contains information needed to decide the next
microinstruction address Micro operation.
• A microinstruction contains one or more micro operations to be
completed.
Micro-program
Control Unit
Micro-program
Control
•
Unit
Now, we will discuss how control signals are generated using mP- control
unit design? Who is generating? How Address key is generated? etc.
• All micro instructions are already stored in the control memory. So how to
fetch these micro-instructions from control memory? We need
address to fetch any data/ instruction from memory?
• The general configuration of a microprogrammed unit is
control demonstrated in the following block diagram:
Micro-program
Control Unit
• Microprogram Sequencer: It is also called as Next Address Generator as it determines the address
of the next micro-instruction i.e. read from the control memory.
• The device or program that generates address of next microinstruction to be executed is called
sequencer.
• While the micro operations are being executed, the next address is computed in the next address
generator circuit and then transferred into the control address register to read the next
microinstruction.
• The location of the next microinstruction may be the one next in sequence, or it may be located
somewhere else in the control memory.
• Typical functions of a microprogram sequencer are incrementing the control address register by
one, loading into the control address register an address from control memory, transferring an
external address, or loading an initial address to start the control operations.
Micro-program
Control Unit
Control Memory: The Control Memory is actually a ROM Chip ,where all the
microinstructions are stored.
Control Data Register(CDR): It stores the micro instruction after reading from
control memory. The micro instruction when executed, it perform a set of
micro operation along with ; providing the address of the next instruction.
Micro-operation Fundamental
or basic operations that
are performed on the content of
register
e.g. MARPC
PCPC+1
Micro-program
Control Unit
Micro-Instruction Format
F1 F2 F3 CD BR AD
• The control signals are represented in the decoded binary format that is 1 bit/CS. Example: If 64 Control
signals are present in the processor then 64 bits are required.
• More than 1 control signal can be enabled at a time.
• It supports longer control word.
• It is used in parallel processing applications.
• It allows higher degree of parallelism. If degree is n, n CS are enabled at a time.
• It requires no additional hardware(decoders). It means it is faster than Vertical Microprogrammed.
• Flexible than Hard Wired
Types of Microinstruction
Format
10. Examples: Mainframe, Motorola 6800, Intel 8080 10. MIPS, ARM, SPARC, Fugaku