Forum Discussion

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

need help on digital tone generator.

i need to design a digital generator use quartusII and CPLD.

i am a begginer of this kind of digital design and i am totally lost.

i need to generate a song (digital tone), what should i do first?

and can anyone give me some good website?

many thx.

2 Replies

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

    Since you are using cpld then you don't have memory blocks to store any tables.

    The easiest way is to store one small cycle sinusoid on wires(e.g. as HDL constants) then run a clock to read the cycle out continuously.

    You can use several ways to change the tone e.g. different clocks or better different clock enable rate or jump the values using same clock.

    The equation for frequency would be this:

    f = clk frequency/number of data per cycle.

    An example 64 data cycle can be produced as follows:

    data = sin(2*pi*(0:63)/64)

    you will need to scale up the data to integers in hardware.

    Then sing the tone out...use audio range for your frequency so that human can enjoy the songs