There are a few key pieces to TTP.
This refers to the circuit mainly contained in processorWDPC2.circ, alu.circ and regbank.circ, but excluding the content of the ROM component in the circuit.
This part of TTP consists of the following components:
The content of the ROM component consists of microcode “slices”. A slice is, essentially, a location in the ROM component. It is called a slice because it specifies exactly how the “body” of the processor should be considered at a particular slice of time.
The microcode “slices” form the lowest level of processor behavior. Each slice specifies how the various components of the “body” connect to perform a specific function.
Note that a slice is no more than a long sequence of bits, and each bit connects to some feature of the “body” of the processor.
The RAM component is the “consciousness” of the processor/computer. It contains both opcodes and run=time data. In a real computer, this is the portion that is programmable.
An opcode is a byte (8 bits) that is understood by the processor. It specifies a particular instruction. An opcode usually has a constant part that has to be a particular pattern of 0s and 1s, and a part that depends on the operands. An operand is a data component needed to specify the operation of an opcode. For example, if an opcode is to add, then the operands specify what numbers are being added.
Using the “opcode table” and the Assembler Manual, one can put opcodes together manually. However, this is a long and tedious process that is prone to human errors.
The assembler, currently in the form of a spreadsheet, is a tool so that a person can program in mnemonics instead of binary opcodes. A mnemonic is a somewhat symbolic name with symbolic representation of operands. This makes it easier for humans to write programs because it is easier to remember mnemonics than opcodes.
Another useful function of the assembler is to track locations of opcodes. The use of labels associates locations of a program with symbolic names. This means a programmer does not need to keep track of and count locations used by opcodes.
The assembler has an input of mnemonics, and an output of RAM content. The RAM content is loaded into the RAM component of TTP prior to execution.
Start with the components of the “body” of the processor. Make sure the function of each individual component is well understood. This can be achieved by reading the library reference and designing experiments to test what a component does.
Next, study the instructions. Each instruction specifies a particular operation. Start with ld, st and ldi, then move on to cmp, add, sub. Then move on to jmp, jmpi, and conditional jump instructions.
For each instruction, read the effect and think about what parts of the processor need to be connected in what way to get the job done. For example, add c,b needs to connect register c to one input of the ALU, but the output of the ALU should also connect to the input of register c. Register b connects to the other input of the ALU. Then, somehow, the ALU needs to perform the addition operation and outputs the result of the addition operation.
Knowing this is ultimately what needs to happen, now figure out how the components of the processor need to be connected.
The microcode slice of add c,b really is just mostly doing what you just figured out!
Single step (using control-T to change the state of the clock step-by-step) the processor to see how a simple instruction, such as ldi, operates. There are three distinct “cycles” to execute instructions:
Some instructions are more tricky to understand, these include the conditional jump instructions jxi and jx (where x is a placeholder of a flag), inc and dec.
Single step through the execution of these opcodes and observe how the processor gets the job done.
TTP is built on an open source platform. This means almost all components have the source code available for you to read and analyze.
The “body” of the processor in Logisim is the most important piece. You are expected to understand how the processor works by understanding the individual components.
The “instinct” of the processor is also open sourced, as this is just the content of the ROM component of the processor. Many opcodes are implemented, but you may be asked to implement additional ones with minor changes to the processor architecture.
There is a suite of C programs to generate the microcode slices in the ROM. these C programs are also open sourced so that you can see how the microcode slices are programmatically generated.
The assembler, being implemented as a Google spreadsheet, is inherently open sourced. You are not expected to understand the formulae of the assembler. However, you are expected to understand how to use the assembler to assemble your program.
Overall speaking, having most of the components of the TTP tool chain open sourced means you are expected to study and understand these components and their sources.