aboutsummaryrefslogtreecommitdiffstats
path: root/tests/xilinx_ug901/top_mux.v
diff options
context:
space:
mode:
Diffstat (limited to 'tests/xilinx_ug901/top_mux.v')
-rw-r--r--tests/xilinx_ug901/top_mux.v18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/xilinx_ug901/top_mux.v b/tests/xilinx_ug901/top_mux.v
new file mode 100644
index 000000000..c23c7491c
--- /dev/null
+++ b/tests/xilinx_ug901/top_mux.v
@@ -0,0 +1,18 @@
+// Multiplexer using case statement
+module mux4 (sel, a, b, c, d, outmux);
+input [1:0] sel;
+input [1:0] a, b, c, d;
+output [1:0] outmux;
+reg [1:0] outmux;
+
+always @ *
+ begin
+ case(sel)
+ 2'b00 : outmux = a;
+ 2'b01 : outmux = b;
+ 2'b10 : outmux = c;
+ 2'b11 : outmux = d;
+ endcase
+ end
+endmodule
+