/**
* display_converter.sv - decodes a 5 bit digit input into its seven segment
*                        display equivalent using a lookup table. Display can
*                        do 0 - 9, A - F, individual segments and special
*                        characters.  
*
* @author: Dilanthi Prentice, Waylon Cude
* @date: 6/12/25
*
****/
module display_converter(
    input logic [4:0] digit, 
    output logic [6:0] segment
);

localparam ROM_SIZE=32;

//ROM lookup table for seven segment display
//blanks are unused space we could add characters to. 
localparam logic [6:0] segment_rom [0:ROM_SIZE-1] = '{
    7'b1111110, //0
    7'b0000110, //1
    7'b1101101, //2
    7'b1111001, //3
    7'b0110011, //4
    7'b1011011, //5
    7'b1011111, //6
    7'b1110000, //7
    7'b1111111, //8
    7'b1111011, //9

    7'b1110111, //A
    7'b0011111, //B
    7'b1001110, //C
    7'b0111101, //D
    7'b1001111, //E
    7'b1000111, //F

    7'b1000000, //segment a
    7'b0100000, //segment b
    7'b0010000, //segment c
    7'b0001000, //segment d
    7'b0000100, //segment e
    7'b0000001, //segment f

    7'b0110111, //H
    7'b0001110, //L
    7'b1110111, //R
    7'b0000110, //l 
    7'b0000101, //r

    7'b0000000, //blank
    7'b0000000, //blank
    7'b0000000, //blank
    7'b0000000, //blank
    7'b0000000  //blank
};

//use digit input to index segment_rom lookup table.
assign segment = segment_rom[digit];

endmodule
