Skip to content

Commit

Permalink
First program passed.
Browse files Browse the repository at this point in the history
  • Loading branch information
ei9 committed Apr 7, 2021
1 parent f7539ce commit 555a27a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sap2_mini.v
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ module ctrl(output[29:0] con, output hlt, input clk,clr,am,az,xm,xz, input[7:0]
assign con[24] = sc[0] & q; // ES
assign con[23] = sc[0] | (sc[3] & (LDA|ADD|SUB|STA|LDB|LDX)); // LM
assign con[22] = sc[5] & STA; // WE
assign con[21] = (sc[4] & (LDA|ADD|SUB|LDB|LDX)) | (sc[5] & STA) | sc[2]; // CE sta-t6
assign con[21] = (sc[4] & (LDA|ADD|SUB|LDB|LDX)) | (sc[5] & STA) | sc[2]; // CE
assign con[20] = (sc[3] & XCH) | (sc[4] & STA); // LD
assign con[19] = sc[5] & XCH; // ED
assign con[18] = sc[2]; // LI
Expand All @@ -117,7 +117,7 @@ module ctrl(output[29:0] con, output hlt, input clk,clr,am,az,xm,xz, input[7:0]
assign con[9] = (sc[3] & (CLA|CMB|AND|NOR)) | (sc[5] & ADD); // S0
assign con[8] = sc[3] & (CLA|CMA|CMB|IOR|AND|NOR|NAN|XOR); // M
assign con[7] = sc[5] & ADD; // CI
assign con[6] = (sc[3] & (CMA|CMB|IOR|AND|NOR|NAN|XOR|CLA)) | (sc[5] & ADD); // EU
assign con[6] = (sc[3] & (CMA|CMB|IOR|AND|NOR|NAN|XOR|CLA)) | (sc[5] & (ADD|SUB)); // EU
assign con[5] = (sc[3] & CMB) | (sc[4] & (ADD|SUB|CMB)); // LB
assign con[4] = (sc[4] & LDX) | (sc[5] & XCH); // LX
assign con[3] = sc[3] & INX; // INX
Expand Down
3 changes: 3 additions & 0 deletions src/tb_sap2_mini.v
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ module tb_sap2_mini;
#4 clr = 1;
#4 clr = 0;
#4 prog = 1;

// 1 + 2 + 3 - 4 = 2
#4 a = 8'h0; d = 12'h007; // LDA 07H
#4 a = 8'h1; d = 12'h108; // ADD 08H
#4 a = 8'h2; d = 12'h109; // ADD 09H
Expand All @@ -33,6 +35,7 @@ module tb_sap2_mini;
#4 a = 8'h8; d = 12'h002; // 002H
#4 a = 8'h9; d = 12'h003; // 003H
#4 a = 8'ha; d = 12'h004; // 004H

#4 prog = 0; clr = 1;
#4 clr = 0;
end
Expand Down

0 comments on commit 555a27a

Please sign in to comment.