// Synthesizable, zero-delay generic circuit. Segment order: { g, f, e, d, c, b, a }.

module basic_display
(
    input        [3:0] bcd,
    input              le,
    input              lt_n,
    input              bi_n,
    output logic [6:0] seg
);

    logic [3:0] held;

    // Intentional level-sensitive latch, transparent when LE is low.
    // Start with LE=0; this part has no reset or guaranteed power-up data.
    // Blocking assignment models level-sensitive transparency consistently.
    always_latch
        if (~ le)
            held = bcd;

    always_comb
    begin
        if (~ lt_n)
            seg = 7'h7f;
        else if (~ bi_n)
            seg = '0;
        else
        begin
            case (held)
            4'd0:     seg = 7'h3f;
            4'd1:     seg = 7'h06;
            4'd2:     seg = 7'h5b;
            4'd3:     seg = 7'h4f;
            4'd4:     seg = 7'h66;
            4'd5:     seg = 7'h6d;
            4'd6:     seg = 7'h7c;
            4'd7:     seg = 7'h07;
            4'd8:     seg = 7'h7f;
            4'd9:     seg = 7'h67;
            default:  seg = '0;
            endcase
        end
    end

endmodule
