Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

Micro-programmed Control

Cotrol memory

Computer cotais three compoets:


CPU,I/O devices ad memory.

CPU agai cotais ALU(arthmetic logic uit),registers ad cotrol uit

Cotrol uit is geerally used to geerate cotrol sigals,so usig the cotrol sigal the cpu trasfer the data
etwee diffret register or instruct ALU to perform several operatio.

So it the role of control uit to execute the flow of the program execution.
Y geeratig the cotrol sigal it initiated the microperatios.

Generally we ca deign the control unit in two ways


1.Hardwired cotrol orgaisatio
2. microprogrammed cotrol orgaisatio

I hardwired cotrol organisation the logic will be build with the help of hardwire components example
flip flop,decoders,encoders

I microprogrammed cotrol orgaisatio the logic/sigal is uilt o the basic of programm/software.

So to design cotrol unit we need to develop mcro-prormam which is stored in control memory .

As control memory stores the microprogram ,an microprogram is a connection of microinstruction


And each microinstruction contains one or more microperationsn

So control memory is a ROM as read only memory we cannnot perform any write operation only read
operation
Once the control unit is designed with the help of microprogrmmed approach then do not contain any
chance of modification on the control unit because the control memory is designed as ROM

Then we have control address regiser as well as control data register ,as control address register
contains the address of microinstructions that is to be read from control memory .
Cotrol data register cotains data of instrution to be executed.

While the cpu is executing the data which is present in control data register simultaneously the next
address generator regenrates the next instruction address that is to be executed

We know that control data register contains some micro instruction and it also xontains some
additional bits in order to generates next instruction address.

So the sequencer generates the next instrction address so that that the address will bw stored in
control address register and the address of the next instructon is to be read from control memory and
to be stored in control data register .

As the control data regoster contain micro istructio ,microinstruction contain collection of cotrol
words ,next instructio address gennerator can be external device also..

So we can generate next address with the help of 4 approach


1. by incrementing address register
2. By conditional unconditional branch
3. Or by some external input
4. Or by subroutine call

Cotrol data register is also called pipeline register because of the execute of multipe task
simultaneosly in less amount of time .and also helps in next instruction address generation.with the
help of status its.

Address sequencing or micro program sequencing


Geerally we desig cotrol unit using two approaches
1. hardwired control unit
2. Micrprogrammed control unit

Here e are goig to discuss microprogramed cotrol unit


I this the cotrol logic is implemeted with the hel[ of software /progam so that microprogram is stored
in control memory
So cotrol memory cotis microprogram usefull for executig the cotrol unit as every icroprogram
contains collection of microinstruction and each microistructio contai one or more microperations

So while CPU is exectig current istructio address the we have to generate necxt instruction address so
tgis two task should be done simultneously

So generating the next address instruction simultaneously is called as address sequencing or micro
programm sequecer.

Here are four approaches:


1. Icrementing cotrol address register by one
Control address regiser cotain addres of micro-instruction that is to e stored I control register so to
icremet it we uses icremeter to icrease by 1
As multiplexer selects this approach

2.facility for suroutine call and return


A suroutine is a function normally used in a program .A subrotine is a collection of instruction which
are usefull I order to prform specific task .here we know that whenever a function is called thecontrol
goes to the function ddfinition ,all the statements in the function definition is executed ,when the
execution is over control goes to the next instruction of the main program so the next statement is
stored in subroutine register or the ddress of next return statement so based on the subroutine value
The control register value will be generated .

3.unconditional or conditional branch based upton the status bits


Without checking the condition the corresponding address will be generated in case of conditional
the condition is being checked thenonly the address is being loaded into the control address register.
So here we have to select the status bit here the branch logic check the stattus bit ,generally the
control memory contain the microinstruction and the microinstruction contains some conditional
bits ,branch bt ,status bit,so this is aout coditional rach based upon the status bits so the branch logic
will check whether the status condition is met or not id the staus condition is satisfied then the
corresponding address is loaded into the register if fale the incrementer increments the control
address register by one .

External mapping / Mapping the instruction..

For this purpose we are using instruction register ex 1011 and next is some address ,here we will do
some mapping on the opcode one this 4 bit we will do some mapping add one 0 to the left and two 0
to the right and in middle we have don’t cares this is done to generate some address so the next
instruction address is 0101100 the above steps is called mapping logic ( add one 0 to the left and two
0 to the right and in middle we have don’t cares this is called mapping logic ) and the multiplexer
transfer this address to the control address register.

So this are the steps we can generate address accordingly.

Micro-program Example
First let see about basic diagram of computer hardware configuration
Here we have two types of memory one is main memory and second is control
memory main memory is used for storing instruction and data ,there are four
registers which are associaed with main emory 1.data register 2. accumulator
3.address register 4.program counter here the size of the memory is 2048 words
where each word size is 16 bit .So 2048 means 2^11 so here 11 it are required to
specify the address ,actually till now we uses 12 bit to specify the address and 3 bit
for opcode where coming to the miccoprogram concept we are using 11 bits to
specify the address and 4 bit tomspecify the opcode ,so thr size of the address
register and progrm counter is 11 bits ,as size of the word is 16 bit so size of the data
refister is 16 bit as well as size of accumulator is 16 bits .

For control memory .It is used to store the micrprogram there are two register
related to control memory 1.is subroutine register(SBR) 2 .control address register
(CAR) here the size of the control memory is 128 words so 2^7 so 7 bit are required
to specify the address of the subroutine register as well as control register ,here size
of the instruction is 20 words .

Here we are using multiplexers in order to transfer the information among the
register ,generally in order to transfer the information we uses common bus system
or multiplexer in this we are using multiplexer I order to transfer information among
different register .
Data register receives information from three ways
1. Address register
2. Main memory
3. Accumulator
And multiplexer transfer information from this four to the data register

Address register receives information from two ways:


1. Program counter
2. Main memory

Program counter receives information from address register.

So the memory receives address from the address register

Arithmetic Logic and shift unit performs operation on content of Data register and
Accumulator and the correspodig result is being transferred to accumulator

Control address register(CAR) receives information from the address register


So this is the block diagram of computer.

Machine instruction format

So we kow the size of the instruction format is 16 bits in which we uses 11 bits in order to specify the
address ,4 bit for opcode and 1 bit for indirect mode so e can define totally 2 ^4 operations ,out of 16
operaions we are demonstratig 4 operations.
1. Add operation
2. Branch operation 3. store 4. exchange

Here the opcode for ADD is 0


Opcode for branch is 1
Opcode for store is 2
Opcode for exchange is 3
1. ADD operation is used to add the data in the accumulator and the operand which is present in the
memory.M[EA] EA is the effective address.
2. For branch if the content of the accumulator is negative then the effective address is transferred to
the program counter.When can we say accumulator is negative whee most significant bit (sign bit) is 1
3. Store means store the content of the accumulator to the memory M[EA].
4. Exchange M[EA] is transferred to the AC and AC is transferred to M[EA]

Microinstruction format.

Control unit contains control memory ,control memory control micro-program ,micro-program
contains several microinstruction .
Here the size of the micrinstruction is 20 bits in order to specify the address e uses 7 bit.because 128
means 2^7 .

Here microinstruction format can be divided into 4 fields .


1. first field is 3 functional field (microooperation field)
2. Condition field
3. Branch field
4. Address field

1. Microoperation are divided into 3 fields F!,F2,F3 where size of each is 3 bits
2. Conditional field uses 2 bits in order to store condition
3. BR specifies the branch 2 bits used so the corresponding control goes to this address
4. AD field specifies the address.

now let see about microoperation field .


As 3 bit each can perform 8 operation but 00 performs no operation so 7 operation each means 21
operations.
2.Condition field
Symbolic microinstruction
Our target is to write micro-program ,micro-program means connection of microinstruction ,each
microinstruction is written with the help of symbols,totally we uses five symbol.
1. label:it means some name ADD is one label,branch is another label,store is another label,
2. Microoperations-- F1,F2,F3 microoperations total 21 operations
3. Condition bits:unconditional branch,indirect address bit,sign of AC,zero value in AC
4. In branch we have :JUMP ,CAALL,RETURN,MAP.Address specifies what instruction to be specified
next.
FETCH ROUTINE:
+

Symbolic micro-program
Micro-program means collection of microinstruction
Each microinstruction should contain five field:
1. label,2.microoperation,3.condition field,4.branch field,5.Address field.
Design of Control Unit
Micro-programmed control unit
As micro-program cosist of microinstruction so microinstruction F1,F2,F3 each 8 operation
In addition to F1,F2,F3 we have condition field,branch field,address field
Size of F1,F2,F3 is 3 bits ,it is decoded by 3*8 decoder As decoder has advantage that it takes n input
and produces 2^n output as 1 doesn’t cannot have any operation so total 7 operation ,same for F2
but for F3 we have one more reserved operation so total 6 operation.So total 20 operation but out of
20 operation we are demonstrating only 5 operations we have not any operation from F2 so only
from F1 and F2 .

So In F3 we chooses output line 3 and given to ALU and it performs AND operation with accumulator
And corresponding result is transferred to AC .

Let assume F1 means arithmetic operation,F2 means Logic operation,F3 means shift operation
We uses Load when the load is on corresponding result is transferred to Accumulator.

For F1 we take output 1 and transfers to ALU and ADD operation is performed on Accumulator and
content is transferred to accumulator when load is on.

When the F1 6(110) is activated then corresponding program counter is transferred to address
register.

When the F1 5(101) is activated then corresponding data register is transferred to address register.

As the multiplexer is used for the F1(5) and F1(6) 0 for F1(6) ad 1 for F1(5).

Micro-program Sequencer
1. The basic components of a micro programmed control unit are the control memory and the
circuits that select the next address. The address selection part is called a micro-program sequencer.
2. The purpose of a microprogram sequencer is to present an address to the control memory so that
a microinstruction may be read and executed.
3. The next-address logic of the sequencer determines the specific address source to be loaded into
the control address register. The choice of the address source is guided by the next-address
information bits that the sequencer receives from the present microinstruction.
4. The block diagram of the microprogram sequencer is shown in Fig. 7-8.The control memory is
included in the diagram to show the interaction between the sequencer and the memory attached to
it.
5. There are two multiplexers in the circuit. The first multiplexer selects an address from one of four
sources and routes it into a control address register CAR.
6. The second multiplexer tests the value of a selected status bit and the result of the test is applied
to an input logic circuit.
7. The output from CAR provides the address for the control memory.
8. The content of CAR is incremented and applied to one of the multiplexer inputs and to the
subroutine register SBR.
9. The other three inputs to multiplexer number 1 come from the address field of the present
microinstruction, from the output of SBR, and from an external source that maps the instruction.
10. The CD (condition) field of the microinstruction selects one of the status bits in the second
multiplexer. If the bit selected is equal to 1, the T (test) variable is equal to 1; otherwise, it is equal to
0. The T value together with the two bits from the BR (branch) field go to an input logic circuit.
11. The input logic circuit in Fig. 7-8 has three inputs, l0, l1, and T, and three outputs, S0, S1, and L.
12. Variables So and S, select one of the source addresses for CAR.
13. . The binary values of the two selection variables determine the path in the multiplexer.
14. The bit values for 51 and So are determined &om the stated function and the path in the
multiplexer that establishes the required transfer. The subroutine register is loaded with the
incremented value of CAR during a call microinstruction (BR ; 01) provided that the status bit
condition is satisfied (T ; 1). The truth table can be used to obtain the simplified Boolean functions for
the input logic circuit:

You might also like