A horizontal architecture eliminates gate delays and reduces clock cycle times by providing as many bits in each word of the control store as are necessary to manipulate the control lines, i.e., one bit per control line. A vertical control store seeks to minimize the width of the control store by adding combinational circuits, encoding values when selecting one-of-many related lines, and other techniques.
The Mic-1 is mostly horizontal, i.e., one bit per control line, but a few space-saving features commonly found in a vertical architecture are also implemented, most notably, the A, B, and C fields are encoded as 4-bit values which are each decoded using 4-to-16 demultiplexers near the register hardware.
tir := lshift( ir + ir ) ; if n then goto 19 ;
Take twice the instruction register (ir), left shift it, and store it in the temporary instruction register (tir). If the high-order bit of twice the instruction register (i.e., the second-highest-order bit of the ir) is set, then jump to instruction 19 in the control store.
Select the IR register on bus A by asserting the appropriate lines, select the IR register on bus B by asserting the appropriate lines, set the AMUX control line to select the A bus as the left input to the ALU, set the ALU function control lines to select the addition function, set the shifter control lines to select a left shift, enable the C bus, select the TIR register on the C bus by asserting the appropriate lines, set the inputs to the micro sequencing logic circuit to select the right input of MMUX if the ALU output N is true, and assert the value 19 (decimal) in the 8-bit address entering the right inputs to MMUX. Negate the WR, RD, MBR, and MAR lines.
LODD loads the value at a memory location into the accumulator, where the location is stored as the low-order 12 bits of the LODD instruction. This would be used to load a value from a global variable, for example. In MAL, this would be "ac := m[ x ] ;".
LOCO loads a constant value into the accumulator, where the constant is stored as the low-order 12 bits of the LOCO instruction. This would be used to place a constant into the accumulator, or perhaps the base-address of an array when computing the address of an array element. In MAL, this would be "ac := x ;".
LODL loads a value which is a specific distance from the stack pointer into the accumulator, where the distance is stored as the low-order 12 bits of the LODL instruction. This would be used to load a value from a local variable or procedure parameter, for example. In MAL, this would be "ac := m[ sp + x ] ;"
A typical call sequence might look like this:
For example, a simple program to calculate the 10th fibonacci
number an place it in memory location 100:
N = 5
A = 3
B = 2
C = 1
I = 0
M = 100
LOCO 10
PUSH
CALL FIB
POP
STOD M
HALT
FIB: INSP 4
LOCO 0
STOL A ;; a := 0
LOCO 1
STOL B ;; b := 1
LOCO 0
STOL I ;; i := 0
LOOP: LODL A
ADDL B
STOL C ;; c := a + b
LODL B
STOL A ;; a := b
LODL C
STOL B ;; b := c
LOCO 1
ADDL I
STOL I ;; i := i + 1
SUBL N
JNEG LOOP ;; if i < n goto loop
LODL B
STOL N ;; n := b
DESP 4
RETN
Copyright © 1997,
Ray Ontko
(rayo@ontko.com).
If you're curious about why I copyright, see
Peter Suber's
Why
Copyright Web Documents?.