Forum Discussion

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

2-bit counter

Hi all

I need to design a 2-bit counter which output will change from 00-01-10-11 every time another counter counts up to a X value. I prefer VHDL but Verilog is fine too.

3 Replies

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

    Hi MorfiuM,

    Did you consider using the lpm_counter?

    Regards,

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

    Hi Scott

    I checked it out but since I am a very beginner I don't know how to use the file for what I need it to do.

    Thanks

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

    Hi Mick,

    > I don't know how to use the file for what I need it to do.

    Best place to get your feet wet is in the MegaWizard:

    1. Double-click somewhere in you schematic file. This will open the "Symbol"

    dialog window.

    2. In the "Libraries" explorer pane, navigate to: quartus->megafunctions->arithmetic.

    You'll see the extra path information, but it should be clear to you.

    3. Double-click: lpm_counter.

    4. Then just let the wizard guide you along ... flavor to your particular taste ;-)

    The end result will be a counter symbol you can place in your schematic.

    Regards,

    --Scott