Sie sind auf Seite 1von 2

module congand_2 (A, B, C);

input A, B;
output C;
assign C= B&A;
endmodule

module congand_3 (A, B, C, D);


input A, B, C;
output D;
assign D= B&A&C;
endmodule
module congnot_2 (A, B);
input wire A;
output wire B;
assign B = !A;
endmodule

module congxor_2 (x, y, k);


input x, y;
output k;
assign k = x╎y;
endmodule

module congxor_4 (x, y, z, k, l);


input x, y, z, k;
output l;
assign l = x╎y╎z╎k;
endmodule

module a (A, B, C, D, a);


input A, B, C, D;
output a;
Wire [5:0]day
congnot_2 U1(C, day[0]);
congnot_2 U2(B, day[1]);
congnot_2 U3(A, day[2]);
congand_2 U4(day[0], day[2], day[3]);
congand_2 U5(C, A, day[4]);
congand_2 U6(C, B, day[5]);
congxor_4 (D, day[3], day[4], day[5], a);
endmodule

module b (A, B, C, D, b);


input A, B, C, D;
output b;
Wire [4:0]day
congnot_2 U1(C, day[0]);
congnot_2 U2(B, day[1]);
congnot_2 U3(A, day[2]);
congand_2 U4(day[1], day[2], day[3]);
congand_2 U5(B, A, day[4]);
congxor_4 (D, C, day[3], day[4], b);
endmodule

module c (A, B, C, D, c);


input A, B, C, D;
output c;
Wire [0]day
congnot_2 U2(B, day[0]);
congxor_4 (D, C, day[0], A, c);
endmodule

module d (A, B, C, D, d);


input A, B, C, D;
output d;
Wire [6:0]day
congnot_2 U1(C, day[0]);
congnot_2 U2(B, day[1]);
congnot_2 U3(A, day[2]);
congand_2 U4(day[0], B, day[3]);
congand_2 U5(day[0], day[2], day[4]);
congand_2 U6(day[2], B, day[5]);
congand_3 U7(c, A, day[1], day[6]);
congxor_4 (day[3], day[4], day[5], day[6], d);
endmodule

module e (A, B, C, D, d);


input A, B, C, D;
output e;
Wire [3:0]day
congnot_2 U1(C, day[0]);
congnot_2 U2(A, day[1]);
congand_2 U3(day[0], day[1], day[3]);
congand_2 U4(day[1], B, day[3]);
congxor_2 (day[2], day[3], d);
endmodule

module f(A, B, C, D, f);


input A, B, C, D;
output f;
Wire [5:0]day
congnot_2 U1(C, day[0]);
congnot_2 U2(B, day[1]);
congnot_2 U3(A, day[2]);
congand_2 U4(day[1], C, day[3]);
congand_2 U5(day[1], day[2], day[4]);
congand_2 U6(C, day[1], day[5]);
congxor_4 (D, day[3], day[4], day[5], f);
endmodule

module g(A, B, C, D, g);


input A, B, C, D;
output g;
Wire [5:0]day
congnot_2 U1(C, day[0]);
congnot_2 U2(B, day[1]);
congnot_2 U3(A, day[2]);
congand_2 U4(day[1], C, day[3]);
congand_2 U5(day[2], B, day[4]);
congand_2 U6(B, day[10], day[5]);
congxor_4 (D, day[3], day[4], day[5], g);
endmodule