//: version "1.6i" module PC(dl6, dl5, cl9, cl3, cl2, ol2); //: interface /sz:(40, 40) /bd:[ ] supply0 w3; //: /sn:0 {0}(425,435)(425,420)(412,420){1} input [7:0] dl6; //: /sn:0 {0}(307,270)(363,270)(363,298){1} input ol2; //: /sn:0 {0}(430,348)(436,348)(436,410)(412,410){1} supply0 w1; //: /sn:0 {0}(419,286)(419,255)(407,255){1} input cl3; //: /sn:0 {0}(311,415)(336,415){1} input cl9; //: /sn:0 {0}(308,314)(350,314){1} output [7:0] dl5; //: /sn:0 {0}(542,457)(522,457){1} input cl2; //: /sn:0 {0}(497,409)(514,409)(514,452){1} wire [7:0] w6; //: /sn:0 {0}(367,216)(367,241){1} wire [7:0] w0; //: /sn:0 {0}(383,270)(383,298){1} wire [7:0] w12; //: /sn:0 /dp:1 {0}(373,405)(373,327){1} wire w2; //: /sn:0 {0}(340,255)(359,255){1} wire [7:0] w5; //: /sn:0 /dp:5 {0}(373,426)(373,457)(456,457){1} //: {2}(460,457)(506,457){3} //: {4}(458,455)(458,223)(399,223)(399,241){5} //: enddecls //: input g4 (dl6) @(305,270) /sn:0 /w:[ 0 ] //: joint g8 (w5) @(458, 457) /w:[ 2 4 1 -1 ] //: supply0 g13 (w3) @(425,441) /sn:0 /w:[ 0 ] //: output g3 (dl5) @(539,457) /sn:0 /w:[ 0 ] //: input g2 (cl9) @(306,314) /sn:0 /w:[ 0 ] //: input g1 (cl3) @(309,415) /sn:0 /w:[ 0 ] bufif1 g11 (.Z(dl5), .I(w5), .E(cl2)); //: @(512,457) /sn:0 /w:[ 1 3 1 ] //: dip g10 (w6) @(367,206) /w:[ 0 ] /st:1 add g6 (.A(w6), .B(w5), .S(w0), .CI(w1), .CO(w2)); //: @(383,257) /sn:0 /w:[ 1 5 0 1 1 ] mux g7 (.I0(dl6), .I1(w0), .S(cl9), .Z(w12)); //: @(373,314) /sn:0 /w:[ 1 1 1 1 ] //: supply0 g9 (w1) @(419,292) /sn:0 /w:[ 0 ] //: comment g14 /dolink:0 /link:"" @(497,256) /sn:0 /R:3 //: /line:"dl5 PC to bus" //: /line:"dl6 bus to PC" //: /line:"" //: /line:"cl2 PC to bus" //: /line:"cl3 load pc" //: /line:"cl9 INC to PC (not BUS to PC)" //: /end register g5 (.Q(w5), .D(w12), .EN(w3), .CLR(ol2), .CK(cl3)); //: @(373,415) /sn:0 /w:[ 0 0 1 1 1 ] //: input g0 (cl2) @(495,409) /sn:0 /w:[ 0 ] //: input g12 (ol2) @(428,348) /sn:0 /w:[ 0 ] endmodule module ALU(cl10, dl13, dl12, dl14); //: interface /sz:(94, 75) /bd:[ Ti0>dl12[7:0](76/94) Bi0>cl10[1:0](71/94) Bi1>dl13[7:0](20/94) Lo0dl1[7:0](58/84) Li0>cl8(69/95) Li1>cl1(51/95) Li2>cl0(33/95) Bi0>ol2(32/84) Ri0>dl2[7:0](42/95) To0 BUS" //: /line:"cl1 LOAD ACC" //: /line:"cl8 ALU-> ACC" //: /line:"" //: /line:"dl1 BUSTOACC" //: /line:"dl2 ALUTOACC" //: /line:"dl3 ACCTOALU" //: /line:"dl4 ACCTOBUS" //: /line:"" //: /end //: joint g8 (dl3) @(207, 302) /w:[ 2 4 -1 1 ] bufif1 g3 (.Z(dl4), .I(dl3), .E(cl0)); //: @(275,341) /sn:0 /w:[ 1 0 1 ] //: input g13 (dl1) @(157,179) /sn:0 /w:[ 0 ] //: supply0 g2 (w3) @(269,281) /sn:0 /w:[ 0 ] register g1 (.Q(dl3), .D(w8), .EN(w3), .CLR(ol2), .CK(cl1)); //: @(207,269) /sn:0 /w:[ 5 1 1 1 1 ] //: input g11 (cl8) @(145,216) /sn:0 /w:[ 0 ] //: input g10 (cl1) @(134,269) /sn:0 /w:[ 0 ] //: input g6 (cl0) @(249,319) /sn:0 /w:[ 0 ] //: output g7 (dl4) @(308,341) /sn:0 /w:[ 0 ] mux g9 (.I0(dl1), .I1(dl2), .S(cl8), .Z(w8)); //: @(207,216) /sn:0 /w:[ 1 1 1 0 ] //: output g5 (dl3) @(251,302) /sn:0 /w:[ 3 ] //: input g0 (ol2) @(256,243) /sn:0 /w:[ 0 ] //: input g12 (dl2) @(159,156) /sn:0 /w:[ 0 ] endmodule module MMU(cl13, ol2, cl5, cl14, cl7, cl6, dl9, ol1, dl11); //: interface /sz:(100, 100) /bd:[ Ti0>dl9[7:0](18/100) Bi0>ol2(24/100) Ri0>cl5(17/100) Ri1>cl6(37/100) Ri2>cl13(57/100) Ri3>cl14(77/100) Ri4>cl7(48/100) Bo05 Li0>1 Li1>1 Li2>1 Bi0>1 Bo0<1 ] //: switch g13 (w14) @(-141,211) /sn:0 /w:[ 0 ] /st:1 //: comment g2 /dolink:0 /link:"" @(-49,-107) /sn:0 //: /line:"Other Lines" //: /line:" MMU: " //: /line:" ol1 memory done" //: /line:" ol2 clear all registers" //: /line:"" //: /end //: comment g1 /dolink:0 /link:"" @(296,-88) /sn:0 //: /line:"Data Lines" //: /line:"ACC:" //: /line:" dl1 BUSTOACC" //: /line:" dl2 ALUTOACC" //: /line:" dl3 ACCTOALU" //: /line:" dl4 ACCTOBUS" //: /line:"" //: /line:"PC:" //: /line:" dl5 PCTOBUS" //: /line:" dl6 BUSTOPC" //: /line:"" //: /line:"CU:" //: /line:" dl7 BUSTOIR" //: /line:" dl8 ADDRTOBUS" //: /line:"" //: /line:"MMU:" //: /line:" dl9 BUSTOMAR" //: /line:" dl11 MDRTOBUS" //: /line:"" //: /line:" " //: /line:"ALU:" //: /line:" dl12 BUSTOALU" //: /line:" dl13 ACCTOALU" //: /line:" dl14 ALUTOACC" //: /end //: joint g11 (w3) @(-80, -121) /w:[ 1 -1 2 4 ] led g16 (.I(w17)); //: @(15,231) /sn:0 /w:[ 0 ] /type:1 ACC g10 (.dl1(w19), .cl8(w15), .cl1(w14), .cl0(w13), .ol2(w3), .dl2(w18), .dl4(w16), .dl3(w17)); //: @(-110, 160) /sz:(84, 95) /sn:0 /p:[ Ti0>1 Li0>1 Li1>1 Li2>1 Bi0>0 Ri0>1 To0<1 Bo0<1 ] ALU g19 (.dl12(w1), .cl10(w6), .dl13(w11), .dl14(w4)); //: @(61, 173) /sz:(94, 75) /sn:0 /p:[ Ti0>0 Bi0>1 Bi1>1 Lo0<0 ] //: switch g6 (w0) @(-152,-44) /sn:0 /w:[ 0 ] /st:1 //: switch g7 (w7) @(-152,-76) /sn:0 /w:[ 0 ] /st:1 //: switch g9 (w3) @(-153,-121) /sn:0 /w:[ 3 ] /st:1 led g15 (.I(w16)); //: @(-91,115) /sn:0 /w:[ 0 ] /type:1 //: dip g20 (w1) @(137,131) /sn:0 /w:[ 1 ] /st:2 //: dip g17 (w18) @(15,93) /sn:0 /w:[ 0 ] /st:16 //: dip g5 (w5) @(-129,49) /sn:0 /w:[ 0 ] /st:0 //: switch g14 (w15) @(-141,244) /sn:0 /w:[ 0 ] /st:1 //: dip g21 (w11) @(36,289) /sn:0 /w:[ 0 ] /st:6 //: dip g23 (w6) @(177,272) /sn:0 /w:[ 0 ] /st:0 //: comment g0 /dolink:0 /link:"" @(175,-111) /sn:0 //: /line:"Control Lines (From BOOK)" //: /line:"" //: /line:"ACC:" //: /line:" cl0 ACC->BUS " //: /line:" cl1 load ACC" //: /line:" cl8 ALU->ACC" //: /line:"" //: /line:"PC:" //: /line:" cl2 PC->BUS" //: /line:" cl3 load PC" //: /line:" cl9 inc PC" //: /line:"" //: /line:"CU:" //: /line:" cl4 LOAD IR" //: /line:" cl12 Addr->BUS" //: /line:"" //: /line:"MMU:" //: /line:" cl5 LOAD MAR" //: /line:" cl6 MDR->BUS" //: /line:" cl7 LOAD MDR" //: /line:" cl13 CS" //: /line:" cl14 R/notW" //: /line:"" //: /line:"ALU:" //: /line:" cl10 ALUOP" //: /line:" cl11 ALUOP" //: /end led g22 (.I(w4)); //: @(47,148) /sn:0 /w:[ 1 ] /type:1 //: switch g12 (w13) @(-142,145) /sn:0 /w:[ 0 ] /st:1 //: dip g18 (w19) @(-31,122) /sn:0 /w:[ 0 ] /st:255 endmodule