33 lines
771 B
Systemverilog
33 lines
771 B
Systemverilog
/***
|
|
* sixty_display.sv - converts a binary digit from zero to fifty-nine to its
|
|
* ones and tens digits and then gets the seven segment
|
|
* display equivalents of them.
|
|
*
|
|
* @author: Dilanthi Prentice, Waylon Cude
|
|
* @date: 6/12/25
|
|
*
|
|
*/
|
|
|
|
module sixty_display
|
|
(
|
|
input [$clog2(60)-1:0] number,
|
|
output [6:0] display_tens,
|
|
output [6:0] display_ones
|
|
);
|
|
|
|
logic [4:0] ones_digit;
|
|
logic [4:0] tens_digit;
|
|
|
|
//convert digit to ones and tens places
|
|
always_comb
|
|
begin
|
|
ones_digit = number % 10;
|
|
tens_digit = number / 10;
|
|
end
|
|
|
|
//convert both ones and tens place digits to their seven segement equivalent
|
|
display_converter ones (ones_digit, display_ones);
|
|
display_converter tens (tens_digit, display_tens);
|
|
|
|
endmodule
|