CS 232: Lab 5

Lab 5: Machine instructions

The purpose of this lab is to go over the new design for a
programmable light display. The new design has a more complex
instruction set that enables more general purpose programs.

Tasks

The project this week involves designing a more general programmable
circuit. The conceptual organization of the circuit is shown below.

The program is stored in the ROM. The accumulator and light register
are general purpose 8-bit registers. The IR holds the current
instruction, and the PC holds the address of the next instruction.

We will implement four types of instructions for this circuit: move,
binary operations, unconditional branch, and a conditional branch.
The move instruction will copy bits from a source to a destination.
The binary operations will execute some binary operation on two source
operands and write the result to a destination. One of the source
operands will also be the destination. The unconditional branch will
write an address value from the IR to the PC. The conditional branch
will write an address value from the IR to the PC if the selected test
register (ACC or LR) is equal to 0.

The instruction set for this machine will be 10 bits. The two
leftmost bits will specify the type of instruction. The remaining bits
will specify the rest of the required information. The table below
shows the organization of the four instructions.

Load an alternating series of bits, 10101010 into the light
register. Then make the register switch back and forth between
10101010 and 01010101 eight times. The program should then
return to the beginning.