SKIP TO CONTENT
STRATA
DATASHEET · REVISION R0

STRATA-16
16-bit deterministic processor

DOCUMENT
STRATA-16-DS
STATUS
SPECIFICATION
DEPLOYMENT
NONE
PRIMITIVE
NAND
NAND CELLS
3,912
FLIP-FLOPS
312

STRATA-16 is a 16-bit processor composed from a single computational primitive. It retires one instruction per external clock edge and produces a commitment to its architectural state on every transition. This document specifies the architecture. It does not describe a deployment: no contract exists, and every figure in it is derived from the implementation in this site.

1 FEATURES

ALL FIGURES DERIVED
  • 16-bit data path, 16 architectural registers
  • 5-bit opcode field, all 32 instructions defined, no reserved space
  • 2,048 words of program store, 32-bit instruction word
  • 4 KB byte-addressed store with 16-bit access, little endian
  • 64-word stack page, full descending, faults rather than wrapping
  • Four condition flags: Z, N, C, V, taken from the adder chain
  • Two byte-wide ports mapped into the store; no input or output instructions
  • 5 execution phases, 3–5 visited per instruction
  • 15 control points, 177 assertions across the set
  • 3,912 NAND cells and 312 flip-flops, summed from the netlist
  • Canonical encoding: one encoding per instruction, non-canonical words fault
  • Deterministic replay: the same program and inputs produce the same commitments

2 ARCHITECTURAL STATE

312 BITS
STATE ELEMENTSFLIP-FLOPS
ELEMENTWIDTHBITS
REGISTER FILE16 × 16256
INSTRUCTION REGISTER32 bit32
PROGRAM COUNTER12 bit12
STACK POINTER8 bit page offset8
FLAGSZ N C V4
ARCHITECTURAL STATEtotal312
RESET STATECYCLE 0
REGISTERVALUENOTE
PC0x000first instruction word
IR0x00000000cleared, not fetched
SP0x80one word past the top of the page
R0 … RF0x0000all registers cleared
FLAGS· · · ·all clear
STORE0x004,096 bytes cleared

RESET is the only way back. A state transition is not reversible, so there is no undo and no rollback: a machine returns to this table or it continues forward.

3 INSTRUCTION WORD

32 BIT · 25 SIGNIFICANT
RSV31:257 BITOP24:205 BITRD19:164 BITRS15:124 BITIMM/ADDR11:012 BITMSB 310 LSB
FIELDBITSWIDTHCONTENT
RSV31:257zero in a canonical word
OP24:205opcode, 32 defined
RD19:164destination register, or a pointer register
RS15:124source register, or a pointer register
IMM/ADDR11:012immediate, RAM address, ROM address, or 4-bit shift distance

CANONICAL FORM · A word is canonical when bits 31:25 are zero and every field the decoded instruction does not read is zero. A shift distance above 15 is not canonical. The decoder rejects any word that is not canonical, so exactly one encoding of an instruction exists and two machines can compare transitions without a normalisation step.

4 INSTRUCTION SET

32 OPCODES
INSTRUCTION SET32 OPCODES · 5-BIT FIELD
OPCODEMNEMONICOPERANDSCLASSFLAGSΦDESCRIPTION
00000NOPCONTROL3No architectural state changes except the program counter.
00001MOVRd, RsTRANSFER4Copies the source register into the destination register.
00010LDIRd, #immTRANSFER4Loads a zero-extended twelve-bit immediate into the destination register.
00011LOADRd, [addr]MEMORY5Reads a sixteen-bit word from an absolute RAM address into the destination register.
00100LDRRd, [Rs]MEMORY5Reads a word from the RAM address held in the source register.
00101STORE[addr], RsMEMORY5Writes the source register to an absolute RAM address.
00110STR[Rd], RsMEMORY5Writes the source register to the RAM address held in the destination register.
00111PUSHRsSTACK5Decrements the stack pointer and writes the source register to the stack page.
01000POPRdSTACK5Reads a word from the stack page into the destination register and increments the stack pointer.
01001ADDRd, RsARITHMETICZNCV5Adds the source register to the destination register.
01010ADDIRd, #immARITHMETICZNCV5Adds a zero-extended twelve-bit immediate to the destination register.
01011SUBRd, RsARITHMETICZNCV5Subtracts the source register from the destination register.
01100SUBIRd, #immARITHMETICZNCV5Subtracts a zero-extended twelve-bit immediate from the destination register.
01101INCRdARITHMETICZNCV5Adds one to the destination register.
01110DECRdARITHMETICZNCV5Subtracts one from the destination register.
01111NEGRdARITHMETICZNCV5Replaces the destination register with its two's complement.
10000ANDRd, RsLOGICZN5Bitwise conjunction of the destination and source registers.
10001ORRd, RsLOGICZN5Bitwise disjunction of the destination and source registers.
10010XORRd, RsLOGICZN5Bitwise exclusive disjunction of the destination and source registers.
10011NOTRdLOGICZN5Bitwise complement of the destination register.
10100SHLRd, #nSHIFTZNC5Shifts the destination register left by a four-bit distance. The last bit shifted out enters carry.
10101SHRRd, #nSHIFTZNC5Logical right shift. Vacated bits are filled with zero.
10110ASRRd, #nSHIFTZNC5Arithmetic right shift. Vacated bits are filled with the sign bit.
10111CMPRd, RsCOMPAREZNCV5Subtracts the source from the destination, writing flags and discarding the result.
11000CMPIRd, #immCOMPAREZNCV5Compares the destination register against a twelve-bit immediate.
11001JMPaddrCONTROL5Unconditional transfer of control to a ROM address.
11010JMZaddrCONTROL5Transfers control if the zero flag is set.
11011JNZaddrCONTROL5Transfers control if the zero flag is clear.
11100JMNaddrCONTROL5Transfers control if the negative flag is set.
11101CALLaddrCONTROL5Pushes the return address onto the stack page and transfers control.
11110RETCONTROL5Pops a return address from the stack page into the program counter.
11111HALTCONTROL3Stops the sequencer. The architectural state is retained and remains readable.

5 EXECUTION PHASES

ONE INSTRUCTION PER PASS
PHASES5 DEFINED
PHASERUNSACTION
FETCHALWAYSreads the word at the counter into the instruction register
DECODEALWAYSresolves operand sources and the branch condition; derives the phase list
EXECUTEIF ASSERTEDdrives the arithmetic unit, the memory port or the pointer
WRITEBACKIF ASSERTEDapplies the register, store, flag, pointer and counter writes
COMMITALWAYSincrements the cycle and produces the state commitment
PHASE COST BY CLASSDERIVED FROM CONTROL ASSERTIONS
INSTRUCTIONPHASESLIST
NOP3F D C
MOV4F D W C
LDI4F D W C
ADD5F D E W C
LOAD5F D E W C
STORE5F D E W C
CALL5F D E W C
JMZ4 / 5F D E W C · untaken skips writeback
HALT3F D C

A decision — a comparison and the branch that consumes its flags — costs 9 to 10 phases, measured over 180 samples of the DECIDE reference program.

6 STORE MAP

4 KB · BYTE ADDRESSED
REGIONFROMTOBYTESNOTE
DATA0x0000xEFF3,840general read/write
STACK0xF000xF7F12864 words, full descending
RESERVED0xF800xFFB124reads 0x00, writes ignored
PORT IN0xFFC0xFFD2host → machine, 1 byte
PORT OUT0xFFE0xFFF2machine → host, 1 byte

PORTS · The input port at 0xFFC reads a byte supplied by the host and its upper byte reads zero, so a sixteen-bit load returns a zero-extended value without masking. The output port at 0xFFE takes the low byte of a store; its upper byte ignores writes. Nothing is buffered: a port is read when a program reads it and written when a program writes it.

7 CONTROL POINTS

15 LINES · 177 ASSERTIONS
LINENAMEASSERTED BYINSTRUCTIONS
IR_LDINSTRUCTION REGISTER LOAD32every instruction
PC_INCPROGRAM COUNTER INCREMENT31NOP MOV LDI LOAD LDR STORE STR PUSH POP ADD ADDI SUB SUBI INC DEC NEG AND OR XOR NOT SHL SHR ASR CMP CMPI JMP JMZ JNZ JMN CALL RET
PC_LOADPROGRAM COUNTER LOAD6JMP JMZ JNZ JMN CALL RET
RAREGISTER READ PORT A17STR ADD ADDI SUB SUBI INC DEC NEG AND OR XOR NOT SHL SHR ASR CMP CMPI
RBREGISTER READ PORT B11MOV LDR STORE STR PUSH ADD SUB AND OR XOR CMP
IMM_SELIMMEDIATE SELECT16LDI LOAD STORE ADDI SUBI INC DEC SHL SHR ASR CMPI JMP JMZ JNZ JMN CALL
ALU_ENARITHMETIC UNIT ENABLE13ADD ADDI SUB SUBI INC DEC NEG AND OR XOR NOT CMP CMPI
SH_ENSHIFTER ENABLE3SHL SHR ASR
FLG_WRFLAG WRITE16ADD ADDI SUB SUBI INC DEC NEG AND OR XOR NOT SHL SHR ASR CMP CMPI
REG_WRREGISTER WRITE19MOV LDI LOAD LDR POP ADD ADDI SUB SUBI INC DEC NEG AND OR XOR NOT SHL SHR ASR
MEM_RDMEMORY READ4LOAD LDR POP RET
MEM_WRMEMORY WRITE4STORE STR PUSH CALL
SP_DECSTACK POINTER DECREMENT2PUSH CALL
SP_INCSTACK POINTER INCREMENT2POP RET
HALT_LHALT LATCH1HALT

The switching figure on the front of this document is the sum of this column: 177 assertions across 32 decoded instructions.

8 NETLIST

15 BLOCKS · 3,912 NAND
BLOCKLAYERNANDFFBUDGETDERIVATION
ADDERARITHMETIC14416 × full adder (9)
LOGIC UNITARITHMETIC16016 × (AND 2 + OR 3 + XOR 4 + NOT 1)
BARREL SHIFTERARITHMETIC2564 stages × 16 × MUX2 (4)
RESULT SELECTARITHMETIC19216 × 4→1 MUX (3 × MUX2)
FLAG UNITARITHMETIC524Z: 15 × OR (3) + NOT (1) = 46 · N C V: 6 · 4 flip-flops
READ PORT AREGISTERS96016 × 16→1 MUX (15 × MUX2 = 60)
READ PORT BREGISTERS96016 × 16→1 MUX (15 × MUX2 = 60)
REGISTER FILEREGISTERS13225616 × AND4 (6) + 4 × NOT + 16 × AND2 (2) · 16 × 16 flip-flops
COUNTER INCREMENTCONTROL721212 × half adder (6) · 12 flip-flops
COUNTER SOURCECONTROL962 × (12 × MUX2)
OPCODE DECODERCONTROL26132 × AND5 (8) + 5 × NOT
MEMORY PORTMEMORY242address 3→1 MUX 96 · word assembly 64 · port compare 82
STACK POINTERMEMORY8088 × half adder (6) + 8 × MUX2 · 8 flip-flops
INSTRUCTION REGISTERCONTROL643232 × AND2 (2) load enable · 32 flip-flops
CONTROL MATRIXCONTROL24124 control terms × 3 × OR (3) = 216 · 5 phase lines × AND2 = 10 · 15 glue

9 FAULTS

5 DECLARED
CODERAISED WHENNOTE
PC_RANGEFetch from an address at or above the program store.The counter is 12 bits and the store is 2048 words, so half the counter's range is outside it. A transfer there faults at the next fetch rather than reading nothing.
NON_CANONICALFetch of a word with a reserved bit set, or with a field the instruction does not read set.There is exactly one encoding of any instruction. A word that is not it is not executed.
STACK_OVERFLOWPUSH or CALL with the stack pointer at the floor of the stack page.The page is fixed at 64 words. The machine stops rather than writing outside it.
STACK_UNDERFLOWPOP or RET with the stack pointer at its reset value.Returning from a frame that was never pushed is a fault, not an arbitrary jump.
MEM_RANGEReserved. No access can currently raise it: the address field is 12 bits and the store is 4096 bytes.Declared so that the fault space is closed even though the address space cannot leave the store.

A fault is a defined stop, not a crash. The instruction that raised it produces no transition except the fault itself: the counter stays on it, the store is unchanged, and the state remains readable. CHECK 04 asserts that randomised execution reaches no state outside this table.

10 VERIFICATION

5 CHECKS · RUN LOCALLY
CHECKESTABLISHESQUICKFULLUNIT
CHECK 01 THE ARITHMETICEvery arithmetic, logic and shift instruction produces the same result and the same four flags as the same operation built out of the primitive.4,0961,048,576VECTORS
CHECK 02 AN INDEPENDENT MODELA second interpreter, sharing no execution code with the machine, reaches identical architectural state after every retired instruction.20,000400,000RETIREMENTS
CHECK 03 THE SHIPPED PATHThe encoding is canonical and the text path is closed: an instruction word disassembles to text that reassembles to the identical word.8,192131,072WORDS
CHECK 04 LIVENESSRandomised execution never reaches an undefined architectural state. It either runs, halts, or raises one of the declared faults.60,0001,200,000PHASES
CHECK 05 THE COMMITMENTA machine replayed from its program and its inputs produces the identical sequence of state commitments. This is the property the contract requires.8,000120,000COMMITMENTS

No third party has audited this architecture. These checks run in the reader’s browser, against the same machine the interface operates, and each one states what a pass does not establish on the verification page.

11 OMISSIONS AND CONSEQUENCES

DELIBERATE
NO SWAP

Three exclusive disjunctions exchange two registers without a temporary. An opcode that can be written in the instruction set it would belong to does not earn a slot in a closed set.

NO I/O INSTRUCTIONS

Both ports are mapped into the store, so LOAD already reads and STORE already writes. Adding IN and OUT would have added two decoded opcodes and one more thing to verify, for no capability.

NO MULTIPLIER

A multiply is a shift and an add in a loop, and the MULTIPLY reference program is that loop. The netlist stays at one adder, one logic unit and one shifter.

NO INTERRUPTS

The clock is external and the machine is advanced by an edge it does not control. There is nothing to interrupt: between two edges the machine is not running.

NO EXTENSION SPACE

All 32 opcodes are defined. A five-bit field cannot hold a thirty-third instruction, so the architecture is fixed at R0 rather than left open.

A HALF-ADDRESSED STORE

The counter is 12 bits and the program store is 2,048 words, so half the counter's range is outside it. That is why PC_RANGE is a declared fault rather than an impossibility.

12 REFERENCE PROGRAMS

6 LISTED
ACCUMULATECONTINUOUS · MEMORY · ARITHMETIC · COMPARE · BRANCH
; ACCUMULATE — the resident program
; Eight additions into one RAM word, then the word is cleared
; and the sequence restarts. The machine never halts.

        .org  0x000
        LDI   R2, #17          ; addend
        LDI   R5, #0           ; iteration counter
        LDI   R1, #0
        STORE [0x020], R1      ; clear the accumulator

work:   LOAD  R1, [0x020]      ; read the accumulator
        ADD   R1, R2           ; accumulate
        STORE [0x020], R1      ; commit it
        MOV   R3, R1           ; keep a copy for inspection
        INC   R5
        CMPI  R5, #8
        JNZ   work

        LDI   R5, #0           ; wrap the sequence
        LDI   R1, #0
        STORE [0x020], R1
        JMP   work
DECIDECONTINUOUS · PORT IN · PORT OUT · COMPARE · BRANCH
; DECIDE — a decision per pass over the input port
; The port word reads as a zero extended byte, so no masking
; is required before the comparison.

        .org  0x000
read:   LOAD  R1, [0xFFC]      ; host → machine
        CMPI  R1, #0x040
        JMN   low              ; R1 < 0x40
        CMPI  R1, #0x0C0
        JMN   mid              ; 0x40 ≤ R1 < 0xC0

high:   LDI   R3, #0x003
        JMP   emit
mid:    LDI   R3, #0x002
        JMP   emit
low:    LDI   R3, #0x001

emit:   STORE [0xFFE], R3     ; machine → host
        INC   R4               ; decisions taken
        JMP   read
MULTIPLYHALTS · CALL · RET · SHIFT · LOGIC · STACK
; MULTIPLY — 13 × 11 by shift and add
; The architecture has no multiplier. It has a shifter and an
; adder, which is enough.

        .org  0x000
        LDI   R1, #13          ; multiplicand
        LDI   R2, #11          ; multiplier
        CALL  mul
        STORE [0x030], R3      ; product
        HALT

mul:    LDI   R3, #0           ; product
        LDI   R4, #0x001       ; bit selector
mloop:  MOV   R5, R2
        AND   R5, R4           ; is this multiplier bit set?
        JMZ   skip
        ADD   R3, R1           ; accumulate the partial product
skip:   SHL   R1, #1
        SHL   R4, #1
        CMPI  R4, #0x100       ; eight bits consumed
        JNZ   mloop
        RET
SEQUENCEHALTS · REGISTER INDIRECT · MEMORY · ARITHMETIC
; SEQUENCE — an additive sequence written through a pointer
; Register indirect stores walk the pointer forward two bytes
; per word.

        .org  0x000
        LDI   R1, #0
        LDI   R2, #1
        LDI   R3, #0x040       ; write pointer
        LDI   R6, #16          ; words to write

fib:    STR   [R3], R1
        MOV   R4, R1
        ADD   R4, R2
        MOV   R1, R2
        MOV   R2, R4
        ADDI  R3, #2
        DEC   R6
        JNZ   fib
        HALT
STACK WALKHALTS · PUSH · POP · CALL · RET
; STACK WALK — the stack page is 64 words, full descending
; CALL pushes a return address through the same port PUSH uses.

        .org  0x000
        LDI   R1, #0x0A1
        LDI   R2, #0x0B2
        PUSH  R1
        PUSH  R2
        POP   R3               ; R3 ← 0x0B2
        POP   R4               ; R4 ← 0x0A1
        CALL  depth
        HALT

depth:  PUSH  R1
        POP   R5
        RET
ECHOCONTINUOUS · PORT IN · PORT OUT · SHIFT
; ECHO — the input/output boundary
; Nothing is buffered. The port is read when the program reads
; it and written when the program writes it.

        .org  0x000
echo:   LOAD  R1, [0xFFC]
        CMPI  R1, #0
        JMZ   echo             ; wait for a non zero byte
        SHL   R1, #1
        STORE [0xFFE], R1
        JMP   echo