From 26169bec7ae7b85d938f5d3c6e969885f2230541 Mon Sep 17 00:00:00 2001 From: jjsuperpower Date: Sun, 19 Jun 2022 22:20:25 -0500 Subject: added hdl folder --- hdl/testing/inc.v | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 hdl/testing/inc.v (limited to 'hdl/testing/inc.v') diff --git a/hdl/testing/inc.v b/hdl/testing/inc.v new file mode 100644 index 0000000..2f3291b --- /dev/null +++ b/hdl/testing/inc.v @@ -0,0 +1,39 @@ +// File: inc.v +// Generated by MyHDL 0.11 +// Date: Sun Jun 19 22:02:52 2022 + + +`timescale 1ns/10ps + +module inc ( + count, + enable, + clock, + reset +); +// Incrementer with enable. +// +// count -- output +// enable -- control input, increment when 1 +// clock -- clock input +// reset -- asynchronous reset input + +output [7:0] count; +reg [7:0] count; +input enable; +input clock; +input reset; + + +always @(posedge clock, negedge reset) begin: INC_SEQ + if (reset == 0) begin + count <= 0; + end + else begin + if (enable) begin + count <= (count + 1); + end + end +end + +endmodule -- cgit v1.2.3