Functional Description
The user of the ALU must do the following:
- Drive input pins
- Provide STROBEA signal to latch input A into register A
- Provide STROBEB signal to latch input B into register B
- Drive opcode pins
- Provide STR_OP signal to indicate that the opcode is active and stable
- Wait for the OE signal
- Read the output values on OE signal going HIGH
- Repeat the above steps for the next operation
Design Choices
It should be noted that we have only eight input pins. The user should
load A and B operands sequentially by providing STROBEA and STROBEB
signals. On the output side we provide nine pins including the Carry
Out (CO) pin for the ADD operation. For the MULTIPLY operation we
provide the 16 bit output in two stages. The MULTL instruction
triggers the actual MULTIPLY operation and provides the lower byte of
the result on completion. The higher byte (whic h is latched in the
output register) can be retrieved using the MULTH instruction.
Opcode table
Opcode | Operation | Inputs | Cycles |
0000 | AND | A,B | 1 |
0001 | NOT | A | 1 |
0010 | MULTL | A,B | 16 |
0011 | XOR | A,B | 1 |
0100 | ADD | A,B | 1 |
0101 | SUB | A,B | 1 |
0110 | OR | A,B | 1 |
0111 | MULTH | | 1 |
1000 | SL0 | A,B | 1 |
1001 | SL1 | A,B | 1 |
1010 | RL | A,B | 1 |
1100 | RR | A,B | 1 |
1101 | ASR | A,B | 1 |
1110 | SR0 | A,B | 1 |
1111 | SR1 | A,B | 1 |