Files
fpga-stuff/gate/gate.v

26 lines
522 B
Verilog

`default_nettype none
`include "div3.v"
module gate (CLK, PIN_24, LED, USBPU);
input wire CLK;
output wire PIN_24;
output wire LED;
output wire USBPU;
// (TinyFPGA) drive USB pull-up resistor to '0' to disable USB
assign USBPU = 0;
localparam N=23;
reg [N:0] counter=0;
always @(posedge CLK)
counter <= counter+1;
assign LED=counter[N];
// divide-by-3 counter from older version of 68b50-dual-serial
div3 dut(.clk(counter[N]), .r(1), .q(PIN_24));
endmodule