From bbe5aa446b413c6298a4b0b13f6fabcd6c984cb6 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 14 Sep 2013 11:23:45 +0200 Subject: Added spice backend --- techlibs/cmos/counter.v | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 techlibs/cmos/counter.v (limited to 'techlibs/cmos/counter.v') diff --git a/techlibs/cmos/counter.v b/techlibs/cmos/counter.v new file mode 100644 index 00000000..72208bd8 --- /dev/null +++ b/techlibs/cmos/counter.v @@ -0,0 +1,12 @@ +module counter (clk, rst, en, count); + + input clk, rst, en; + output reg [3:0] count; + + always @(posedge clk) + if (rst) + count <= 4'd0; + else if (en) + count <= count + 4'd1; + +endmodule -- cgit v1.2.3