Spring 2000
ENSC 151
DIGITAL AND COMPUTER DESIGN LABORATORY

Assignment #3: Music

Posted: February 15, 2000
Due: Monday, February 28, 2000, by 16:00 in the ENSC departmental office
Extended deadline: Friday, March 3, 2000, by 24:00 in the ENSC departmental office



Introduction by Tim Collings

Music in the western world is composed of notes based on what is known as the ``tempered'' scale whereby each octave is divided into 12 intervals (the seven white keys and 5 black keys on a standard keyboard scale).

Each octave is divided into 12 geometric intervals (also known as semi-tones = 2 ^ 1/12 = 1.0594). By knowing only one frequency we can work out the frequencies of all other notes. All musicians are probably familiar with the note A440 (the reference note that all musicians tune their instruments to). This key is found in the 4th octave (A4) and is exactly 440 Hz. A standard piano has 88 keys ranging from a low note of A1 to a high note of C8.

Of particular interest to our project is the "C" scale from C6 to C7 because the frequencies of these notes fall in the range of 1kHz to 2 kHz. The following 4 notes and frequencies can be used to play a simple bugle tune ("Taps", "The Last Post", "Reveille" etc.):
C6 (1046.5 Hz); E6 (1318.5 Hz); G6 (1568.0 Hz); C7 (2093.0 Hz);

Also the familiar "Charge" cry at sports games is preceded by the notes: C E G C G C ... "Charge!"

Assignment:

Create a VHDL program for the ALTERA FPGA to drive 2 output pins (headphone left, headphone right) at the above frequencies, linking C6 to sw[0] (yellow), E6 to sw[1] (orange), G6 to sw[2] (white), and C7 to sw[3] (blue). At the same time, you should have a program running on the HC12 that displays the switch status code on the LCD device.

Prioritize your output logic such that only one tone is generated no matter how many keys are pressed (make C7 have highest priority and C6 lowest).

Use the headphone jack attached to the FPGA pins 41 and 44 to listen to the output sound. Please locate a set of stereo headphones for your group to use.


Last modified: Wednesday February 24 16:31:07 PST 1999.