Some additional notes on the SAP-1


control point descriptions
CP : Count PC.  Increment the value of PC by 1: pc <- pc + 1
EP : Enable PC.  Put value of PC onto the bus: bus(3:0) <- pc
LI : Load IR.  Instruction Register gets value on the bus: ir <- bus
EI : Enable IR.  Put value of lower 4 bits of IR (the address) onto the bus: bus(4:0) <- ir(3:0)
LM : Load MAR.  Memory address register gets value on the low 4 bits of the bus: mar <- bus(3:0)
CE: Chip Enable.  Memory chip puts word stored at the address onto the bus:  bus <- M(mar)
LA : Load A.  Accumulator Register gets value on the bus: A <- bus
EA : Enable A.  Put value of A onto the bus: bus <- A
SU: Subtract Unit.  Tell the adder/subtractor unit to subtract instead of Add.
EU : Enable Unit.  Put value of the sum (or difference) from the adder/subtractor unit onto the bus: bus <- Z
LB : Load B.  B Register gets value on the bus: B <- bus
LO : Load Output.  Output Register gets value on the bus: O <- bus

NOTE: the transfer notes above (eg A<-bus) are not strictly register transfer notes because the bus is not a register and cannot store data.  register transfer notes must have some form of memory as the source and as the destination.  The bus is only a conduit.



cycle-by-cycle operation of the instruction "add"

part 1: fetch.
Step 1 (T1).  The first thing we need is an address to fetch the instruction from.  That address is stored in the PC, so we route the value in PC to the MAR, getting ready to address the memory.  mar <- pc.
Step 2 (T2).  Since the PC should always point at the next instruction to execute, we need to increment the PC at this point, so we add 1 to it.  pc <- pc + 1.
Step 3 (T3).  We now use the MAR to address the memory, putting the resulting instruction in the instruction register where we will use its various pieces. 
part 2: execute.
Step 4 (T4). The instruction tells us we are adding, so we need to get the data from the memory at the address stored in the instruction, and put that data into the B register.  Before we do that, we need to put the address from the instruction into the MAR so the memory has access to it.  mar <- ir(3:0)
Step 5 (T5).  now that the memory has access to the address, we use that address to get the data from memory, and put it into B.  B <- M(mar)
Step 6 (T6).  We want to add what's in B to what's in A, and put the result back in A.  A <- A+B.