/** * Driver for the eight seven-segment displays of the Urbana board. * All displays of a display module share the segment signals. * Thus, the driver enables only one display per module at a time and * cycles through the four displays of each module. * In time slot s, display s (D1 module) and display s+4 (D0 module) are lit. * * @param i_clk 100 MHz clock signal. * @param i_values hex digits of the displays, bits [4k+3:4k] belong to display k. * @param i_enable enables the displays (active high), bit k belongs to display k. * @param o_d0_seg active-low segments [6:0] and decimal point [7] for displays 4-7. * @param o_d1_seg active-low segments [6:0] and decimal point [7] for displays 0-3. * @param o_d0_an active-low display-enable signals for displays 4-7. * @param o_d1_an active-low display-enable signals for displays 0-3. **/ module display_driver( input logic i_clk, input logic [31:0] i_values, input logic [7:0] i_enable, output logic [7:0] o_d0_seg, output logic [7:0] o_d1_seg, output logic [3:0] o_d0_an, output logic [3:0] o_d1_an ); logic [17:0] l_scan_counter = '0; logic [1:0] l_slot; always_ff @( posedge i_clk ) l_scan_counter <= l_scan_counter + 1'b1; // Advance to the next slot every 2^16 clocks (655.36 us). assign l_slot = l_scan_counter[17:16]; // TODO: select the hex digits of the two displays lit in the current slot. // TODO: instantiate one seven-segment decoder per display module. // TODO: set the display-enable signals and keep disabled displays off. endmodule