The complete datapath

8-bit data · 16-bit instructions · 4 registers · 256-byte data memory

Scroll to move · Ctrl + scroll to zoom
MADELINE single-cycle datapath The PC selects the next instruction from ROM. A branch or jump can select a target relative to the current PC or a register. A separate incrementer supplies PC + 1 for the next instruction and for link writeback. JAL and JALR save this address in the register selected by OPC. The ALU and data memory share the register write bus. Matching net labels connect the circuits. PC + 1 Target Redirect PC 01 2:1 D Q PC CLK Next PC Address OR Taken AND AND AND AND EQ NE LT GT OPC WRSDEST Branch enable 2 → 4 DEC Branch decoder ¬W · (RS + (DEST = 00)) A Instruction ROM 256 words × 16 bits Word out Example contents Address Word 0x24 0x640C 0x25 0x0000 … … 0x30 0x9000 0x31 0x0B00 0xFD 0x0000 0xFE 0x0000 0xFF 0x4EFD 16 Field splitter 1 bit W 2 bits OPC 1 bit RS 2 bits DEST 2 bits SRC1 2 bits SRC2 8 bits Const DEST OPC 01 2:1 Link RF_WE DMX Register writeback D Q WE R0 8-bit CLK D Q WE R1 8-bit CLK D Q WE R2 8-bit CLK D Q WE R3 8-bit CLK R[SRC1] · operand A ALU operand X 4:1 Read port A SRC1 4:1 ALU read port B SRC2 4:1 DEST R[DEST] 0 0 1 2:1 RS A B CMP > = < Signed compare GT NE EQ LT 01 2:1 RS Const +ADD XOR NAND 3 An SRL OPC 0001 1011 4:1 ALU result DM read 01 2:1 MemOp PC + 1 01 2:1 Link Instruction fetch Instruction decode Instruction execute W RS Const[7] Memory decode W & RS & Const[7] MemOp OPC[0] Store DM_WE W Link RF write (W · ¬Store) + Link RF_WE Const[6:0] Sign extend 7 → 8 bits R[SRC1] + 8-bit sum SRC1[0] Const[6:0] Absolute address {SRC1[0], Const[6:0]} 0 1 2:1 OPC[1] Address[7:0] R[DEST] DM_WE CLK Data RAM 256 × 8 bits ADDR D WE Q DM read Combinational read WRSDEST TakenIndirect LinkRedirect Jump Jump decode W = 0, RS = 0 01 JAL 10 JR 11 JALR OR JR, JALR JAL, JALR PCR[SRC1] IndirectConst Target Base Base + signed Const 01 2:1 + 8-bit sum PC1 PC + 1 + 8-bit sum PC incrementer To next-PC mux and link writeback
MADELINE datapath. Matching labels connect signals across the drawing.SelectedCurrent step