gj21-08 Shift to Highest Octave
20 points
OEES 235

Back to Main Page
 
Legend:
  • LD_STHO = Load Shift to Highest Octave register.
  • Inputs Q11 to Q0 contain the period number.
  • Outputs STHO11 to STHO0 will contain the period number shifted to the highest octave on a piano keyboard.
  • OCTNUM3 to OCTNUM0 will contain a number indicating the original octave of the waveform received from the microphone.
    • A zero will indicate that the octave is the same as the highest octave on a piano keyboard.
    • A one will indicate that the octave is one octave lower than the highest octave on a piano keyboard..
    • A two will indicate two octaves lower, etc.
  • TOOLRG = Too Large. This signal should go high whenever the 12-bit shift-register contains a number higher than 042H (hexadecimal).



Note: The numbers shown on the bussed signals (Q, STHO, OCTNUM) are hexadecimal. Click here for an explanation of hexadecimal numbers.

For the tone translator, period numbers for the highest octave on the piano keyboard will range from 01DH to 042H. (H stands for hexadecimal.) The job of this circuit is (if necessary) to shift the period number to the right until it is 042H (0000 0100 0010 binary) or smaller. (Later, we will add circuitry to discard anything smaller than 01DH).

Once the period number has been shifted to bring it within the range of the highest octave on a piano keyboard, the job of determining what musical note (C, D, E, etc.) has come from the microphone will be much easier. In one tone translator mode of operation, the closest accurate musical note will be substituted for the actual frequency coming from the microphone. The octave shifter circuit we've already developed will then be used to shift this note to the desired octave.
  1. Before starting, right-click here to download the partial schematic shown above. You might as well download the test vector while you're at it by right-clicking here.
  2. The period number will be coming in on lines Q11 - Q0, and LD_STHO is the signal that should load this number into the shift register.
  3. We're using an 8-bit right-shift register (SRR38) and a 4-bit right-shift register (SRR34) to form a 12-bit right-shift register. (Below, we'll refer to the two combined shift registers as "the 12-bit right-shift register.")
    • Notice that Q11 goes to D0 on the 4-bit shift register. In other words, D0 on the 4-bit shift register is the most significant bit of the period number.
    • Lever's right-shift registers shift the bit in D2 into D3, the bit in D1 into D2, and the bit in D0 into D1. (In other words, it's backwards from what you'd think, with D0 being the most significant bit.)
  4.  Q3 of the 4-bit shift register should be connected to CAI  on the 8-bit shift register. 
    • CAI stands for "cascade in." When a register shifts right, whatever bit is on CAI will be shifted into flip-flop Q0. (This flip-flop is inside the shift-register.)
    • Output Q3 of the 4-bit register contains the bit that needs to go to flip-flop Q0 of the 8-bit register when a right-shift is performed.
  5. CAI on the 4-bit register should be connected to ground.
    • As numbers are shifted right, a low on CAI will cause zeroes to be shifted into Q0 of the 4-bit register (which is what we want to happen).
  6. The CD and PS inputs on a shift register are for clearing and presetting the flip-flops in a shift register. We won't be using these features, so connect these pins to ground.
  7. The MAG8 macro near the center of the schematic is an 8-bit magnitude comparator. It's job is to compare the number on its A inputs with the number on its B inputs and indicate whether A is greater than B, equal to B, or less than B. A high on the GT output indicates that A is greater than B. A high on EQ indicates it is equal to B. And, a high on LT indicates it is less than B.
    • Notice that on the schematic above, the binary number present on B7 to B0 is 0100 0010, which is equal to 42H.
    • 42H is the largest period number we want to have, because it represents the low-frequency end of the piano keyboard's highest octave.
  8. Here's the rule for when the 12-bit right-shift register should shift:
    • If  the high-order four bits (STHO11 to STH08) of  the 12-bit register are anything other than 0000, the register should be enabled to shift (seeing as how it contains a number greater than 042H).
    • Also, if  the low-order eight bits (STHO7 to STHO0) are greater than 42H, the register should be enabled to shift.
  9. The four-bit counter on the right of the schematic should start out with a zero in it and then count up while the shift register is enabled.
    • The counter should be cleared each time a number is loaded into the shift register.
    • The (active-high) CD input to the counter will clear it.
    • This counter will indicate the octave of the original signal from the microphone. The counter's outputs will be needed by other circuitry.
  10. Your job is to add one gate and some wires to partial schematic shown above to make it work as described above. You'll also need to add VCC and GND to macro input pins where needed.

Back to Main Page
1