<반 가산기>
module half_adder(p0,p1,co,sum);
input p0;
input p1;
output co;
output sum;
wire w2;
wire w3;
wire w5;
wire w4;
assign co = w2;
assign sum = w3;
assign w5 = p0;
assign w4 = p1;
and(w2,w5,w4);
xor(w3,w5,w4);
endmodule
<신호등 모델>
module hw3(A,B,O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12);
input A, B;
output O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12;
wire anot;
wire bnot;
not(anot, A);
not(bnot, B);
and(O1, anot, bnot);
and(O7, anot, bnot);
and(O2, anot, B);
and(O8, anot, B);
or(O3, A, bnot);
or(O9, A, bnot);
and(O4, A, bnot);
and(O10, A, bnot);
and(O5, A, B);
and(O11, A, B);
or(O6, anot, bnot);
or(O12, anot, bnot);
endmodule
댓글 달기