Class Exercise: gj22-12 Octave-Counter Adder
10 points

OEES 235

Back to Main Page

 


 
The above circuit is part of a new tone translator octave shifter circuit. (This new version will be able to shift frequencies up and down by multiple octaves.) The OCQ0 - OQC2 signals come from the Octave Counter, which is an up/down counter containing a number representing the number of octaves to be shifted up or down. The LEFT_RIGHT signal is actually the fourth bit in the counter, but it serves to indicate whether the number representing the waveform's period should be shifted left or shifted right.

If LEFT_RIGHT is low, the frequency will be shifted to a higher octave, which means that the period will be shorter. For each octave higher, the period needs to be shifted one bit to the right, which will cause it to be half as large (one octave higher).

When LEFT_RIGHT is low, the exclusive-OR gates will pass the OCQ2 - OCQ0 signals through unchanged. Also, B0 as well as B1 - B3 will be zero. In other words, zero will be added to OAA2 - OAA0. Thus, OCQ2 - OCQ0 will pass unchanged to OCTCNTR2 - OCTCNTR0

If LEFT_RIGHT is high, the frequency will be shifted to a lower octave, which means that the period will be longer. For each octave lower, the period needs to be shifted one bit to the left, which will cause it to be twice as large (one octave lower).

When LEFT_RIGHT is high, the Octave Counter contains a negative number represented in two's complement form. (Wikipedia article on two's complements.) This number needs to be converted to a regular (positive) binary number. When two's complement is used to represent negative numbers, two simple rules apply: To convert a positive number to a negative number, take the two's complement of it. To convert a negative number to a positive number, take the two's complement of it. Thus, to convert a negative OCQ2 - OCQ0 to a positive, number we need to take the two's complement of it.  
Here's how to take the two's complement of a number: First, invert every bit in the number. Then, add one to the result. (e.g., the two's complement of  110 is 001 + 1 =  010. The binary number 110 is the two's complement representation of -2. And, of course, 010 in binary is 2 in decimal.

When LEFT_RIGHT is high, the exclusive-OR gates will act like inverters. Thus, OAA2 - OAA0 will be the inverse of OCQ2 - OCQ0. (e.g., if OAA2 - OAA0 are 1102, then OAA2 - OAA0 will be 0012.  The adder then adds 1 to this result, and the output of the adder will be 0102. In other words, the 110 coming from the Octave Counter represented a -2, meaning that the frequency should be shifted two octaves down. The circuit above converts this 110 into 010 (a positive 2). Because LEFT_RIGHT is high, the shift register will shift the period two bits to the left, which will will lower the frequency by two octaves.

Your job for this experiment is to fill in the truth table/timing diagram below. First, use the information above to

OCQ0  0  1   0  1    0  1    0  1    0  1   0   1   0  1  0   1
OCQ1  0  0  1  1  0  0  1  1  0  0  1   1  0  0  1  1
OCQ2 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
LEFT_RIGHT
OAA0
OAA1
OAA2
OCTCNTR0
OCTCNTR1
OCTCNTR2

Back to Main Page
1