Variable-length instructions
This short section provides ideas for experimentation with instructions and their formats and extends your understanding of instructions, their structure, and the trade-off involved in creating instruction sets. It is not designed to illustrate a real computer.
Like many computers, TC1 has fixed-length fields in its opcode; that is, the number of bits dedicated to each field is fixed and does not vary from instruction to instruction. There are always 16 bits in the literal field, even if the current instruction does not require a literal. Wasteful indeed. Since the purpose of TC1 is experimentation, we demonstrate how you might make the number of registers variable (i.e., user-definable). Adding more registers speeds up computation by requiring fewer memory accesses. However, there is a price; where do you get the extra bits that would be needed to specify the registers? Do you take the extra register bits from the opcode field (reducing the number of...