Forum Discussion

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

cos() function in Verilog

Maybe this question is stupid, but how would people take care of, say, cos(42) and log2(3) in Verilog? Thanks.

3 Replies

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

    If you have ample resources available (if area is not your top concern right now), you can also use ALTFP_SINCOS and ALTFP_LOG megafunctions.

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

    Well, use CORDIC to calculate cos() is straight forward. But what is the procedure to do log2(3) in CORDIC?