











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












page 1 S. Derenzo
NAME (please print)
College of Engineering
Electrical Engineering and Computer Sciences
24a _________________ 24b _________________
Total of top 4 Long Lab Grades
Total of top 4 Short Lab Grades
Lab Participation
Mid-Term #
Mid-Term #
Final Exam
Total Course Grade
_______________ (400 max)
_______________ (100 max)
_______________ (100 max)
_______________ (100 max)
_______________ (100 max)
_______________ (200 max)
_______________ (1000 max)
Answer the questions on the following pages completely, but as concisely as possible. The exam
is to be taken closed book. Use the reverse side of the exam sheets if you need more space.
Calculators are OK.
Partial credit can only be given if you show your work.
1 __________ (30 max) 2 __________ (30 max) 3 __________ (45 max)
4 __________ (40 max) 5 __________ (55 max)
TOTAL __________ (200 max)
Initials
Spring 2011 EECS 145M Final Exam page 2 S. Derenzo
PROBLEM 1 (total 30 points)
In this course we discussed the following analog and digital interfacing circuits:
Tri-state driver D-type flip-flop
Transparent latch Comparator
Sample-and-Hold amplifier Difference amplifier
Exclusive OR Digital delay
1 .1 (10 points) How would you use one or more of these for removing digital glitches at the
output of a 16-bit digital counter or clock where no handshaking lines are provided?
1.2 (10 points) How would you use one or more of these to sample an analog signal at a precise
instant in time defined by a low-to-high logic level?
1.3 (10 points) How would you use one or more of these to sample an 8-bit digital signal at a
precise instant in time defined by a low-to-high logic level?
Initials
Spring 2011 EECS 145M Final Exam page 4 S. Derenzo
PROBLEM 3 (45 points) Design a computer-controlled system for testing eight 12 - bit A/D
converters.
You are provided with the following:
You may assume the following:
be written to the port every 2 μs.
conversion provides an “output data available” low-to-high edge. The A/D converter sets
“output data available” low and resets all internal functions when “start conversion” goes
low.
Hint: Think about Laboratory Exercise 9 (A/D converters) and how you would automate the
measurement and data analysis procedures.
3.1 (15 points) Draw a block diagram of the major components, including two of the eight A/D
converters being tested. Show and label all essential data and control lines.
Initials
Spring 2011 EECS 145M Final Exam page 5 S. Derenzo
3.2 (10 points) List the steps your program must do to measure the first transition voltage
V(0,1) of the first A/D converter (pseudocode is OK, so long as the logic is clear).
3.3 (10 points) How would you determine the maximum linearity error of the eight A/D
converters?
3.4 (10 points) With what accuracy could this system measure the quantities in parts 3.2 and
3.3 in units of 1 LSB of the A/D?
Initials
Spring 2011 EECS 145M Final Exam page 7 S. Derenzo
4.3 (10 points) Use one of the above theorems to explain how frequency aliasing occurs in the
Fourier transform of a sampled waveform and how its effects can be controlled.
4.4 (10 points) Use one of the above theorems to explain how spectral leakage occurs in the
Fourier transform of a sampled waveform and how its effects can be controlled.
Initials
Spring 2011 EECS 145M Final Exam page 8 S. Derenzo
PROBLEM 5 (total 55 points):
You wish to measure very small signals in the frequency range from 0 to 8,000 Hz to an
accuracy of 1%. You design and build a sensor and amplifier system to do this but see
background noise at the output on your oscilloscope. The noise has both a random component
(white noise from your amplifier) and periodic components (electromagnetic interference from
unknown external circuits). In this problem you will sample and analyze the noise.
5.1 (12 points) Design a system for sampling the noise waveform at 32,768 Hz and determining
its frequency content from 0 to 8,000 Hz so that two components 1 Hz apart can be individually
resolved. Sketch your design in block form, including the system to be tested, interfacing
circuits, and computer. Label all components and signals.
5.2 (12 points) Describe in detail your process of sampling the signal and performing the FFT.
Note: the FFT was designed for a number of samples that is a power of two.
Initials
Spring 2011 EECS 145M Final Exam page 10 S. Derenzo
5.5 (12 points) Knowing the precise period from part 5.4, how could you reconstruct its time
waveform separate from all the other noise backgrounds with the highest signal to noise ratio?
145M Final Exam Solutions page 1 May 10, 20101 S. Derenzo
College of Engineering
Electrical Engineering and Computer Sciences Department
145M Microcomputer Interfacing Lab
Final Exam Solutions May 10, 2011
1.1 When the output of a 16-bit digital counter or clock changes value, not all the bits will
change at exactly the same time. From the time when the first bit changes until the time the
last bit changes the data will be erroneous (i.e. a glitch). One way to prevent the receiver
from reading the erroneous data is to provide a “data valid” handshaking line. If this is not
available, the “data valid” signal can be generated in the same way as was described for
deglitching the analog output of D/A converters.
Since a handshaking line was not provided in the problem, for full credit the answer needed
to have (1) 16 digital output lines and (2) a circuit that generates a “data invalid” pulse that
was asserted when any bit could be changing.
A final transparent latch or D-type flip-flop was not necessary but was accepted (their
outputs will have the same glitches if read without a handshaking line)
[5 points off for connecting a S/H amplifier to the output; the S/H has one analog input and
one analog output]
[5 points off for a single input line with delay and one exclusive OR but other bits and no
inclusive OR to generate the “data valid” line]
1.2 Use a S/H amplifier that goes into hold mode on the digital edge
[5 points off for using digital components or interconnecting analog and digital signals]
1.3 Use eight D-type flip-flops that latch the 8 bits of data on the clock edge. Eight transparent
latches could also work if they went from transparent to hold on the control edge.
[5 points off for using eight tri-state drivers, which have no latching capability]
145M Final Exam Solutions page 3 May 10, 20101 S. Derenzo
The following are essential:
Note: S/H amplifiers are not needed since the D/A can provide the hold
12 bits in parallel)
combined with next signal)
essential)
completed conversion
[7 points off for omitting the D/A converter]
[5 points off for not connecting the tri-states to form a 12-bit bus and using 8 digital input
ports]
[3 points off for using the A/D data available lines to control the tri-states; the computer will
never know when to read the bus]
3.2 The steps needed to measure the first transition voltage V(0,1) for the first A/D converter.
1 set SC1 low, disable all tri-state drivers, set N = 0 (16 bits)
2 Put N on D/A
3 wait 10μs until D/A has settled [using wait(10)]
145M Final Exam Solutions page 4 May 10, 20101 S. Derenzo
4 Put low-high edge on SC1 output line to start conversion
5 Wait until output data available
6 enable tri-state 1 (disable all others)
7 read input port to get value M
8 Put high-low edge on SC1 output port to end conversion cycle
9 if M=0, increase N by one and loop back to step 2
10 If M=1, save (D/A voltage step)(N-1/2) as the transition voltage
[1 point off for not starting the D/A input at zero]
[2 points off for not testing the A/D output for the 0 to 1 transition]
[3 points off for not incrementing the D/A input until a A/D transition occurs]
[2 points off for not waiting for D/A to settle]
[2 points off for not waiting for A/D output data available signal; you do not know the
conversion time]
[2 points off for not enabling tri-state #1 while putting all others in high-impedance mode]
3.3 Send successive 16-bit numbers 0 to 2
output with the A/D. Whenever the A/D output value changes, store the corresponding D/A
value in a transition voltage table
Determine the D/A values corresponding to first and last A/D transition voltages, and the
equation of the line that passes through them. Linearity is a measure of how closely the
other measured transition values pass through the line.
[3 points off for determining maximum differential linearity or maximum absolute accuracy]
[3 points off for using the maximum deviation between the measured and ideal A/D output,
which can never be better than ½ LSB. The linearity error for the A/D is the difference
between the measured and ideal transition voltages, which can be much better than ½ LSB]
[3 points off for using the average value of the inputs that make the output = 0 rather than
determining the transition voltage directly]
3.4 The method can determine the A/D accuracies to 1/16 A/D LSB (±1/32 LSB was OK).
Note that 1 A/D LSB = 16 D/A LSBs.
[7 points off for an answer <1/128 A/D LSB]
[7 points off for an answer > 2 A/D LSB]
[5 points off for an answer of 1/2 or 1 A/D LSB]
4 .1 Fourier Convolution Theorem: The Fourier transform of the convolution of two functions is
equal to the product of their Fourier transforms (Textbook p 391, lecture slide #237).
[3 points off for stating the Fourier Frequency Convolution Theorem]
4.2 Fourier Frequency Convolution Theorem: The Fourier transform of the product of two
functions is equal to the convolution of their Fourier transforms (Textbook p 394, lecture
slide #244)
[7 points off for writing the same thing in 4.1 and 4.2]
145M Final Exam Solutions page 6 May 10, 20101 S. Derenzo
Essential components for a complete solution were
[5 points off if no LPF or design; you were supposed to know that an anti-aliasing filter is
always required when sampling a signal that is not band limited]
[3 points off if LPF but no design]
[2 points off for f C
around 8 kHz and nothing more]
Since 1% accuracy was desired from 0 to 8,000 Hz, a low-pass filter with a gain of 0.99 at
8,000 Hz was required. To reduce the white noise and higher periodic harmonics, a gain of
0.01 at frequencies that could alias to 8,000 Hz was also required.
f1 = 8,000 Hz where G1 = 0.
f2 = fs - f1 = 24, 768 Hz where G2 = 0.
The lowest order filter that drops from a gain of 0.99 to 0.01 over a factor of 3.096 in
frequency is n = 6.
At G1 f/fc = 0.723; at G2 f/fc = 2.154; the frequency ratio is 2.
8,000 Hz/0.723 < fc < 24,768/2.
Answer is n = 6; 11,065 Hz < fc < 11,499 Hz
n = 8 and n = 10 were also accepted for full credit
5.2 For peaks separated by 1 Hz to be individually resolved, need at least S = 3 s. Here we
choose S = 4 s which keeps the number of samples a power of 2. The Fourier frequencies
are separated by 1/S = 0.25 Hz. (S = 2 s was accepted)
145M Final Exam Solutions page 7 May 10, 20101 S. Derenzo
wait until clock_count > c
send convert signal
wait until data available received
read noise data and store in array(k)
c = c + 1; k = k + 1
loop back to 2) until c = S x 32,
multiply data by raised cosine window
perform FFT
[4 points off if no raised cosine window; you were supposed to know that such a window is
always required before the FFT if you can not guarantee that all harmonics in the signal will
be sampled for a whole number of cycles]
[2 points off for sampling for 1 second; this would not make two components 1 Hz apart to
be individually resolved]
[4 points off for sampling for 0.5 seconds]
5.3 The random white noise will have a uniform spread of Fourier amplitudes over all the
frequencies below 8,000 Hz that are passed by the LPF. Period noise would appear as one
peak or evenly spaced peaks that correspond to the harmonics.
[2 points of for not describing the random noise as being spread over all frequencies passed
by the LPF]
[3 points off for describing random or periodic, but not both]
5.4 Sampling for 4 sec will make the first harmonics of the periodic 440 Hz to 441 Hz appear
somewhere around Fourier frequency index n = fS = (440.5 Hz) (4s) = 1,762. The 18th
harmonic will be the harmonic near 7,900 Hz, near frequency index 31,700. The frequency
index of the18th harmonic peak can be determined to 1 part in 31,700 and the frequency of
the first harmonic can be determined to an accuracy of one part in 32k or 440Hz/32k =
0.013 Hz. Since we need the accuracy to be 0.001 Hz, we need to sample 16 times longer or
64 s.
Sampling for 64 s places the 18th harmonic near frequency index n = 18fS = 18 (440.5 Hz)
(64 s) = 507,000. The frequency index of the18th harmonic peak can be determined to 1 part
in 507,000 and the frequency of the first harmonic can be determined to an accuracy of one
part in 507k or 440Hz/507k = 0.0009 Hz
[8 points off for S = 1 s, which cannot provide 0.001 Hz accuracy]
[4 points off for S = 1000 s or more, which makes ∆f < 0.001 Hz in the FFT but certainly
not in the shortest possible time]
[5 points off for a careful analysis of the ratio of amplitudes because the amplitudes also
include other random and periodic noise and will prevent a frequency determination good to
0.001 Hz in 440 Hz.]
[5 points off for sweeping through many values of S to find one where the first harmonic is
centered exactly on one FFT frequency. This is slow.]
[6 points off for sweeping a notch filter through frequencies; Fourier techniques were
required]
[3 points off for searching through the FFT to find a “clean” harmonic peak centered exactly
on one FFT frequency. This depends too much on luck.]
145M Final Exam Solutions page 9 May 10, 20101 S. Derenzo
145M Numerical Grades:
Short
labs
Long
labs
Lab Partic. Midterm #1 Midterm #2 Final Total
Average 90.6 365.8 96.0 77.2 66.2 156.6 858.
rms 6.7 16.9 0 13.52 19.4 30.1 63.
Maximum 100 400 7.6 100 100 200 1000
145M Letter Grade Distribution
Letter Grade Course Totals (1000 max)