Comparator Circuit - Introductory Microcomputer Interfacing Laboratory - Solved Exam, Exams of Microcomputers

Main points of this past exam are: Comparator Circuit, Harmonic, Periodic Signal, Data Bus, Parallel Outputs, Connecting, Differential Linearity Error

Typology: Exams

2012/2013

Uploaded on 03/22/2013

saryu
saryu 🇮🇳

4.3

(4)

42 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
UNIVERSITY OF CALIFORNIA
College of Engineering
Electrical Engineering and Computer Sciences Department
145M Microcomputer Interfacing Lab
Final Exam Solutions May 20, 1994
1a Comparator circuit: Circuit with two analog inputs and one digital input. The output state is
determined from the relative value of the two inputs. Usually consists of a differential amplifier
with very high gain and voltage limited outputs.
1b Harmonic (of a periodic signal): Component of the signal that has an exact whole number
multiple of the fundamental frequency of the signal itself. The complex amplitudes of the
harmonic components can be determined from the Fourier transform of the signal.
1c Data bus (for connecting 2 or more parallel outputs): Hardware circuit where a number of
parallel outputs can be selectively connected to a common set of parallel signal lines called a
bus. Only one parallel output can be asserted on the bus at any one time.
1d Differential Linearity Error (of an A/D converter): The difference between the step sizes and
the average step size. Each step is the difference between neighboring transition voltages.
1e Fourier Convolution Theorem: The Fouler transform of the convolution of two functions is
the simple product of the Fourier transforms of the two functions.
1f Spectral Leakage (as seen in the FFT of a periodic signal): When a frequency component of a
signal does not have a whole number of cycles in the sampling window, the discontinuity at the
edges of the window generates frequency components not present in the original signal. This
appears as leakage into the adjoining Fourier coefficients and can be described by convolving
the true Fourier transform with the Fourier transform of a the rectangular sampling window.
2a 1Set i1 =0.
2Output the number i1 on the parallel output port
3The D/A produces an analog voltage that appears on all 8 A/D inputs
4Using parallel output port #1, output a start pulse
5All eight A/D converters convert the D/A output
6When each A/D finishes, its “done” pulse latches the 12 bits of data onto its 12-bit register
7The program waits a bit more than 11 µs for all A/Ds to finish converting
8Set i2 = 1
9The program selects tri-state buffer #i2 and de-selects the other 7 tri-state buffers by
outputting a number on parallel output port #2 which has a 1 in bit position #i2 and a 0 in
the other 7 positions.
10 The program reads the input port to obtain the output of A/D #i2 and saves it in a
temporary memory location
11 If the result of step 10 has changed from the last value of the D/A input i1, save the D/A
voltage value that corresponds to i1 as a transition voltage for A/D #i2.
12 Set i2 = i2 +1 and loop back to step 9 until i2 = 8
13 Set i1 = i1 + 1 and loop back to step 2 until i1 = 65,535 (i.e. 216 – 1)
14 Set i2 = 1
15 For A/D converter #i2, compute the difference between each transition voltage and its ideal
value (the absolute error). Determine the maximum value (the maximum absolute error).
16 Subtract neighboring transition voltages to produce a table of step sizes and determine
minimum and maximum values of step sizes for A/D converter #i2
17 Set i2 = i2 + 1 and loop back to step 15 until i2 = 8
(another way to find step sizes is to count the number of D/A inputs that produce the same A/D
output.)
[10 points off if only 12 D/A bits are used, since this approach cannot accurately measure
transition voltages]
145M Final Exam Solutions page 1 May 20, 1994 S. Derenzo/T. Tokuyasu
pf3

Partial preview of the text

Download Comparator Circuit - 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 20, 1994

1a Comparator circuit :^ Circuit with two analog inputs and one digital input. The output state is

determined from the relative value of the two inputs. Usually consists of a differential amplifier with very high gain and voltage limited outputs.

1b Harmonic^ (of a periodic signal):^ Component^ of the signal that has an exact whole number

multiple of the fundamental frequency of the signal itself. The complex amplitudes of the harmonic components can be determined from the Fourier transform of the signal.

1c Data^ bus^ (for connecting 2 or more parallel outputs):^ Hardware circuit where a number of

parallel outputs can be selectively connected to a common set of parallel signal lines called a bus. Only one parallel output can be asserted on the bus at any one time.

1d Differential Linearity Error^ (of an A/D converter): The difference between the step sizes and

the average step size. Each step is the difference between neighboring transition voltages.

1e Fourier Convolution Theorem:^ The Fouler transform of the convolution of two functions is

the simple product of the Fourier transforms of the two functions.

1f Spectral Leakage^ (as seen in the FFT of a periodic signal): When a frequency component of a

signal does not have a whole number of cycles in the sampling window, the discontinuity at the edges of the window generates frequency components not present in the original signal. This appears as leakage into the adjoining Fourier coefficients and can be described by convolving the true Fourier transform with the Fourier transform of a the rectangular sampling window.

2a^1 Set i1 =0.

2 Output the number i1 on the parallel output port 3 The D/A produces an analog voltage that appears on all 8 A/D inputs 4 Using parallel output port #1, output a start pulse 5 All eight A/D converters convert the D/A output 6 When each A/D finishes, its “done” pulse latches the 12 bits of data onto its 12-bit register 7 The program waits a bit more than 11 μs for all A/Ds to finish converting 8 Set i2 = 1 9 The program selects tri-state buffer #i2 and de-selects the other 7 tri-state buffers by outputting a number on parallel output port #2 which has a 1 in bit position #i2 and a 0 in the other 7 positions. 10 The program reads the input port to obtain the output of A/D #i2 and saves it in a temporary memory location 11 If the result of step 10 has changed from the last value of the D/A input i1, save the D/A voltage value that corresponds to i1 as a transition voltage for A/D #i2. 12 Set i2 = i2 +1 and loop back to step 9 until i2 = 8 13 Set i1 = i1 + 1 and loop back to step 2 until i1 = 65,535 (i.e. 2^16 – 1) 14 Set i2 = 1 15 For A/D converter #i2, compute the difference between each transition voltage and its ideal value (the absolute error). Determine the maximum value (the maximum absolute error). 16 Subtract neighboring transition voltages to produce a table of step sizes and determine minimum and maximum values of step sizes for A/D converter #i 17 Set i2 = i2 + 1 and loop back to step 15 until i2 = 8 (another way to find step sizes is to count the number of D/A inputs that produce the same A/D output.) [10 points off if only 12 D/A bits are used, since this approach cannot accurately measure transition voltages]

2b The outer i1 loop is executed 65k times. The inner^ loop^ involves^ writing^ to^ the^ D/A^ and

producing a A/D start signal (10 μs), waiting for the A/Ds to convert (11 μs), and selecting and reading all eight tri-state buffers 8 x (10 μs + 10 μs) for a total of 181 μs. The total procedure takes 65k x 181 μs = 12 s. [any answer between 10 and 20 sec got full credit]

3a The frequency index extends from n = 0 to n = 2

(^20) = 1049k. The highest frequency has index 524k and corresponds to the Nyquist limit of 5 kHz. The amplitude spectrum (Figure 1) has three major components (1) The harmonics of the data signal, which appear at n = k 100 (where k is the harmonic number), because the fundamental has 100 cycles in the 100 s sampling window. [7 points off if omitted] (2) A white noise background that adds equally into all Fourier amplitudes. (Actually, the FFT of white noise is itself noisy, but we ignore that complication.) [4 points off if omitted] (3) The effect of the low pass filter, which decreases all Fourier amplitudes sharply from 2, Hz (the maximum frequency of interest) to 5 kHz (the Nyquist limit). [4 points off if omitted]

Fourier frequency index n

Frequency fn

Background noise

(^0) 524k (^) 1049k

0 Hz 5.24 kHz

Data signal harmonics every 1 Hz (∆n = 100) (exact amplitudes depend on signal)

Effect of low-pass filter

2 kHz

Figure 1. FFT of filtered (data signal plus random background)

3b The first Fourier magnitude M^1 corresponds to f^1 = 1/100 s = 0.01 Hz.

3c The low pass filter must have a gain near unity for f < 2 kHz and a very low gain for f > 5 kHz to

reduce background noise and to prevent aliasing at the sampling frequency of 10 kHz.

3d There is no spectral leakage for the data signal, since exactly 100 periods are present. Spectral

leakage does not affect the random background noise. Therefore a Hanning window would not help.

3e^1 Set data acquisition module for 100 s of sampling at 10,486 Hz.

2 Sample 1,048,486 values 3 take the FFT 4 compute the Fourier magnitudes Mn , n = 0 to 524k 5 compute A as the average of all Mn values, where n is not an integer multiple of 100 6 compute 10,490 new Fourier magnitudes Pk = M100k – A 7 take the inverse FFT of Pk to recover one cycle of the data signal [2 points off if a single cycle data signal is not generated as the answer]

4^1 Successive approximation^ b^ d^ g^ h

2 Tracking a g h i 3 Dual slope (or integrating) a f h i 4 Flash c e h (an answer of ‘c’ was allowed in line 2 because the item was unclear) [one point off for each correct letter missing] [one point off for each incorrect letter present]