Operation - Introductory Microcomputer Interfacing Laboratory - Solved Exam, Exams of Microcomputers

Main points of this past exam are: Operation, Converter, Devices, Analog Input Port, Board, Comparator With Hysteresis, Flash

Typology: Exams

2012/2013

Uploaded on 03/22/2013

sarup
sarup 🇮🇳

30 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
145M Final Exam Solutions page 1 May 23, 2003 S. Derenzo
UNIVERSITY OF CALIFORNIA
College of Engineering
Electrical Engineering and Computer Sciences Department
145M Microcomputer Interfacing Lab
Final Exam Solutions May 23, 2003
1a R-2R D/A converter: Digital input is used to control a set of switches (one for each bit)
that routs current through a network of resistors to a current to voltage amplifier. The resistor
network consists only of resistor values R and 2R.
1b Analog input port: Converts analog input to a digital number that can be stored in
computer memory. Start conversion is initiated by a program command. After conversion, the
port stores the number into the location specified by the program command.
1c Comparator with hysteresis: Has two analog inputs and a digital output. The digital
output is controlled by the difference of the two inputs. Hysteresis is accomplished by
positive feedback of the digital output into one of the analog inputs to stabilize the output state.
Output is high if V1 > VH and low if V1 < VL. Output retains its pervious state when V1 is
between VL and VH.
[2 points off if hysteresis not mentioned]
1d Flash 8-bit A/D converter: The analog input is send to the positive inputs of 255
comparators. A 255-resistor voltage divider provides an evenly spaced series of voltages for
the negative input to the comparators. For a given analog input, the comparator output is one
for all the divider voltages below the input and zero for all the voltages above. A series of
exclusive or circuits identifies the highest comparator with an output of one and an encoder
circuit determines the numerical value.
1e Half-flash A/D converter: Consists of two 8-bit flash converters, a D/A converter, and a
difference amplifier. Conversion is started by using one of the 8-bit flash converters to
determine the 8 mist significant bits. Then those bits are converted into a corresponding
voltage that is subtracted by the difference amplifier. The difference is converted by the
second 8-bit flash converter to determine the 8 least significant bits
1f Anti-aliasing filter: Passes frequencies at and below the highest frequency of interest and
reject frequencies above one-half the sampling frequency.
2Transparent latch 3
Tri-state driver 4
Edge-triggered flip-flop 1
Sample-and-hold amplifier 2
3Error 1: clock input is pulsed in step 2 before input is asserted. Fix by asserting the input
before providing the clock edge
Error 2: the external circuit never resets “input data available” to FALSE so that step 4 is
executed and the program reads the flip-flops in a loop, without regard for when the external
circuit asserts and clocks new data. Fix by adding a step 6 so that the external circuit sets
“input data available” FALSE when it detects “ready for input data” FALSE
[8 points off for messing error 2]
4The score for each section of problem 4 was the number of correct answers minus the number
of incorrect answers (zero if negative). No points were deducted for missing correct answers.
4a TR, FL,
pf3
pf4

Partial preview of the text

Download Operation - Introductory Microcomputer Interfacing Laboratory - Solved Exam and more Exams Microcomputers in PDF only on Docsity!

UNIVERSITY OF CALIFORNIA

College of Engineering Electrical Engineering and Computer Sciences Department 145M Microcomputer Interfacing Lab Final Exam Solutions May 23, 2003

1a R-2R D/A converter: Digital input is used to control a set of switches (one for each bit) that routs current through a network of resistors to a current to voltage amplifier. The resistor network consists only of resistor values R and 2R.

1 b Analog input port : Converts analog input to a digital number that can be stored in computer memory. Start conversion is initiated by a program command. After conversion, the port stores the number into the location specified by the program command.

1 c Comparator with hysteresis: Has two analog inputs and a digital output. The digital output is controlled by the difference of the two inputs. Hysteresis is accomplished by positive feedback of the digital output into one of the analog inputs to stabilize the output state. Output is high if V 1 > VH and low if V 1 < V (^) L. Output retains its pervious state when V 1 is between VL and VH. [2 points off if hysteresis not mentioned]

1 d Flash 8-bit A/D converter: The analog input is send to the positive inputs of 255 comparators. A 255-resistor voltage divider provides an evenly spaced series of voltages for the negative input to the comparators. For a given analog input, the comparator output is one for all the divider voltages below the input and zero for all the voltages above. A series of exclusive or circuits identifies the highest comparator with an output of one and an encoder circuit determines the numerical value.

1 e Half-flash A/D converter: Consists of two 8-bit flash converters, a D/A converter, and a difference amplifier. Conversion is started by using one of the 8-bit flash converters to determine the 8 mist significant bits. Then those bits are converted into a corresponding voltage that is subtracted by the difference amplifier. The difference is converted by the second 8-bit flash converter to determine the 8 least significant bits

1 f Anti-aliasing filter: Passes frequencies at and below the highest frequency of interest and reject frequencies above one-half the sampling frequency.

2 Transparent latch 3

Tri-state driver 4 Edge-triggered flip-flop 1 Sample-and-hold amplifier 2

3 Error 1: clock input is pulsed in step 2 before input is asserted. Fix by asserting the input before providing the clock edge Error 2: the external circuit never resets “input data available” to FALSE so that step 4 is executed and the program reads the flip-flops in a loop, without regard for when the external circuit asserts and clocks new data. Fix by adding a step 6 so that the external circuit sets “input data available” FALSE when it detects “ready for input data” FALSE [8 points off for messing error 2]

4 The score for each section of problem 4 was the number of correct answers minus the number of incorrect answers (zero if negative). No points were deducted for missing correct answers.

4a TR, FL, DÂ

4 b SA, DS, HF

4 c FL

4 d FL, HF [DS was not accepted here because many clock steps are needed to discharge the capacitor]

4 e SA

4 f TR, DS, DÂ

4 g DS, DÂ

4 h SA, HF

5a

Anti-aliasing filter Passes < 1 MHz Blocks > 2 MHz

16-bit analog input port

Microcomputer

memory, display

Input signal

5 b

Each complex Fourier coefficient requires 16 bytes. To use all the memory available, 1024 Mbytes/16 bytes per sample amounts to 64 million samples (actually the nearest power of 2 is 226 = 67.1 million). At 4 million samples per second, the sampling window is 16 seconds, or more accurately 16.8 seconds. There will be 64 million Fourier coefficients and 16 million correspond to the frequency range from 0 to 1 MHz.

Procedure steps:

1 Write a program to take 67.1 million samples in 16.8 seconds. [64 million samples in 16 seconds was accepted] 2 Multiply the samples by a raised cosine window, take the FFT, and use the complex Fourier coefficients Ck to compute the magnitudes Fk 3 Note the harmonics near integer multiples of the index 8. (A period of 2±0.4 seconds has 8±1.6 cycles in 16 seconds). Since it is highly unlikely that a whole number of cycles was sampled, the magnitude of each harmonic will peak in between two Fourier indices, with short-range spectral leakage into neighboring indices. For a message period P and sampling window width S, the mth harmonic occurs at frequencies m/P and at Fourier indices mS/P. Since S/P is approximately 8, the 16 million Fourier coefficients spanning 0 to 1 MHz can describe the harmonics from m = 1 to m = 2 million. 4 Estimate the background noise amplitude B as the average over index values between the harmonic signals 5 Compute 2 million new Fourier amplitudes P (^) m = F (^) m – B, each corresponding to the mth harmonic of the message, where F (^) m is the average of the values centered at m = kS/P. This ignores values that are purely noise. 5 Take the inverse FFT of Pm to recover one cycle of the analog data signal [8 points off for taking FFT only and not recovering a waveform] [5 points off for sampling for only one cycle- this does not allow the harmonic components to appear as separate peaks in the Fourier coefficients]

[3 points off for an accuracy equal to the frequency spacing between Fourier coefficients = 1/S] [3 points off for "very accurately"]

6 After the exact repetition period is known, then the sampling rate can be adjusted so that an integer number of cycles can be sampled in the available power of two memory. A raised cosine window is not needed and each harmonic will appear at a single index and the intermediate coefficients can be ignored by compressing the array. There will be essentially no spectral leakage and the Fourier coefficients are larger. [8 points off for sampling exactly one cycle- only by sampling a large number of cycles can the values between the sharp harmonics be zeroes out]

Note 1: The average of labs 1, 3, 9, 21, and 23 was 1.0 points per lab lower than the average of labs 2, 8, 10, 22, and 24. This was due to the nature of the labs and small differences in grading standards. One bonus point was added to the long lab total for each of labs 1, 3, 9, 21, and 23 (omitting the lowest long lab grade). Eight students received 4 bonus points, one student received 2 bonus points and one student received one bonus point. As it happens, in no case did bonus points change the letter grade.

Note 2: Changing all the lab participation grades to 100 would not change any letter grades.

145M Final Exam Grades:

Problem 1 2 3 4 5 6 Total Average 44.5 24.0 17.0 12.1 58.8 16.9 173. rms 3.9 0.0 3.9 3.4 7.0 5.4 17. Maximum 48 24 20 17 71 20 200

145M Numerical Grades:

Short labs

Long labs

Lab Partic. Midterm #1 Midterm #2 Final Total

Average 89.4 372.9 99.2 89.6 84.9 173.4 9 0 9. 3 rms 6.5 16.2 1.2 10.0 12.1 17.7 4 7. 1 Maximum 100 400 100 100 100 200 1 0 0 0

145M Letter Grade Distribution

Letter Grade Course Totals (1000 max) A+ 982 A 981, 967 A– 944, 938, 937 B+ 927, 925, 920 B 900, 886, 877 B- 870, 868.5, 861.5, 856 C+ C 818 C– D+ D