Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Simple Question

Hi all,

I am new to VHDL, I have a question, I saw the code with this line

a <= X "FF" ;

Why they put X" " in front of FF, what's difference with the normal assign operator

a <= FF;

Thanks

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello,

    there's no different in the assignment operator, the difference is in what is being assigned.

    X"FF" is a hexadecimal constant (255)

    FF would be a signal named FF.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    When you have long binary vectors, to be shore you don't mistake some values, and to save time and space, it is recomanded to use hexadecimal values. That's why in your code it is used x"FF" insted of "11111111". It's still a std_logic_vector value.