It uses a fixed-width 16-bit instruction format.
Each instruction contains four 4-bit fields:
15 12 11 8 7 4 3 0
+---------------+----------------+---------------+---------------+
| OPCODE | RD | RS2 | RS1 |
+---------------+----------------+---------------+---------------+
4 bits 4 bits 4 bits 4 bits
The opcode determines the operation performed by the processor.
The register fields identify the destination and source registers where applicable.
The current processor implements 14 instructions.
| Opcode | Instruction | Type | Description |
|---|---|---|---|
0000 |
ADD | ALU | Add two operands |
0001 |
SUB | ALU | Subtract two operands |
0010 |
AND | ALU | Bitwise AND |
0011 |
OR | ALU | Bitwise OR |
0100 |
XOR | ALU | Bitwise XOR |
0101 |
NOT | ALU | Bitwise NOT |
0110 |
SHL | ALU | Logical left shift |
0111 |
SHR | ALU | Logical right shift |
1000 |
SLT | ALU | Set if less than |
1001 |
EQ | ALU | Equality comparison |
1010 |
MOV | Data | Move operand |
1011 |
RESERVED | — | Reserved opcode |
1100 |
RESERVED | — | Reserved opcode |
1101 |
NOP | Control | No operation |
1110 |
JMP | Control | Jump to target |
1111 |
HALT | Control | Halt execution |
Implemented instructions : 14 / 14
Instruction coverage : 100%
Reserved opcodes : 2
The processor contains 16 registers:
R0
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13
R14
R15
Each register is 16 bits wide.
A register is selected using a 4-bit register address:
0000 → R0
0001 → R1
0010 → R2
...
1111 → R15
0000
RD = RS1 + RS2
Conceptually:
R[RD] ← R[RS1] + R[RS2]
Example:
ADD R2, R0, R1
Encoding:
0000 0010 0001 0000
0x0210
The ADD operation can update the relevant status flags.
The verification environment explicitly tests:
- Normal addition
- Carry-out
- Zero result
- Negative result
- Signed overflow
- Boundary values
- Walking-bit patterns
- Random operands
0001
RD = RS1 - RS2
Conceptually:
R[RD] ← R[RS1] - R[RS2]
Example:
SUB R2, R0, R1
Encoding:
0001 0010 0001 0000
0x1210
SUB verification includes:
- Normal subtraction
- Borrow cases
- Zero result
- Negative result
- Signed overflow
- Boundary values
- Random operands
0010
RD = RS1 & RS2
Example:
AND R2, R0, R1
0011
RD = RS1 | RS2
Example:
OR R2, R0, R1
0100
RD = RS1 ^ RS2
Example:
XOR R2, R0, R1
0101
RD = ~RS1
The operation performs a bitwise inversion of the first source operand.
Example:
NOT R2, R0
0110
RD = RS1 << RS2
The current implementation uses the relevant lower bits of the shift operand.
The verification environment tests all shift amounts:
0 through 15
Coverage:
SHL amounts : 16 / 16 = 100%
Example:
SHL R2, R0, R1
Encoding:
0110 0010 0001 0000
0x6210
0111
RD = RS1 >> RS2
The verification environment tests all shift amounts from 0 through 15.
Coverage:
SHR amounts : 16 / 16 = 100%
Example:
SHR R2, R0, R1
Encoding:
0111 0010 0001 0000
0x7210
1000
RD = (RS1 < RS2) ? 1 : 0
The result is:
0x0001
when the comparison is true, and:
0x0000
when the comparison is false.
Both true and false comparison cases are included in functional coverage.
1001
RD = (RS1 == RS2) ? 1 : 0
Result:
0x0001 → equal
0x0000 → not equal
Both equality outcomes are covered by the verification environment.
1010
RD = RS1
Conceptually:
R[RD] ← R[RS1]
Example:
MOV R2, R0
The source value is copied to the destination register.
Two opcode values are currently reserved:
1011
1100
These opcodes do not represent implemented instructions.
The processor treats them safely as operations that do not produce unintended register writes.
The verification environment explicitly tests both reserved opcode values with multiple register-field combinations.
Coverage:
Reserved opcodes tested : 1011 / 1100
1101
NOP means No Operation.
No architectural register update is performed.
Conceptually:
No operation
The verification environment confirms that NOP does not modify:
Registers
Flags
The Program Counter continues according to normal processor control.
1110
JMP changes the normal sequential program flow.
Instead of continuing with:
PC + 1
the processor loads the jump target defined by the current instruction encoding.
The verification environment tests:
- Forward jumps
- Backward jumps
- Jump to address 0
- Self-loop
- Jump chains
- All targets from 1 through 15
- Ignored non-target instruction bits
Example control-flow sequence:
PC 0
|
+---- JMP 7
|
v
PC 7
|
+---- JMP 2
|
v
PC 2
1111
HALT stops normal processor execution.
When the processor reaches HALT, the Program Counter remains frozen.
The verification environment confirms that HALT freezes:
PC
Registers
Flags
HALT is also tested with execution enabled and disabled.
HALT at address zero is separately verified.
The processor currently uses four status flags.
| Flag | Name | Description |
|---|---|---|
| CF | Carry | Indicates carry/no-borrow condition |
| ZF | Zero | Indicates zero result |
| NF | Negative | Indicates negative result |
| VF | Overflow | Indicates signed arithmetic overflow |
For addition, CF represents carry-out from the most significant bit.
For subtraction, the implementation verifies the corresponding no-borrow/carry convention.
The verification environment includes dedicated carry and borrow tests.
ZF indicates whether the resulting ALU value is zero.
Result = 0 → ZF = 1
Result ≠ 0 → ZF = 0
NF reflects the sign bit of the 16-bit result.
Result[15] = 1 → NF = 1
Result[15] = 0 → NF = 0
VF indicates signed arithmetic overflow.
The verification environment checks overflow for both:
ADD
SUB
including signed boundary cases.
Instruction:
ADD R2, R0, R1
Encoding:
0000 0010 0001 0000
Hex:
0x0210
Instruction:
SUB R2, R0, R1
Encoding:
0001 0010 0001 0000
Hex:
0x1210
Instruction:
SHL R2, R0, R1
Encoding:
0110 0010 0001 0000
Hex:
0x6210
Instruction:
SHR R2, R0, R1
Encoding:
0111 0010 0001 0000
Hex:
0x7210
The current ISA can be grouped into four functional categories.
ADD
SUB
AND
OR
XOR
NOT
SHL
SHR
SLT
EQ
MOV
NOP
JMP
HALT
Reserved:
1011
1100
The current verification environment achieves complete instruction coverage for the implemented ISA.
Instruction Coverage
====================
ADD : PASS
SUB : PASS
AND : PASS
OR : PASS
XOR : PASS
NOT : PASS
SHL : PASS
SHR : PASS
SLT : PASS
EQ : PASS
MOV : PASS
NOP : PASS
JMP : PASS
HALT : PASS
Total:
14 / 14 = 100%
Register-field coverage:
Destination registers : 16 / 16
RS1 registers : 16 / 16
RS2 registers : 16 / 16
Shift coverage:
SHL:
0–15 → 16 / 16
SHR:
0–15 → 16 / 16
The current instruction set provides the basic functionality required by the verified processor:
16-bit arithmetic
16-bit logical operations
Bit shifting
Comparisons
Register movement
Sequential execution
Conditional-free jump control
NOP
HALT
The ISA can be extended in future revisions while preserving the current instruction encoding as a compatibility baseline.
Possible future extensions include:
- Additional branch instructions
- Immediate operands
- Memory load/store instructions
- Stack operations
- Subroutine call/return
- Interrupt support
- System/control instructions
These features are not part of the current verified ISA.