We begin the designing our own processors! Working in pairs, you will design your own instruction set and then a CPU to support it. This week, you will begin to lay the groundwork...
Notice that the MIPS instruction set dictates some aspects of how a datapath and control can be built to implement. Thus, it is really refered to as an instruction set architecture (ISA), defining the available operations, the machine code format for each instruction, the number of available registers, etc.
Your first task is to design your own ISA, knowing that later you will build a processor to implement it. In order to design your ISA, there are a number of important considerations:
Word size: You should use 8-bit words. 4-bit words would be too restrictive, and 16-bit ones would require way too many wires.
Number of registers: There should be at least 3 registers (so that one instruction can specify two source and one destination register), but I would not recommend more than 8 (too many wires and chips). Using more registers requires some more wiring, but it also makes programming easier.
Instruction length: You will likely find that single-word instructions are too small, and that an instruction will need to be two or more words long. For example, consider something like an R-type instruction where you must specify an opcode and three registers -- would those bits fit into a single word? Also consider that for some instructions, you will need to have space for some kind of immediate value. How many bits will be used to represent those immediate values, and what does that choice imply for the range of those values?
Instruction format: Of course the main work in creating an ISA is determining what bits go where and for which opcodes. You must fully specify the bit layout for the machine code representation of each possible instruction.
Be sure, as you make choices for these (and likely other) issues that you keep in mind how your datapath will be constructed. With a carefully considered ISA design, you will find it easier to connect and control the CPU components.
So which operations should your CPU be able to perform? Below there are two lists: the first specifies the operations that your CPU must support, and the second specifies those that you may optionally add to your ISA.
Arithmetic/logical:
Branching:
Main memory access:
Arithmetic/logical:
Branching:
When it comes time to build your processor, there are some requirements on how it must be done:
After you design your ISA and you begin then to design your datapath and control, you are likely to want to change aspects of your ISA. You are welcome to do that. Nobody can create a good abstract specification without some experience in trying to implement it, and so I expect your ISA to change.
Also note that there are some issues that we are currently ignoring. For example, if an arithmetic operation causes an overflow, what should your processor do? For the moment, ignore such issues -- we will address them in lecture and then determine how to incorporate them into your design.
This week, you have the following goals: