The LoPROC is a single cycle 32-bit micro-processor with very low power consumption. The processor is optimized from the instruction encoding stage to reduce the size and increase the performance of the instruction decoder.
There are 2 types of instructions:
- N-Type - Normal Type: These are instructions performed on register/ memory values.
- I-Type - Immediate Type: These instructions are performed on immediate values.
The values for the instructions are chosen such that the decoding logic is not complex.
SRC2-sel will be 0 for N-type Instructions
SRC2-sel will be 1 for I-type instructions
MODE:
- 00 - Memory operations/ Jump/ Function calls
- 01 - Shift/ Rotate Operations
- 10 - Multiplication
- 11 - ALU Operations
The ALU is based on the HACK ALU developed by Noam Nisan and Shimon Schocken.
- INT: Sets when Interrupt occurs
- SE: Sets when stack is empty
- SF: Sets when stack is full
- DBZ: Sets when there is a division by zero
- Z: Zero - Sets when ALU output is zero
- N: Negative - Sets when ALU output is negative
- ODD: Sets when ALU output is odd
- P: Parity flag – sets when ALU output has odd number of 1s
- OV: Overflow – sets when overflow occurs
- C: Carry – sets when there is a carry
- User: User flag – can be defined by user
- IE: Interrupt Enable – Needs to be set to enable interrupt
- RS1, RS0: Register Bank Select – Selects one out of the four register banks
- 2 flags are reserved
The multiplier runs on optimized add-shift algorithm. The add-shift algorithm checks all the bits and shifts when the bit is 1. This algorithm used encoder-decoder duo to check which bits are 1, and performs the shifts.
The shifter is a fully combinational universal logic. It can perform all the rotation, shifting operations.