All checks were successful
ci/woodpecker/push/test-workflow Pipeline was successful
How tf did it break bro
37 lines
1.0 KiB
Systemverilog
37 lines
1.0 KiB
Systemverilog
/***
|
|
* display_anode_driver.sv - Turns on a single anode of a single digit at a time,
|
|
* rapidly rotating through all of them, generating
|
|
* a solid-looking display even though only one digit
|
|
* is on at a time.
|
|
*
|
|
* @author: Waylon Cude, Dilanthi Prentice
|
|
* @date: 6-12-2025
|
|
*
|
|
* */
|
|
|
|
// NOTE: This expects to be driven with a 100khz clock but can be altered in
|
|
// the nexys_a7_top.sv file.
|
|
module display_anode_driver(
|
|
input logic clk,
|
|
input logic reset,
|
|
output logic [7:0] AN,
|
|
output logic [2:0] mux_select);
|
|
|
|
// Initialize this once, it can be free-running after
|
|
logic started;
|
|
|
|
// This is just a shift register that drives each anode individually
|
|
always_ff @(posedge clk) begin
|
|
if (reset) begin
|
|
AN <= '1 - 1;
|
|
mux_select <= 0;
|
|
started <= 1;
|
|
end
|
|
else begin
|
|
AN <= {AN[6:0], AN[7]};
|
|
// Letting this overflow will automatically reset it
|
|
mux_select <= mux_select + 1;
|
|
end
|
|
end
|
|
endmodule
|