Hardware Reference
In-Depth Information
instruction stream use PC / MBR and are indicated by fetch in the microinstructions.
Both kinds of memory operations can proceed simultaneously.
However, the same register may not receive a value from memory and the data
path in the same cycle. Consider the code
MAR = SP; rd
MDR=H
The effect of the first microinstruction is to assign a value from memory to MDR at
the end of the second microinstruction. However, the second microinstruction also
assigns a value to MDR at the same time. These two assignments are in conflict
and are not permitted, as the results are undefined.
Remember that each microinstruction must explicitly supply the address of the
next microinstruction to be executed. However, it commonly occurs that a
microinstruction is invoked only by one other microinstruction, namely, by the one
on the line immediately above it. To ease the microprogrammer's job, the micro-
assembler normally assigns an address to each microinstruction (not necessarily
consecutive in the control store) and fills in the NEXT ADDRESS field so that
microinstructions written on consecutive lines are executed consecutively.
However, sometimes the microprogrammer wants to branch away, either un-
conditionally or conditionally. The notation for unconditional branches is easy:
goto label
can be included in any microinstruction to explicitly name its successor. For ex-
ample, most microinstruction sequences end with a return to the first instruction of
the main loop, so the last instruction in each such sequence typically includes
goto Main1
Note that the data path is available for normal operations even during a micro-
instruction that contains a goto . After all, every single microinstruction contains a
NEXT ADDRESS field. All goto does is instruct the microassembler to put a specif-
ic value there instead of the address where it has decided to place the microinstruc-
tion on the next line. In principle, every line should have a goto statement. As a
convenience to the microprogrammer, when the target address is the next line, it
may be omitted.
For conditional branches, we need a different notation. Remember that JAMN
and JAMZ use the N and Z bits, which are set based on the ALU output. Sometimes
we need to test a register to see if it is zero, for example. One way to do this would
be to run it through the ALU and store it back in itself. Writing
TOS=TOS
looks peculiar, although it does the job (setting the Z flip-flop based on TOS ).
However, to make microprograms look nicer, we now extend MAL, adding two
new imaginary registers, N and Z , which can be assigned to. For example,
 
Search WWH ::




Custom Search