Added 1-bit and 9-bit OR and NOR modules

This commit is contained in:
WilliamMiceli
2019-02-15 16:16:13 -05:00
parent 365fb5f648
commit 393f7e7fc5
2 changed files with 121 additions and 8 deletions

View File

@@ -222,6 +222,58 @@ module nor_1bit(
endmodule
module nor_9bit(
input wire [8:0] A,
input wire [8:0] B,
output wire [8:0] C);
nor_1bit nor0(
.A(A[0]),
.B(B[0]),
.C(C[0]));
nor_1bit nor1(
.A(A[1]),
.B(B[1]),
.C(C[1]));
nor_1bit nor2(
.A(A[2]),
.B(B[2]),
.C(C[2]));
nor_1bit nor3(
.A(A[3]),
.B(B[3]),
.C(C[3]));
nor_1bit nor4(
.A(A[4]),
.B(B[4]),
.C(C[4]));
nor_1bit nor5(
.A(A[5]),
.B(B[5]),
.C(C[5]));
nor_1bit nor6(
.A(A[6]),
.B(B[6]),
.C(C[6]));
nor_1bit nor7(
.A(A[7]),
.B(B[7]),
.C(C[7]));
nor_1bit nor8(
.A(A[8]),
.B(B[8]),
.C(C[8]));
endmodule
module not_1bit(
input wire A,
output wire B);
@@ -272,6 +324,67 @@ module not_9bit(
endmodule
module or_1bit(
input wire A,
input wire B,
output wire C);
assign C = A | B;
endmodule
module or_9bit(
input wire [8:0] A,
input wire [8:0] B,
output wire [8:0] C);
or_1bit or0(
.A(A[0]),
.B(B[0]),
.C(C[0]));
or_1bit or1(
.A(A[1]),
.B(B[1]),
.C(C[1]));
or_1bit or2(
.A(A[2]),
.B(B[2]),
.C(C[2]));
or_1bit or3(
.A(A[3]),
.B(B[3]),
.C(C[3]));
or_1bit or4(
.A(A[4]),
.B(B[4]),
.C(C[4]));
or_1bit or5(
.A(A[5]),
.B(B[5]),
.C(C[5]));
or_1bit or6(
.A(A[6]),
.B(B[6]),
.C(C[6]));
or_1bit or7(
.A(A[7]),
.B(B[7]),
.C(C[7]));
or_1bit or8(
.A(A[8]),
.B(B[8]),
.C(C[8]));
endmodule
module register(input wire clk, reset,
input wire [1:0] En,
input wire [8:0] Din,