Microprogramming Contest

This is both a homework assignment and a contest. As a homework assignment it counts as 5 percent of the course grade. 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.

This is an INDIVIDUAL assignment. Students should not work together in any fashion on this assignment. You are to invent and implement your own Mac-1 instruction or to choose and implement one from the list of suggestions given under the link at the bottom of this page. Your choice must be approved by the instructor. This is to be sure that each person is working on a different instruction. The first person that asks for a particular instruction will get it. To ask to work on a particular instruction, send an email to your instructor with the name of your instruction along with a description of where it gets its data, what it does with this data, and where it places its results.

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 mic300.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 mic300.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 folder to submit your homework.

If you need ideas for possible new microinstuctions, check this list. However, it shows more creativity to design your own.


Instructor: Br. David Carlson