Specifications of the Microinstructions
CPU Sim provides a variety of types of microinstructions that can be used in fetch sequences or execute sequences. Click on the type of a microinstruction below for help on that type. Note that every microinstruction must also have a name as described in Naming Formats.
|
Sign Convention
The sign convention used in CPU Sim is 2's complement. All arithmetic calculations and tests are done using this convention. Therefore, whenever a sequence of bits is displayed in decimal, that decimal value displayed corresponds to the 2's complement value of the bits. However, when the sequence of bits is displayed in binary or hexadecimal, the bits are treated as an unsigned integer value and so negative signs don't appear in the display. Floating point operations are not supported by CPU Sim.
Overflow and Carry
If an arithmetic operation results in a value that it too large (positive or negative), as a 2's complement number, to fit in the destination register, then the machine is in a state of signed overflow. When this occurs, a condition bit can optionally be set to 1. The choice of which condition bit (if any) to set for signed overflow can be specified in the Arithmetic and Increment microinstructions.
Similarly, if an arithmetic addition or subtraction microinstruction yields a value that results in a carry in or out of the destination register, then the machine is in a state of unsigned overflow. When this occurs, a condition bit can optionally be set to 1. The choice of which condition bit (if any) to set for unsigned overflow can be specified in the Arithmetic and Increment microinstructions.
Register Parts
Several microinstructions allow the user to specify parts of registers. In CPU Sim, the bits of a register are indexed from left (the most significant bit) to right (the least significant bit), starting with 0 and ending with one less than the width of the register. For example, if a register has 8 bits, the leftmost bit has index 0 and the rightmost bit has index 7.