aboutsummaryrefslogtreecommitdiffstats
path: root/tests/xilinx_ug901/latches.v
diff options
context:
space:
mode:
Diffstat (limited to 'tests/xilinx_ug901/latches.v')
-rw-r--r--tests/xilinx_ug901/latches.v17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/xilinx_ug901/latches.v b/tests/xilinx_ug901/latches.v
new file mode 100644
index 000000000..09d0f9f73
--- /dev/null
+++ b/tests/xilinx_ug901/latches.v
@@ -0,0 +1,17 @@
+// Latch with Positive Gate and Asynchronous Reset
+// File: latches.v
+module latches (
+ input G,
+ input D,
+ input CLR,
+ output reg Q
+ );
+always @ *
+begin
+ if(CLR)
+ Q = 0;
+ else if(G)
+ Q = D;
+end
+
+endmodule