Forum Discussion

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

representation of equation in vhdl

sir,

how can write l{n-(N-1)/2}l in vhdl???

3 Replies

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

    If n is an unsigned, signed or integer signal or variable and N is a constant, you can simply write the expression. Refer to a VHDL text book.

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

    sir, i want the mod value of this expression,for example,if the output is -4,i should have it as +4,etc.

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

    you can use the abs() function for that purpose. It should work on both integer and unsigned types.