Homework 1
Due Sunday, January 24

In this homework you will use Chipmunk (diglog) to implement the simple computer described in the last section of our class material "Digital Logic---the Bare Minimum."

To keep things simpler, we will make several changes: Word size (register and ALU operand size) is 2 bits; address size is 4 bits; there are 4 registers; the op codes are

000      dst = src1 + src2
001      dst = src1 - src2
010      dst = src1 AND src2
011      dst = NOT src1
100      if N go to branch target
101      if Z go to branch target
110      go to branch target

It is required that you design and use the following diglog modules in your work:

Use 2 SRAM8K chips for your program memory. Enter your test programs using the "configuration" method described in the Chipmunk mini-manual.

Use a Digital Pulse Generative Switch for your clock. Use as many clock cycles per instruction as you like (though one cycle is enough).

Again, all of the above specifications, including the modularization, are required. The purpose of requiring this is to achieve enough of a level of uniformity to make life easier for the TA (since some of you will be coming to him for help in debugging, this uniformity will make it easier for him to help you) and the Reader (for whom the uniformity will make grading easier).

Make sure you test your design well; write your test programs in a way which will make for a thorough testing of your system. Be ready for anything, since you do not know what programs the Reader will use to test your circuit with.

Note: Unless you add logic to your REG module which allows you to manually load constants into a register before running a program (which is fine, if you wish to do this), then all your registers will contain 0s---which would not make for a very interesting test of your circuit! So you need to make sure that your test program works with some nonzero values in the registers, and to do this you will need to write the first few instructions in your program in a way that will generate some nonzero values. For instance, you can apply a NOT instruction to a register which contains 00 to produce the value 11. Adding this register to itself yields 10, etc.