diff options
Diffstat (limited to 'src/top.v')
-rw-r--r-- | src/top.v | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/top.v b/src/top.v new file mode 100644 index 0000000..8dc9684 --- /dev/null +++ b/src/top.v @@ -0,0 +1,21 @@ +module top ( + input clk, + input key, + output [5:0] led +); + +reg [25:0] ctr_q; +wire [25:0] ctr_d; + +// Sequential code (flip-flop) +always @(posedge clk) begin + if (key) begin + ctr_q <= ctr_d; + end +end + +// Combinational code (boolean logic) +assign ctr_d = ctr_q + 1'b1; +assign led = ctr_q[25:20]; + +endmodule |