
The VRA CPU is a compact, externally programmable 5-bit microprocessor designed for implementation on silicon through the Tiny Tapeout initiative using the SkyWater 130 nm CMOS technology (Sky130).
The project explores the design of a minimal processor architecture, balancing functionality, programmability and silicon area.
Despite its small size, the processor supports arithmetic operations, data transfers, indirect memory addressing, conditional branches and relative jumps. An integrated debugging interface provides direct access to internal registers, buses and control signals.
The VRA CPU follows a Harvard-style architecture, with separate program and data memories.
The processor uses a combination of rising-edge and falling-edge clocked registers to coordinate instruction execution, memory access and program counter updates.
| Parameter | Specification |
|---|---|
| Processor | VRA CPU |
| Technology | SkyWater 130 nm |
| Architecture | Harvard-style |
| Data width | 5 bits |
| Instruction width | 8 bits |
| Program address width | 5 bits |
| Data memory address width | 4 bits |
| Program memory | 32 × 8 bits |
| Data memory | 16 × 5 bits |
| Instruction set | 12 instructions |
| Status flags | Carry/borrow and Zero |
| Debug channels | 16 |
| Reset | Active low |
| Target area | 1 Tiny Tapeout tile |
The processor contains three main working registers, a program counter and two status flags.
| Register | Function |
|---|---|
| V | Main working register and ALU destination |
| A | Secondary arithmetic operand register |
| R | Indirect data memory address register |
| PC | Program counter |
| C | Carry or borrow flag |
| Z | Zero flag |
The V register is the main working register. It receives immediate values, arithmetic results, data memory contents and values transferred from the A register.
The A register stores the second operand used by the ALU. Its contents can be transferred back to the V register.
The R register provides the address for indirect data memory operations.
The physical data memory uses four address bits, allowing access to 16 memory positions.
The program counter addresses the 32 available program memory positions.
During normal execution, it advances to the next instruction. Branch and jump instructions modify its value.
The program counter operates modulo 32.
The ALU performs unsigned 5-bit addition and subtraction.
V = V + A
V = V - A
Arithmetic results are limited to five bits, giving a numerical range of 0 to 31.
The ALU generates two status flags:
| Flag | Description |
|---|---|
| C | Carry during addition or borrow during subtraction |
| Z | Set when the 5-bit arithmetic result is zero |
The flags are updated by arithmetic instructions.
| Operation | Result | C | Z |
|---|---|---|---|
| 5 + 3 | 8 | 0 | 0 |
| 31 + 1 | 0 | 1 | 1 |
| 8 - 3 | 5 | 0 | 0 |
| 3 - 3 | 0 | 0 | 1 |
| 0 - 1 | 31 | 1 | 0 |
Each instruction occupies one 8-bit program memory position.
The instruction decoder supports instructions with either a 3-bit or a 4-bit opcode.
| Mnemonic | Encoding | Hexadecimal | Operation |
|---|---|---|---|
| MOV V, k | 000kkkkk |
00–1F |
V ← k |
| MOV R, V | 0010xxxx |
20–2F |
R ← V |
| MOV V, A | 0011xxxx |
30–3F |
V ← A |
| MOV A, V | 0100xxxx |
40–4F |
A ← V |
| MOV V, @R | 0101xxxx |
50–5F |
V ← RAM[R] |
| MOV @R, V | 0110xxxx |
60–6F |
RAM[R] ← V |
| ADD V, A | 0111xxxx |
70–7F |
V ← V + A |
| SUB V, A | 1000xxxx |
80–8F |
V ← V - A |
| NOP | 1001xxxx |
90–9F |
No operation |
| JC addr | 101aaaaa |
A0–BF |
Jump if C = 1 |
| JZ addr | 110aaaaa |
C0–DF |
Jump if Z = 1 |
| JMP rel | 111rrrrr |
E0–FF |
PC ← PC + rel |
Where:
k represents a 5-bit immediate constant.a represents a 5-bit absolute program address.r represents a 5-bit relative displacement.x represents an unused instruction bit.@R represents indirect data memory addressing.The JC and JZ instructions perform absolute jumps when their corresponding status flag is set.
If the condition is false, execution continues with the next instruction.
The JMP instruction adds its operand to the current program counter.
PC = (PC + rel) mod 32
This allows both forward and backward jumps using modulo-32 arithmetic.
| Instruction | Machine Code | Operation |
|---|---|---|
| JMP 0 | E0 |
Infinite self-loop |
| JMP +1 | E1 |
Advance one instruction |
| JMP +2 | E2 |
Skip one instruction |
| JMP -2 | FE |
Jump two positions backward |
| JMP -1 | FF |
Jump one position backward |
The processor does not implement a dedicated HALT instruction. A JMP 0 instruction can be used to stop program progression.
The program memory contains 32 positions, each storing one 8-bit instruction.
Address range: 0x00 - 0x1F
Capacity: 256 bits
Although referred to as ROM internally, the program memory is externally writable and volatile.
An area-optimized latch-based implementation reduces the storage hardware required for the instruction memory.
Program memory contents are retained while power is applied but must be programmed again after power is removed.
The data memory contains 16 positions, each storing one 5-bit value.
Address range: 0x00 - 0x0F
Capacity: 80 bits
Data range: 0x00 - 0x1F
Data memory supports:
The data memory uses edge-triggered storage with asynchronous reading.
The operating mode is selected using the two most significant dedicated input bits, ui_in[7:6].
| UI[7] | UI[6] | Operating Mode |
|---|---|---|
| 0 | 0 | CPU execution and debugging |
| 0 | 1 | External RAM reading |
| 1 | 0 | Program memory programming |
| 1 | 1 | External RAM programming |
In execution mode, the lower four bits select the internal debugging channel.
| Pin | Function |
|---|---|
| ui_in[0] | Address bit 0 / Debug select bit 0 |
| ui_in[1] | Address bit 1 / Debug select bit 1 |
| ui_in[2] | Address bit 2 / Debug select bit 2 |
| ui_in[3] | Address bit 3 / Debug select bit 3 |
| ui_in[4] | Program memory address bit 4 |
| ui_in[5] | External memory write enable |
| ui_in[6] | Operating mode bit 0 |
| ui_in[7] | Operating mode bit 1 |
| Pin | Function |
|---|---|
| uo_out[0] | Debug data bit 0 |
| uo_out[1] | Debug data bit 1 |
| uo_out[2] | Debug data bit 2 |
| uo_out[3] | Debug data bit 3 |
| uo_out[4] | Debug data bit 4 |
| uo_out[5] | Debug data bit 5 |
| uo_out[6] | Debug data bit 6 |
| uo_out[7] | Debug data bit 7 |
| Pin | Programming Mode | RAM Read Mode |
|---|---|---|
| uio[0] | Data input bit 0 | RAM data bit 0 |
| uio[1] | Data input bit 1 | RAM data bit 1 |
| uio[2] | Data input bit 2 | RAM data bit 2 |
| uio[3] | Data input bit 3 | RAM data bit 3 |
| uio[4] | Data input bit 4 | RAM data bit 4 |
| uio[5] | Instruction bit 5 | Logic 0 |
| uio[6] | Instruction bit 6 | Logic 0 |
| uio[7] | Instruction bit 7 | Logic 0 |
The bidirectional pins are configured as outputs only during external RAM reading.
| Signal | Function |
|---|---|
| clk | System clock |
| rst_n | Active-low processor reset |
| ena | Tiny Tapeout project enable; unused internally |
| Operation | UI_IN Base Value | Address Range |
|---|---|---|
| Execute / Debug | 0x00 |
00–0F |
| RAM read | 0x40 |
40–4F |
| Program memory select | 0x80 |
80–9F |
| Program memory write | 0xA0 |
A0–BF |
| RAM select | 0xC0 |
C0–CF |
| RAM write | 0xE0 |
E0–EF |
The selected memory address is added to the corresponding base value.
To write an instruction into program memory:
ui_in[4:0].uio_in[7:0].ui_in[5].Address and instruction data must remain stable throughout the active latch write interval.
For example, to write the instruction MOV V, 5 into program address 0x03:
| Step | UI_IN | UIO_IN | CLK |
|---|---|---|---|
| Select address | 83 |
05 |
0 |
| Enable write | A3 |
05 |
0 |
| Open latch | A3 |
05 |
1 |
| Close latch | A3 |
05 |
0 |
| Disable write | 83 |
05 |
0 |
All values in this table are hexadecimal except the clock level.
To write a value into data memory:
For example, writing the decimal value 21 into RAM address 3 requires:
UI_IN = 0xE3
UIO_IN = 0x15
Generate a rising clock edge to store the value.
To read RAM address 3:
UI_IN = 0x43
The stored value appears on uio_out[4:0].
The external controller must release the bidirectional bus before entering RAM read mode to avoid electrical contention.
RAM reading is asynchronous and does not require a clock pulse.
The VRA CPU includes a 16-channel debugging multiplexer connected to the dedicated output pins.
The desired debug channel is selected using ui_in[3:0].
| Selector | Signal | Description |
|---|---|---|
0x0 |
V | Main working register |
0x1 |
PC | Program counter |
0x2 |
RAM input | Data presented to RAM |
0x3 |
RAM address | Current data memory address |
0x4 |
RAM output | Data read from RAM |
0x5 |
A | Secondary arithmetic register |
0x6 |
V input | Next value presented to V |
0x7 |
ALU output | Current arithmetic result |
0x8 |
Flags | Current and stored status flags |
0x9 |
PC increment | Selected PC displacement |
0xA |
PC adder | Relative address calculation |
0xB |
Next PC | Next program counter value |
0xC |
Instruction | Current instruction byte |
0xD |
Microcode low | Control word bits 7–0 |
0xE |
Microcode high | Control word bits 11–8 |
0xF |
R | Indirect address register |
When debug channel 0x8 is selected, the output bits are organized as follows:
| Signal | Description |
|---|---|
| DC | Current combinational ALU carry/borrow |
| DZ | Current combinational ALU zero indication |
| C | Stored carry/borrow flag |
| Z | Stored zero flag |
This interface makes the processor particularly suitable for educational demonstrations, instruction-level experimentation and hardware debugging.
The following program calculates 5 + 3 and stores the result in RAM address 0.
MOV V, 5
MOV A, V
MOV V, 0
MOV R, V
MOV V, 3
ADD V, A
MOV @R, V
JMP 0
| Address | Instruction | Machine Code |
|---|---|---|
00 |
MOV V, 5 | 05 |
01 |
MOV A, V | 40 |
02 |
MOV V, 0 | 00 |
03 |
MOV R, V | 20 |
04 |
MOV V, 3 | 03 |
05 |
ADD V, A | 70 |
06 |
MOV @R, V | 60 |
07 |
JMP 0 | E0 |
| Register / Memory | Value |
|---|---|
| V | 8 |
| A | 5 |
| R | 0 |
| PC | 7 |
| C | 0 |
| Z | 0 |
| RAM[0] | 8 |
This program continuously increments the V register, demonstrating arithmetic operations and relative jumps.
MOV V, 1
MOV A, V
MOV V, 0
LOOP:
ADD V, A
JMP -1
| Address | Instruction | Machine Code |
|---|---|---|
00 |
MOV V, 1 | 01 |
01 |
MOV A, V | 40 |
02 |
MOV V, 0 | 00 |
03 |
ADD V, A | 70 |
04 |
JMP -1 | FF |
The V register continuously cycles through the values 0 to 31.
Select debug channel 0x0 to observe the counter on the dedicated output pins.
When the counter wraps from 31 to 0, both the carry and zero flags are set.
This program demonstrates subtraction and conditional branching.
MOV V, 5
MOV A, V
MOV V, 5
SUB V, A
JZ SUCCESS
MOV V, 31
JMP 0
SUCCESS:
MOV V, 1
JMP 0
| Address | Instruction | Machine Code |
|---|---|---|
00 |
MOV V, 5 | 05 |
01 |
MOV A, V | 40 |
02 |
MOV V, 5 | 05 |
03 |
SUB V, A | 80 |
04 |
JZ 7 | C7 |
05 |
MOV V, 31 | 1F |
06 |
JMP 0 | E0 |
07 |
MOV V, 1 | 01 |
08 |
JMP 0 | E0 |
The expected final value of V is 1, indicating that the conditional branch was successfully executed.
The following procedure can be used to verify basic processor functionality on a Tiny Tapeout demonstration board.
Set rst_n to logic 0 and stop the clock.
This initializes the processor registers, program counter and status flags.
Reset does not erase or initialize the program and data memories.
Use the external program memory programming interface to load Example Program 1.
Select execution mode, release reset and start the clock.
The internal startup logic coordinates the initial instruction execution with program counter advancement.
A slow external clock can be used to observe individual instructions.
Use the dedicated input pins to select the debugging channel.
For example:
UI_IN = 0x00 -> V register
UI_IN = 0x01 -> Program counter
UI_IN = 0x05 -> A register
UI_IN = 0x08 -> Status flags
UI_IN = 0x0C -> Current instruction
UI_IN = 0x0F -> R register
After the program reaches its final self-loop, stop the clock and select external RAM read mode.
UI_IN = 0x40
The expected result is:
UIO_OUT = 0x08
This confirms that the processor has successfully performed immediate loading, register transfers, addition, indirect memory writing and program execution.
A major design objective of the VRA CPU is to minimize silicon area while preserving external programmability and a useful instruction set.
The principal optimization techniques include:
The two memories provide a combined storage capacity of 336 bits.
The latch-based instruction memory is intended to reduce the area occupied by storage cells and associated write-enable logic in the Sky130 high-density standard-cell library.
The VRA CPU is intentionally designed as a minimal processor.
Its limitations include:
These limitations are deliberate architectural trade-offs intended to reduce silicon area and implementation complexity.
The VRA CPU is described in Verilog HDL and targets the Sky130 standard-cell technology through the Tiny Tapeout digital design flow.
The design uses an area-optimized instruction memory and a conventional edge-triggered data memory.
Physical implementation and timing closure must be verified before fabrication. The maximum operating frequency and final silicon area depend on the completed synthesis, placement, routing and timing analysis results.
The VRA CPU provides a practical platform for exploring:
Its small architecture allows the complete processor operation to be understood and observed at the register-transfer level.
No specialized external hardware is required beyond a suitable Tiny Tapeout interface board.
The following equipment may be useful:
A microcontroller can automate program loading, clock generation, memory initialization and internal register inspection.
The VRA CPU demonstrates that a programmable microprocessor with arithmetic capabilities, separate instruction and data memories, conditional branching and comprehensive debugging can be implemented using a compact digital architecture.
The project combines processor design, hardware programming and silicon area optimization in a small experimental computing platform targeting the SkyWater 130 nm process.
Small architecture. Real silicon. Programmable computing.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | A0 | DBG0 | D0 |
| 1 | A1 | DBG1 | D1 |
| 2 | A2 | DBG2 | D2 |
| 3 | A3 | DBG3 | D3 |
| 4 | A4 | DBG4 | D4 |
| 5 | WE | DBG5 | D5 |
| 6 | M0 | DBG6 | D6 |
| 7 | M1 | DBG7 | D7 |