The Testbench and Results
The test program was stored in RAM of SAP-1 microprocessor,
- Load contents of memory location 9H into accumulator
- 9H contains 01H. Accumulator is loaded with 01H
- Add the contents of AH.
- AH contains 02H. Result is 03H
- Add the contents of BH.
- BH contians 03H. Result is 06H
- Subtract the result by the contents of CH.
- CH containes 04H. Result is 02H
- OUT and Halt (two instructions)
- Output the result
`timescale 1ns/1ps module tb(); reg clk; reg clr; wire [7:0] result; always begin #5 clk=~clk; end initial begin $dumpfile("sap1tb.vcd"); $dumpvars(0,sap1tb); clk=0; clr=1; #50 clr=0; #5 clr=1; #310 $finish; end sap1 sap1tb(clk,clr,result); endmodule