fix module declarations
This commit is contained in:
5
and.v
5
and.v
@@ -4,10 +4,7 @@
|
||||
`include "nand.v"
|
||||
`include "not.v"
|
||||
|
||||
module And (a, b, out);
|
||||
input wire a;
|
||||
input wire b;
|
||||
output wire out;
|
||||
module And (input a, input b, output out);
|
||||
wire out_bar;
|
||||
|
||||
Nand u1(.a(a), .b(b), .out(out_bar));
|
||||
|
||||
7
mux.v
7
mux.v
@@ -5,12 +5,7 @@
|
||||
`include "and.v"
|
||||
`include "or.v"
|
||||
|
||||
module Mux (a, b, sel, out);
|
||||
input wire a;
|
||||
input wire b;
|
||||
input wire sel;
|
||||
output wire out;
|
||||
|
||||
module Mux (input a, input b, input sel, output out);
|
||||
wire sel_bar;
|
||||
wire a_sel;
|
||||
wire b_sel;
|
||||
|
||||
5
nand.v
5
nand.v
@@ -1,10 +1,7 @@
|
||||
`ifndef _nand_v
|
||||
`define _nand_v
|
||||
|
||||
module Nand (a, b, out);
|
||||
input wire a;
|
||||
input wire b;
|
||||
output wire out;
|
||||
module Nand (input a, input b, output out);
|
||||
|
||||
assign out=~(a&&b);
|
||||
endmodule
|
||||
|
||||
5
nor.v
5
nor.v
@@ -4,10 +4,7 @@
|
||||
`include "or.v"
|
||||
`include "not.v"
|
||||
|
||||
module Nor (a, b, out);
|
||||
input wire a;
|
||||
input wire b;
|
||||
output wire out;
|
||||
module Nor (input a, input b, output out);
|
||||
wire out_bar;
|
||||
|
||||
Or u1(.a(a), .b(b), .out(out_bar));
|
||||
|
||||
4
not.v
4
not.v
@@ -3,9 +3,7 @@
|
||||
|
||||
`include "nand.v"
|
||||
|
||||
module Not (in, out);
|
||||
input wire in;
|
||||
output wire out;
|
||||
module Not (input in, output out);
|
||||
|
||||
Nand u1(.a(in), .b(in), .out(out));
|
||||
endmodule
|
||||
|
||||
5
or.v
5
or.v
@@ -4,10 +4,7 @@
|
||||
`include "nand.v"
|
||||
`include "not.v"
|
||||
|
||||
module Or (a, b, out);
|
||||
input wire a;
|
||||
input wire b;
|
||||
output wire out;
|
||||
module Or (input a, input b, output out);
|
||||
wire a_bar;
|
||||
wire b_bar;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user