]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - fpga/util.v
Initial commit for the firmware. Used the 20090306_ela version as baseline.
[proxmark3-svn] / fpga / util.v
diff --git a/fpga/util.v b/fpga/util.v
new file mode 100644 (file)
index 0000000..c500edb
--- /dev/null
@@ -0,0 +1,27 @@
+//-----------------------------------------------------------------------------\r
+// General-purpose miscellany.\r
+//\r
+// Jonathan Westhues, April 2006.\r
+//-----------------------------------------------------------------------------\r
+\r
+module mux8(sel, y, x0, x1, x2, x3, x4, x5, x6, x7);\r
+    input [2:0] sel;\r
+    input x0, x1, x2, x3, x4, x5, x6, x7;\r
+    output y;\r
+    reg y;\r
+\r
+always @(x0 or x1 or x2 or x3 or x4 or x5 or x6 or x7 or sel)\r
+begin\r
+    case (sel)\r
+        3'b000: y = x0;\r
+        3'b001: y = x1;\r
+        3'b010: y = x2;\r
+        3'b011: y = x3;\r
+        3'b100: y = x4;\r
+        3'b101: y = x5;\r
+        3'b110: y = x6;\r
+        3'b111: y = x7;\r
+    endcase\r
+end\r
+\r
+endmodule\r
Impressum, Datenschutz