summaryrefslogtreecommitdiff
path: root/mux2_1bit.v
diff options
context:
space:
mode:
Diffstat (limited to 'mux2_1bit.v')
-rwxr-xr-xmux2_1bit.v37
1 files changed, 37 insertions, 0 deletions
diff --git a/mux2_1bit.v b/mux2_1bit.v
new file mode 100755
index 0000000..3a5e225
--- /dev/null
+++ b/mux2_1bit.v
@@ -0,0 +1,37 @@
+`timescale 1ns / 1ps
+//////////////////////////////////////////////////////////////////////////////////
+// Company:
+// Engineer:
+//
+// Create Date: 11:34:03 09/27/2012
+// Design Name:
+// Module Name: mux2_1bit
+// Project Name:
+// Target Devices:
+// Tool versions:
+// Description:
+//
+// Dependencies:
+//
+// Revision:
+// Revision 0.01 - File Created
+// Additional Comments:
+//
+//////////////////////////////////////////////////////////////////////////////////
+module mux2_1bit(
+ input a,
+ input b,
+ input sel,
+ output o
+ );
+
+wire i1; // inverted sel
+wire a1, a2; // ands
+not n1(i1, sel);
+
+and and1(a1, a, sel);
+and and2(a2, b, i1);
+
+or or1(o, a1, a2);
+
+endmodule