-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathled_diagnostic.v
More file actions
33 lines (27 loc) · 985 Bytes
/
led_diagnostic.v
File metadata and controls
33 lines (27 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// ============================================================================
// LED DIAGNOSTIC — Identify which LED is which pin
// phi^2 + 1/phi^2 = 3 = TRINITY
//
// Clock: 50 MHz (QMTECH Artix-7 XC7A100T)
// LED0: T23 (fast blink ~6 Hz)
// LED1: R23 (slow blink ~1.5 Hz)
//
// If you see fast blink, that's T23
// If you see slow blink, that's R23
// ============================================================================
`default_nettype none
module led_diagnostic_top (
input wire clk, // 50 MHz
output wire led0, // T23
output wire led1 // R23
);
// Counter for timing
reg [24:0] counter = 25'd0;
always @(posedge clk) begin
counter <= counter + 1'b1;
end
// LED0: Fast blink (~6 Hz) - counter[22] = 50MHz / 2^23 = ~5.96 Hz
// LED1: Slow blink (~1.5 Hz) - counter[24] = 50MHz / 2^25 = ~1.49 Hz
assign led0 = counter[22]; // T23 - FAST
assign led1 = counter[24]; // R23 - SLOW
endmodule