We decided to do three extensions to this lab: we wrote several clever programs which utilize the accumulator, we allowed our circuit to take a one-line program as input from the dip-switches, and we wrote the entire program in VHDL.
The additional programs we wrote all use the conditional jump bit to create loops which we use in conjunction with the functions allowed by the accumulator. For example, one of our programs runs various accumulator functions, each for a set number of cycles, including adding a bit, subtracting a bit, and doing left and right shifts. Click here to see this program.
For the dip-switch extension, we modified the instruction register so that if a certain bit (called cds) is switched to 1, the instruction register will load a program from the dip-switches rather than from the program memory. This program can only be one line, and will be looped repeatedly until cds is switched to 0, thus the four bit address of the program does not actually affect the program. Note that the programs are created with a 13 downto 0 vector, so the 13th bit of the instruction should be wired to the first dip-switch in the sequence, and so on. Click here to see our instruction register.
Finally, we decided to write everything in VHDL, a process which turned out to often be easier than creating the circuit graphically. The parts of our lab which this affected were the light register and the circuit connections which we did with portmap statements. Click here to see the VHDL code for the light register and click here to see the code for the portmapping.
Click here to go to the previous part of the lab write-up.
Click here to go to the next part of the lab write-up.
Click here to return to the main menu.