| Command |
3-bit Instruction |
4-bit Data |
Description |
| 1. Init |
000 |
XXXX |
Initialize all registers, ie R1=R2=R3=(0,0,0,0) |
| 2. Move1 |
001 |
aaaa |
Put aaaa value into register R1 |
| 3. Move2 |
010 |
bbbb |
Put bbbb value into register R2 |
| 4. Store |
011 |
XXXX |
take the previous result in R3 and store into register R2 |
| 5. Add |
100 |
XXXX |
Add contents in R1 and R2. Present the result at R3 and output overflow flag |
| 6. Shift |
101 |
aaXX |
Take the content in R2 and left shift by aa bits, then store the result in R3 |
| 7. Comp |
110 |
XXXX |
Compare the contents of R1 and R2. The flag bit is true if R1 is greater than or equal to R2. Otherwise it is false |
| 8. Mask |
111 |
XXXX |
Mask (AND-ing) R1 and R2. Present the result in R3 |
* For 4-bit data, X is Don't Care.