Assignment 2


Demo: On or before February 10, 2006

1. Description

2. Instructions

Description

This assignment will instruct you on using the K and D Stamps to implement Gemini microcode. The microcode will follow the example code given in the KStamp9x.bs2 file in the GEMINI-UNIMPLEMENTED-MICROCODE directory. The instructions you will be implementing are: store, add with carry, add without carry, branch, and, or, not.

Instructions

The instructions code names, in order, are: stam, adcm, addm, brc0, brc1, andm , oram, notam. Let's take the load instruction as a template. Take a look at the columns at the top of the instructions. The OUT column is where you want data to go at the end of the current line. The LATCH position is data that you are bringing into the computer at this line. The MEM+ALU column is, the first part is what to tell the memory unit what to do, and the second part is what the ALU is going to do. The CYF+UPC column pertains to the carry flag and micro program counter. For the UPC column, you will always be using supc. The NEXT UPC column is pointing to where the next line of microcode is.

Therefore, the load instruction is translated as follows: I am putting nothing out, so the OUT column is blank; the LATCH is tied to the MDR, and I tell the memory unit to read, placing the read memory into the MDR. I do nothing with the ALU (nop); nothing with the carry flag (none), and I set the NEXT UPC to the next line. On the next line goes as follows: The MDR is going OUT, and is moved into the position that is LATCH'ed, which is TEMP. Therefore the contents of the MDR is moved into TEMP and there is nothing else that is needed to be done. And last we set the NEXT UPC to start, to start the Instruction Execution Cycle again.

The stam (store) instruction will be the opposite of this; taking the contents of TEMP and placing it into memory.

Both add instructions, and, or, all will follow the same pattern. You will read the contents of memory into A (another register). TEMP will be moved into the B register with the ACC register (use the "+" symbol), which you are then ready to use the ALU to do an add, or, and instructions. The ALU instructions for adding, or'ing, and'ing, and not'ing are as follows: gadd, gor, gand, gnot.

The MEM unit is controlled by a mread or mwrite instruction.

The CYF column, used in the addm and adcm instructions, are either cyz (carry flag zero), or cyf (carry flag).

The brc0 instruction is when the carry flag is zero, and the brc1 instruction is when the carry flag is one. You don't need to deal with the carry flag in these two instructions.

Note: The notam instruction is a one operand instruction.

Further Note: If your instructions don't match the same number (m25) as in the file, add in lines like line m25 to fill in the space.