Microprogramming Contest

Due anytime on Thurs, May 3

This is both a homework assignment and a contest. As a homework assignment it counts as three regular homework assignments! Thus it is the most important assignment. As a contest, a winner or winners will be named to try to honor those with the most creative and useful entries. The homework grade will be based primarily on correctness; the contest will be judged more on creativity and usefulness. There will be a small prize for the winner (probably awarded at the final exam).

The task is multifaceted: you are to design, implement, document, and test a new Mac-1 instruction. Try to aim for something useful and creative. Place everything in a file called mic037.txt. At the bottom of this file place comments describing your new instruction. In particular, give a 4-letter mnemonic for your new instruction, the binary encoding of it, its meaning in the usual Pascal-like pseudocode, and an explanation in words of what it does, including any constants or values that it uses. Thus, your description should give the opcode name, any parameters it takes, the meaning of the instruction, how it is encoded in binary, examples of usage (if not clear from the description), etc. The description should be a high-level description telling the Mac-1 programmer what this instruction does overall, not a detailed list of what the microcode does. Be sure to say where your instruction gets its data (if any) and where it places its answer (if any).

If you really want to you may add 2 instructions, but no more than that. Try to add an instruction that does something that the existing ones do not do, or uses a new addressing mode, or supports some high-level programming construct, etc. See below for some ideas.

To implement your new Mac-1 instruction you must modify the microprogram interpreter (near the end). There are some bit combinations available for your new instruction. For example, 1111 1101 xxxx xxxx could be used as long as you distinguish it from 1111 1100 xxxx xxxx in the decoding. Change the microprogram interpreter so that it correctly decodes both your new instruction and all of the old ones. You also have to include the microcode to execute your new instruction.

Suggestion: the easiest way to begin on this is to copy an example that added a new instruction. Thus you might begin by copying mic022.txt.

Devise a reasonable Mac-1 test program to check out your new instruction. Be sure to include a test of the nearby instructions, INSP and DESP, in case there are errors in your decoding. At the bottom of your file include the assembler version of your test program in the comment section. Also include in this comment section the MAL code (with line numbers) for those lines of the microprogram interpreter which you changed (or which you added).

Name your program file mic037.txt. Follow my format for such a file and place your Mac-1 code and documentation at the bottom of the file. Put your name as a comment at the top of the file. Remember that this is an individual assignment. Do not work together on this one. This one is your chance to show me what you can do. See me if you need assistance. Copy your file to your hw330-1 folder to submit your homework.


To help you in getting started, the following are some ideas for possible new Mac-1 instructions. Of course, it would show more creativity to design your own new instruction. But, if you need ideas, read on.


Instructor: Br. David Carlson