




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The solutions to the final exam of the microcomputer interfacing lab held at the university of california, berkeley, electrical engineering and computer sciences department in may 1995. The exam covers topics such as tri-state buses, data handshaking, d/a conversion, and fourier transforms.
Typology: Exams
1 / 8
This page cannot be seen from the preview
Don't miss anything!





College of Engineering Electrical Engineering and Computer Sciences Department
Problem 1a
Device 1
Device 8
Input port
"ready for data" (1-8)
Output port
tri-state 1
tri-state 8
select 1^8
select 8
"data available 1" • • •
"data available 8"
Micro- computer
[3 points off if no tri-state between output bus and each device or no select line to each device] [2 points off for each if “data available” or “data taken” lines missing]
Problem 1b Use 8 input lines for “ready for data” from each device. Use 8 output lines for “data available” to each device and to select the corresponding the octal tri-state. Use 8 output lines for the output data bus
The “full handshaking” steps are:
1 The computer sets all 8 “data available”/select lines FALSE
2 The computer checks that device n (the one we want to write to) has “ready for data” TRUE
3 The computer writes the 8 data bits to the inputs of all octal tri-states
4 The computer asserts “data available”/select output line n TRUE (or the computer asserts “data available” and the device selects an octal tri-state driver.)
5 The device detects “data available” and sets “ready for data” FALSE
6 The device reads the data and sets “ready for data” TRUE
7 The computer detects the “ready for data” FALSE-TRUE edge and sets “data available”/select FALSE
The minimum accepted for full credit:
1 Device n tells computer “ready”
2 Computer selects tri-state n (or device n)
3 Computer asserts data on data bus
4 Computer tells device n “data available”
5 Device n reads data
Problem 2
1 Set all D/A bits to 0
2 Set i = N (the MSB)
3 Set bit i to 1
4 If D/A output > A/D input, set bit i to 0
5 i = i – 1
6 If i > 0, go back to step 3
Problem 3
Problem 4a The idea was to use negative feedback to track a rising pulse on CH. When the pulse reaches its peak and starts dropping, the diode effectively disconnects CH, and the comparator produces an edge that starts the A/D conversion of the peak value held on CH. When conversion is complete, the capacitor is reset.
Input
To analog input port (A/D)
Data available (start A/D conversion)
Comparator in PKD-
Vc
Ready for data (reset) CH
Vin
Vout
[1 point off for not showing resistors] [3 points off for unlabeled lines, extra lines] [4 points off for missing lines]
Problem 4b
1 Pulse arrives
2 CH charges
3 When pulse passes peak value, Vout becomes greater than Vin, triggering the comparator to produce a “data available” pulse.
4 The leading edge of this pulse starts A/D conversion
5 After conversion, computer sends a pulse on the “ready for data” line to the PKD-01 reset, which discharges CH.
[5 points off for using a large threshold voltage and a delay]
Problem 4c PKD-01 settling time 45 μs Comparator trigger time 150 ns Switching time 100 ns
The third transform had M = 64, m = 16. So H 0 = 16 and Hn = 0 for n = 4k. The purpose was to show that for the same M = 64, increasing the rectangle width from 8 to 16 decreased the width of the transform by a factor of 2.
8
⇒
[3 points off for no sinc function]
[3 points off if the second transform did not have more resolution than the first transform]
[3 points off if the third transform did not have narrower lobes than the second transform]
Problem 5b
average (d.c.) is zero, exactly 2 cycles per 128 samples.
1
As above, but average shifted from 0 to 1
2
[2 points off per missing line, 1 point off for location, 1 point off for magnitude]
Problem 5c
Same as second graph above, but with spectral leakage
2
[2 points off if d.c. not consistent with second graph above]
Problem 5d
Since 5 square waves were sampled, we expect non-zero magnitudes at n = 5 and 123 (first harmonic at 15 Hz), n = 15 and 113 and (third harmonic at 45 Hz), n =25 and 103 (fifth harmonic at 75 Hz), etc. The additional non-zero magnitudes at n = 20 and 108 corresponds to a pure 60 Hz harmonic, which must be due to power line interference in the lab. [3 points off if odd harmonics not identified] [4 points off if 60 Hz electromagnetic interference not identified]
Problem 6a
50 kHz oscillator
Sound emitter
Microphone
Amplifier (1 MHz)
Anti- aliasing filter
Analog input port
Micro- computer
[3 points off for using a 2 MHz low pass filter- much higher than needed] [2 points off each for missing microphone or sound emitter]
Problem 7a
−t/ τ
−t/ τ
Problem 7b
f (Hz)
Fourier transform magnitude 0
Problem 7c
145M Final Exam:
Problem 1 2 3 4 5 6 7 Total Average 26.1 12.3 12.1 25.7 21.7 24.7 23.1 145. rms 3.9 3.9 3.3 9.3 9.2 4.6 4.6 32. Maximum 30 15 15 40 40 30 30 200
145M Numerical Grades:
Lab total Lab Partic. Midterm #1 Midterm #2 Final Total Average 458.6 91.5 84.5 86.3 145.7 866. rms 30.9 8.5 7.1 10.6 32.1 102. Maximum 500 100 100 100 200 1000
The average scores of the two lab report graders differed by only 0.03 points. No equity correction was necessary.
145M Letter Grade Distribution (passing students only)
Letter Grade Course Totals (1000 max) A+ 952 A 920, 944, 946, 948.5, 950.5* A– 897.5, 899 B+ 870, 872.5, 873, 877 B 838, 849, 855, 855, 858 B– none C+ 794, 804, 814 C none C– none D+ none D none D– 667