This is a repository for CS21 - Part B
| Type | Opcode | Func 3 | 1st Bit Function | 2nd Bit Function | 3rd Bit Function |
|---|---|---|---|---|---|
| A | 00000 | 000 - 011 | 1st bit specifies the ALU Operation | 2nd bit is used for ALUSrcA (ACC or CF:ACC) | 3rd bit is ignored |
| B | 00000 | 100 - 111 | 1st bit specifices RegWrite, ~(1st bit) specifices MemWrite | 2nd bit specifies desired MemAdd | 3rd bit is ignored |
| C | 00001 | 000 - 011 | 1st bit specifies ALUSrcA (Either ACC or CF + ACC) | 2nd bit specifies ALUOp (+ or -) | 3rd bit is ignored (thus far, I haven't debugged this one yet) |
- 0000 is for rotation to the left
- 0001 is for rotation to the right
- There should probably be some trigger here so that the overflow bit can be outputted
- 0010 is for addition
- 0011 is for subtraction
- 0100 is for AND
- 0101 is for OR
- 0110 is for XOR
- 0111 is for rotation to the left WITH CF bit
- 1000 is for rotation to the right WITH CF bit
- 00 is for the ALU output
- 01 is for data-from-memory output
- 0 is for RB:RA
- 1 is for RD:RC
- 00 should be for the currently-read register at ACC
- 01 should be for Mem[MemAdd]
- 10 should be for CF + ACC (again, precompute this)
- 00 is for Mem[MemAdd]
- 01 is for the immediate that is entered
This is not implemented, but here's the idea:
- 00 is for fixed zero
- 01 is for fixed one.
- 10 is for the overflow / underflow bit from an ALU operation
- 11 is for the NBit that happens during a rotate ALU operation