Digital Signal Processing Reference
In-Depth Information
1
+
register file
R0
R1
addr
bus
3
Microprogram Memory
8
0
R7
ALU
cond 0
cond 1
3
3
data bus
parity
bit
2
cond
sel
branch
addr
cntr
signals
ALU status
1
Z
N
to datapath
11
8
1
1
from datapath
Figure 10.13 Example to illustrate complete working of a micro-programmed state machine design
the status register. These two bits are used as cond_0 and cond_1 bits of the controller. The design
supports a program that uses the following set of micro-codes:
Ri = Rj op Rk, for i,j,k = 0, 1, 2, ..., 7 and op is any one of the four supported ALU
operations of +, -, AND, OR, an example micro code is R2 = R3 + R5
if(N) jump label
if(!N) jump label
if(Z) jump label
if(!Z) jump label
jump label
Thesemicro-codes control the datapath and also support the conditional and unconditional branch
instruction. For accessing three of eight registers R i , R j and R k , three sets of 3 bits are required.
Similarly, to select one of the outputs from four ALU operations, 2 bits are needed. This makes the
total number of bits to the datapath 11. The label depends on the size of the PM: to address 256words,
8 bits are required. To support conditional instructions, 2 bits are required for conditional
multiplexer selection and 1 bit for the parity. These bits can be linearly placed or can share fields
for branch and normal instructions. The sharing of fields saves on instruction width at the cost of
adding a little complexity in decoding the instruction. In cases of sharing, 1 bit is required to
distinguish between branching and normal ALU instructions.
The datapath and the micro-programmed state machine are shown in Figure 10.12. The two
options for fields of themicro-code are shown in Figure 10.13. Themachine uses the linear option for
coding the micro-codes.
10.4 Subroutine Support
In many applications it is desired to repeat a set of micro-code instructions from different places in
the micro-program. This can be effectively achieved by adding subroutine capability. Those micro-
code instructions that are to be repeated can be placed in a subroutine that is called from any location
in the program memory.
Search WWH ::




Custom Search