Home

Awesome

sap-1-v2-mojo

SAP-1 CPU in Verilog for the Mojo FPGA board - has seperate address bus, so the WBUS is split up for simplicity. Also reduced from 6 t-states to 4.

Overview

Archectecture of the SAP-1 Processor

Image of architecture

Instructions / OPCodes

BinaryMnemonicMeaning
0000LDALoad data from memory into the Accumulator (Register A)
0001ADDLoad data from memory into Register B and perform addition of Accumulator and Register B and output on bus
0010SUBLoad data from memory into Register B and perform substract of Register B from Accumulator and output on bus
1110OUTLoad data from BUS to Output do be displayed 'physically'
1111HLTStop the running of the program.

Sample Program

// Add 10 + 9. 
0000 0000 1001 // Addr: 0  OPCode: LDA Addr: 9
0001 0001 1010 // Addr: 1  OPCode: ADD Addr: 10
0010 1110 0000 // Addr: 2  OPCode: OUT - Output Data
0011 1111 0000 // Addr: 3  OPCode: HLT - HALT
1001 0000 1010 // Addr: 9  DATA:   10
1010 0000 1001 // Addr: 10 DATA:    9

See Also

https://github.com/ellisgl/SAP-1-CPU