Docsity

EECS 145M Microcomputer Interfacing Lab Final Exam Solutions Spring 2002 - Prof. S. E. Der, Exams of Electrical and Electronics Engineering

Toggle sidebar
bg1
Spring 2002 EECS 145M Final Exam page 1 S. Derenzo
NAME (please print)
STUDENT (SID) NUMBER
UNIVERSITY OF CALIFORNIA
College of Engineering
Electrical Engineering and Computer Sciences
Berkeley
EECS 145M: Microcomputer Interfacing Lab
LAB REPORTS:
1 _________________ 2 __________________ 3 ___________________
8 _________________ 9 __________________ 10 ___________________
21 _________________ 22 __________________ 23 ___________________
24 _________________ 26 _________________
Total of top 4 Lab Grades
Total of top 4 Question Sections
Lab Participation
Mid-Term #1
Mid-Term #2
Final Exam
Total Course Grade
_______________ (400 max)
_______________ (100 max)
_______________ (100 max)
_______________ (100 max)
_______________ (100 max)
_______________ (200 max)
_______________ (1000 max)
COURSE LETTER
GRADE
Spring 2002 FINAL EXAM (May 17)
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. In answering the problems, you are not limited to the particular
equipment you used in the laboratory exercises.
Partial credit can only be given if you show your work.
FINAL EXAM GRADE :
1
__________
(30 max) 2 __________ (25 max) 3 __________ (30 max)
4
__________
(15 max) 5 __________ (40 max) 6 __________ (60 max)
TOTAL __________ (200 max)
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download EECS 145M Microcomputer Interfacing Lab Final Exam Solutions Spring 2002 - Prof. S. E. Der and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

NAME (please print)

STUDENT (SID) NUMBER

UNIVERSITY OF CALIFORNIA

College of Engineering Electrical Engineering and Computer Sciences Berkeley

EECS 145M: Microcomputer Interfacing Lab

LAB REPORTS:

1 _________________ 2 __________________ 3 ___________________

8 _________________ 9 __________________ 10 ___________________

21 _________________ 22 __________________ 23 ___________________

24 _________________ 26 _________________

Total of top 4 Lab Grades

Total of top 4 Question Sections

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)

COURSE LETTER

GRADE

Spring 2002 FINAL EXAM (May 17)

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. In answering the problems, you are not limited to the particular equipment you used in the laboratory exercises.

Partial credit can only be given if you show your work.

FINAL EXAM GRADE :

1 __________ (30 max) 2 __________ (25 max) 3 __________ (30 max)

4 __________ (15 max) 5 __________ (40 max) 6 __________ (60 max)

TOTAL __________ (200 max)

Initials

Problem 1 (total 30 points) Define the following terms (should take 20 words):

1a (5 points) Tri-state buffer

1 b (5 points) Transition voltages of an A/D converter

1 c (5 points) Digital filter

1 d (5 points) Anti-aliasing filter

1 e (5 points) Fourier frequency convolution theorem

1 f (5 points) Nyquist sampling theorem

Initials

Problem 3 (30 points) In this course we studied several types of A/D converters:

TR Tracking

SA Successive Approximation

DS Dual Slope or Integrating

FL Flash

HF Half-flash

1B 1-bit (or delta-sigma)

3a (5 points) Which produce their output in a continuous manner?

3 b (5 points) Which require a "start conversion" command?

3 c (5 points) Which can be used at very high rates (> 100 MHz) at moderate resolution (8 bits)?

3 d (5 points) Which can provide high resolution (16 bits) at intermediate rates (<20 kHz)?

3 e (5 points) Which have an accuracy that does not depend on the accuracy of internal resistors?

3 f (5 points) Which require a sample-and-hold amplifier for full accuracy at their maximum conversion rate?

Initials

Problem 4 (15 points) You sample exactly 5 cycles of a 15 Hz square wave (after anti-alias filtering) and compute the FFT. The magnitudes of your FFT coefficients are plotted in the figure below. Explain the non- zero values at n = 5, 15, 20, 25, 35, 45, 55, 73, 83, 93, 103, 108, 113, and 123. (You do not need to explain the amplitudes, just why they are non-zero.)

Time index

Amplitude

Initials

PROBLEM 6 (total 60 points):

You have been chosen to design a microcomputer system for timing the swimming events in the Summer Olympic Games.

  • There are 12 swimmers and the pool has 12 lanes. Each swimmer starts at the one end of the pool and, at the sound of a gunshot, jumps in and swims to the opposite end of the pool in their own lane
  • When they reach the opposite end of the pool, the swimmers make contact with a switch (called a “touch plate”) mounted on the wall of the pool. When the switch is touched, the contacts stay closed until manually reset.
  • The athletic event is started by the starter’s pistol, which closes an electrical contact when the trigger is pulled
  • Your computer system detects the contact closure and immediately sends a pre-recorded gunshot sound to 12 speakers, each located behind a swimmer. (this gives each swimmer a fair start and also avoids using chemical explosives).
  • There is an external timing circuit mounted near each touch plate. Each has a 24-bit counter that is set to zero by the high-to-low edge of a “Start” input pulse, increases by one every 100 μs, and is stopped by the high-to-low edge of a “stop” input pulse. The start and stop input lines float high when disconnected and can be brought low by connecting to ground.

10 kHz counter

24

Start Stop

  • Your microcomputer has three 16-bit input ports, two 16-bit output ports, and NO analog I/O. The input port lines float high when disconnected and can be brought low by connecting to ground.
  • The gunshot sound is in a digital file and you have a software function that sends the digital data to one of the output ports at the correct speed.
  • You have an external 12-bit D/A converter and a power amplifier, and any digital circuits described in 145L

The requirements for your design are:

  • The system must record the time for every swimmer to an accuracy of 100 μs even if several swimmers touch their plates in the same 100 μs.
  • The lane numbers and time for each swimmer (in units of s) are to be written to the computer display screen and to a file as soon as possible after the swimmer finishes.

Initials

6a (30 points) Sketch your design, showing and labeling all essential components and lines. (You only need to show two touch plate switches, timing circuits and speakers.)

6 b (30 points) Describe the events (hardware and software) that must take place from the start of the race to after the last swimmer finishes.

145M Final Exam Solutions page 2 May 17, 2002 S. Derenzo

Problem 4 Since 5 square waves were sampled, we expect non-zero magnitudes at frequency indexes at odd multiples of 5 and 128 minus odd multiples of 5. These are 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 large magnitudes at n = 20 and 108 corresponds to a pure 60 Hz harmonic, which must be due to power line interference in the lab. If magnitude at n = 20 were due to distortion generating even harmonics, additional magnitudes at n = 10, 30, 40, 50, etc. would also be expected. [3 points off if odd harmonics not identified] [3 points off if magnitudes above index 64 not explained] [4 points off if 60 Hz electromagnetic interference not identified]

5a Multiplying the data with a square window convolves the true frequency spectrum with the Fourier transform of the square wave, which produces long-range spectral leakage that falls off as 1/freqency. [5 points off for not explaining what is happening in the frequency domain] 5 b To recover the original square-wave-windowed time samples, just use the inverse transform. Then multiply the time samples with the raised cosine window and take the fft. [10 points off for convolving the original fft with the fft of the raised cosine and not removing effects of the square window] 5 c Multiplying the data with the raised cosine window convolves the true frequency spectrum with the Fourier transform of the raised cosine window, which produces short-range spectral leakage (nearest-neighbor frequency amplitudes) but very small long-range spectral leakage. [5 points off for not explaining what is happening in the frequency domain]

6a Essential features for the circuit design:

  • Pistol switch starts all timers and notifies computer (via input port) to play gunshot sound
  • Digital output –> 12-bit D/A converter –> power amplifier –> all 12 speakers
  • Each touch plate switch is connected to the corresponding timer stop input and is also connected to a digital input line via a set/reset latch so that the computer can determine when the corresponding swimmer has finished
  • All timer outputs are connected via tri-state drivers to form a data bus that is connected to 24-bits of digital input
  • Each tristate can be individually selected by the computer using an individual digital output line
  • All timers are started by the pistol switch and stopped by the corresponding touch plate switch- this avoids computer delay, which can be unpredictable.

Digital I/O requirements

  • 13 bits digital input for pistol and 12 touch plate switches
  • 24 bits digital input for timer data values
  • 12 bits digital output to D/A for gunshot sound
  • 12 bits digital output to select individual tri-state circuits

145M Final Exam Solutions page 3 May 17, 2002 S. Derenzo

Plate 1

Pistol

Plate 2

Timer 1

Timer 2

Start

Stop

Start

Stop

24

24

Enable 1

Enable 2

Tri-state drivers

Data bus

12 bit D/A converter

12

Power amplifier

To 12 speakers

16 bit digital input

16 bit digital output

32 bit digital input

16 bit digital output

Micro- computer

Set S/R 1

Set S/R 2

Reset

Reset

[3 points off if no pistol switch shown]

6 b Hardware and software events

1 Computer loops to detect pistol switch closure 2 Pistol contact closes 3 All12 timer boxes start, all 12 set/reset latches are reset 4 Computer detects pistol switch closure and sends series of 12-bit words (gunshot sound) to D/A, whose output is amplified and sent to the 12 speakers 5 Computer loops to detect closure of any of the 12 touch plate switches 6 Touch plate n closes and sets S/R latch that is detected by the computer 7 Computer enables tri-state n (all others disabled) 8 Computer reads 24-bit number, multiplies by 10–4, sends to display and disk [2 points off for not converting to seconds] [2 points off for not writing to display] 9 Loop over all swimmers who have not finished and quit when all plates have been touched. [3 points off for using latches rather than tri-state buffers to form the data bus] [10 points off for connecting 12 x 24 = 288 separate digital inputs to the computer] [10 points off for connecting all 12 timer outputs directly together]