Search code examples
binaryvhdlconstantsquartus

VHDL constants returning 10500 error in quartus II


I need to initialize a number of constants for seven segment display uses, but I am having some issues with them. Whenever I compile

constant displayR : type := b"01010000"; 

I get

Error (10500): VHDL syntax error at VendingMachine.vhd(62) near text "constant";  expecting "end", or "(", or an identifier ("constant" is a reserved keyword), or a concurrent statement

What do I need to do to get the constant to compile correctly?


Solution

  • You might want to declare a subtype for your seven segment display:

    subtype t_display is bit_vector(7 downto 0);
    constant displayR : t_display := "01010000";