summaryrefslogtreecommitdiff
path: root/verilog/mux_2to1.v
diff options
context:
space:
mode:
authorMichael Abed <michaelabed@gmail.com>2012-12-02 12:13:10 -0500
committerMichael Abed <michaelabed@gmail.com>2012-12-02 12:13:10 -0500
commite64c18d0e30c33fe4609c881620fa937da7b8ce3 (patch)
tree1caab3c1934a97fbff1faef1076e34f06c994a6c /verilog/mux_2to1.v
downloadec413-lab5-master.tar.gz
ec413-lab5-master.tar.bz2
ec413-lab5-master.zip
make git repoHEADmaster
Diffstat (limited to 'verilog/mux_2to1.v')
-rwxr-xr-xverilog/mux_2to1.v34
1 files changed, 34 insertions, 0 deletions
diff --git a/verilog/mux_2to1.v b/verilog/mux_2to1.v
new file mode 100755
index 0000000..48ad684
--- /dev/null
+++ b/verilog/mux_2to1.v
@@ -0,0 +1,34 @@
+`timescale 1ns / 1ps
+//////////////////////////////////////////////////////////////////////////////////
+// Company:
+// Engineer:
+//
+// Create Date: 13:02:11 10/05/2012
+// Design Name:
+// Module Name: mux_2to1
+// Project Name:
+// Target Devices:
+// Tool versions:
+// Description:
+//
+// Dependencies:
+//
+// Revision:
+// Revision 0.01 - File Created
+// Additional Comments:
+//
+//////////////////////////////////////////////////////////////////////////////////
+module mux_2to1(
+ output out,
+ input sel,
+ input o0,
+ input o1
+ );
+
+wire a1, a2, n;
+not n1(n, sel);
+and ag1(a1, o0, n);
+and ag2(a2, o1, sel);
+or og1(out, a1, a2);
+
+endmodule