Single-cycle datapath

RV32I · 32-bit data · 32-bit instructions
100%
Data pathControl signalSelected
Hover over a block or wire to identify it. Select it to inspect its role.

Datapath directory

Quick Guide

Datapath explorer

Explore and directory
Hover over a component or wire to identify it. Select it on the drawing or in the directory to inspect its role and connections.
Guided build
Use Back and Next to see how the processor connects each new component. Scroll inside the inspector to read longer explanations.
Trace
Choose an instruction and step through its signal path. Select Register file, Instruction memory, or Data memory to inspect the operands, addresses, and pending writes.
Practice
Answer questions about the datapath. Use a hint, try a timed round, or open Practice statistics to review your results.
Drawing and zoom
Switch between Schematic and Lecture drawing. Use +, −, or Ctrl + scroll to zoom. Drag to pan and select Fit to see the whole drawing.

Assembly simulator

Source code
Choose an example, open an assembly file, or type your program. Each edit assembles the source and resets the machine. Select a diagnostic to find the source line. Use Save assembly file to keep a copy.
Step and Run
Step executes one machine instruction. Run repeats at the selected speed. Select Pause to stop at the current state.
Undo and Reset
Undo reverses the last step, including register and memory writes. Reset returns the program to its entry point with its initial data.
Machine code
Read each instruction’s PC, hexadecimal word, and decoded assembly. Select a row to inspect its bits, or use Go to PC to locate the next instruction.
Signal values
Show or hide values on the drawing. Before the first step, the datapath previews the entry instruction. After a step, it shows the instruction that just ran.
Machine state
Inspect registers and memory after the clock edge. Choose Control signals and select a signal to find it on the drawing.
Execution log
Scroll through the most recent 256 entries. Each row shows the cycle, PC, instruction, and effect.

Panel layout

Reorganize panels
In the explorer, place the full-width datapath above the inspector and directory. In Assembly, place Assembly and Machine state above the full-width datapath. Select the control again to restore the previous arrangement.
Resize panels
Drag a vertical divider left or right to change panel widths. Drag a horizontal divider up or down to change heights. For keyboard control, focus a divider and use the arrow keys.

Supported Instructions

The RV32I register file holds 32-bit integers. S and U interpret a value as signed or unsigned. Comparisons write 1 for true and 0 for false. Each instruction advances the PC by 4 unless it branches, jumps, or stops.

SyntaxOperation
Notation and execution details

rd is the destination register. rs1 and rs2 supply their values from before the clock edge. Register x0 always reads as zero. Results retain the low 32 bits.

imm is a sign-extended 12-bit value. imm20 supplies the upper 20 bits, and shamt ranges from 0 to 31. A signed right shift copies the sign bit into the high bits.

M8, M16, and M32 access a byte, halfword, or word in little-endian data memory. Halfwords need 2-byte alignment and words need 4-byte alignment. A misaligned access stops before the write edge.

A branch or jump label names a target address. A numeric target gives a byte offset from the instruction’s PC. A taken target needs 4-byte alignment. jal target uses ra as its destination. jalr rs means jalr ra, 0(rs).

The fence masks select input (i), output (o), memory reads (r), or memory writes (w). A mask of 0 selects none. Plain fence uses iorw for both masks.