Forum Discussion

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

vectors in VHDL 2

hi every body

im new to vhdl

i wanna write a code for this picture but for its N-scale

http://i41.tinypic.com/35ksllh.png

so i need to have N vectors with different length.N is a parameter.

how i should write the code?

4 Replies

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

    just have an array of vectors to the maximum length, and only use the number of bits you need. Bits left unconnected will be removed by the synthesisor.

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

    Another option is to build a recursive component that reduces the width of the input and output vector with each recursion.

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

    --- Quote Start ---

    Another option is to build a recursive component that reduces the width of the input and output vector with each recursion.

    --- Quote End ---

    thanks,but how i should do it?

    and in the main entity how i can use components output since the output has different length!?