Forum Discussion

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

initializing very long vectors

hi

i'm trying to create very long signals in vhdl, and initiate it with 101010101010

is there elegant way to initiate it ??

thanks...

2 Replies

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

    A for .. generate construct in the declarative part of the architecture or an initialisation function with a for loop iteration.

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

    you can also write literal values in hex (precede the literal with x):

    my_long_slv <= x"123FFFAA";

    another useful tip is you can put underscores in literals to separate groups of 4:

    my_slv <= "0001_0010_0011_1111_1111_1111_1010_1010";

    my_slv <= x"123F_FFAA";