Computer Architecture : Lab 1

by Jeffs Billion and Kaufman

In this lab we implemented a circut to take instructions from ROM to manipulate two registers. The first register was designed to be an accumulator and be for intermediate calculations while the second controled an 8-light array. After we finished writing the circut in VHDL we downloaded it to an ALTERA board so it could control actual lights.

Our circut is similar to a computer but is most limited by its lack of RAM, small ROM, and small instruction length. The limitations can be seen by our troubles in trying to get our circut to count efficiently with the LEDs.

We wanted at one point to write a clock that counted from 0 up to 99 on the board's two LCDs, but because we only had two registers and they both had to be visible to the user, we would have needed to modify the hardware to count properly. Even if we had done that, the first problem we would have had was that because the contents of the accumulator would be visible to the user, we couldn't use it for intermediate results. Adding a second light register would also have been difficult as we'd have to increasing the length of the instructions and add many more opcodes. So we decided to count only to 9. But even then there were problems, because generating human-readable digits in the accumulator doesn't seem to be possible. We could have put a lookup table in for the digits in ROM and then jumpped to addresses held in the accumulator, but we didn't have an opcode for that and even then we would have had trouble because the lookup table would need to have been able to jump back properly. We could have then added another register to hold the "jump back to" address, but it would have added a lot of complexity. So we decided we were happy with a circut that counted in a hardcoded way.

We tested our circut first in the simulator as we wrote it and then via visual inspection after loading it onto the board. Upon loading and reseting the circut, the lcd display prints the numbers zero to nine. This program demonstrates that our instructions are being properly read and excecuted, that the clock divider is properly set up to bring the lights to a watchable speed, and that the lights are properly connected to the ALTERA board's outputs.

This lab could best be improved in two ways. First, there are a few places in the instructions where the names of registers are inconsistent. Specifically, at one point the registers were refered to as A and B; however, they later, as per our interpretation, were the same as the light and accumulator registers. Morover, the final circut selector option (code 11) mentions a "data register". It was unclear whether it meant the accumulator or the data field of the IR. We took it to mean the accumulator, though other groups understood it as the IR. Lastly, if the length of the ROM were increased to 64 lines more instructions could be programmed and consequently more interesting programs could be implemented.

Our VHDL code for this lab can be found in this directory, in the following files, all with extention vhd:


Jeff Kaufman : 2005
cbr at sccs dot swarthmore dot spam edu. Remove spam.

main page