Solutions to 145M Microcomputer Interfacing Lab Final Exam, Exams of Microcomputers

The solutions to the final exam of the 145m microcomputer interfacing lab at the university of california, berkeley. It covers topics such as averages and standard deviations, fourier transforms, sampling, and a/d converters.

Typology: Exams

2012/2013

Uploaded on 03/22/2013

saryu
saryu 🇮🇳

4.3

(4)

42 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
145M Final Exam Solutions page 1 May 22, 1998 S. Derenzo
UNIVERSITY OF CALIFORNIA
College of Engineering
Electrical Engineering and Computer Sciences Department
145M Microcomputer Interfacing Lab
Final Exam Solutions May 22, 1998
1a Given a set of measurements ai, they are first summed and divided by N to get the average,
then the rms deviation from the average is calculated.
a =1
Nai
i=1
N
σa=1
N1
aia
( )
2
i=1
N
The standard deviation of the mean is the rms divided by the square root of N.
σa =
σa
N
[1 point off for not defining
a
]
1b Given two sets of measurements, compute the averages and the standard deviations of their
means. Compute Student’s t, which is the ratio of the difference of the averages divided by the
standard deviation of that difference.
t=
σ=a b
σa
2+σb
2=a b
σa
2/N+σb
2/N
Look up the probability of exceeding |t| from the Student’s t table for that value of t and 2N-2
degrees of freedom.
[6 points off for not computing Student’s t]
[3 points off for not using the Student’s t probability table]
[1 point off for not mentioning the number of degrees of freedom]
2a If an arbitrary waveform is periodic with period P, then the Fourier transform has non zero
values only at integer multiples of the frequency 1/P.
[5 points off if the answer was only “discrete in frequency” since you could say more]
[3 points off if only one frequency f = 1/P was given]
[2 points off if harmonics were mentioned but the spacing f = 1/P was not given]
2b If an arbitrary waveform h(t) is multiplied by a window function w(t), then the Fourier
transform of the result g(t) = h(t) w(t) is the convolution of the Fourier transforms of h(t)
and w(t).
3a Sampling at 1024 Hz for S = 0.5 seconds produces 512 samples. The FFT produces 512
coefficients, and the magnitude Fk of the kth coefficient corresponds to a frequency of k/S =
2k Hz.
pf3
pf4
pf5

Partial preview of the text

Download Solutions to 145M Microcomputer Interfacing Lab Final 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 22, 1998

1a Given a set of measurements ai, they are first summed and divided by N to get the average, then the rms deviation from the average is calculated.

a =

N

ai i = 1

N

∑ σ a =^

N − 1

 ( ai − a )^2

i = 1

N

The standard deviation of the mean is the rms divided by the square root of N.

σ a =

σ a N

[1 point off for not defining a ]

1b Given two sets of measurements, compute the averages and the standard deviations of their means. Compute Student’s t, which is the ratio of the difference of the averages divided by the standard deviation of that difference.

t =

σ∆

ab

σ^2 a^ + σ^2 b^

ab

σ a^2 / N (^) + σ b^2 / N

Look up the probability of exceeding |t| from the Student’s t table for that value of t and 2N- degrees of freedom. [6 points off for not computing Student’s t] [3 points off for not using the Student’s t probability table] [1 point off for not mentioning the number of degrees of freedom]

2a If an arbitrary waveform is periodic with period P, then the Fourier transform has non zero values only at integer multiples of the frequency 1/P. [5 points off if the answer was only “discrete in frequency” since you could say more] [3 points off if only one frequency f = 1/P was given] [2 points off if harmonics were mentioned but the spacing ∆f = 1/P was not given]

2b If an arbitrary waveform h(t) is multiplied by a window function w(t), then the Fourier transform of the result g(t) = h(t) w(t) is the convolution of the Fourier transforms of h(t) and w(t).

3a Sampling at 1024 Hz for S = 0.5 seconds produces 512 samples. The FFT produces 512 coefficients, and the magnitude Fk of the k th coefficient corresponds to a frequency of k / S = 2 k Hz.

(^0 )

0 Hz

255 511 Hz

k

f

F k

F 5 at 10 Hz F^507 at 10 Hz

F 0 = 0

F 5 and F512-5 are the only non-zero Fourier coefficient No aliasing, since 10 Hz < Fs/2 = 512 Hz No spectral leakage, since exactly 5 cycles are sampled in 0.5 sec [2 points off if harmonics of 10 Hz are shown] [2 points off if frequency scale in Hz not shown in at least one of 3a, 3b, 3c, or 3d]

3b

(^0 )

0 Hz

255 511 Hz

k

f

F k

F 5 and F at 10 and 12 Hz F and F 506

Spectral leakage

(^6 )

F 5 , F 6 , F 512-6, and F 512-5 are non-zero Spectral leakage, because 5.5 cycles are sampled in 0.5 sec Values around these have spectral leakage, falling off as 1/ f No aliasing, since 11 Hz < Fs /2 = 512 Hz To fix spectral leakage, multiply the time samples by a Hanning window and/or increase the sampling window S.

3c

  • Provide input for 8 separate input port lines to indicate when individual A/Ds have completed conversion (OK to connect the start conversion and output enable signals for each A/D signal path, provided the signal timing was properly designed)

Parallel Output Port 1

Parallel Input Port

D/A

Converter

A/D 1

Micro- Computer

Analog Parallel Output Port 2

A/D 8

SC 1

SC 8

tri-state 1

tri-state 8

OE 1

OE 8

Parallel Input Port

OA 8

OA 1

SC = Start Conversion DA=Data Available OE=Output Enable

4b The steps needed to measure the first transition voltage V(0,1) for the first A/D converter. 1 Set N= 2 Put N on D/A 3 wait 10μs until D/A has settled [using wait(10)] 4 Put low-high edge on 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 output port to end conversion cycle 8 if M=0, increase N by one and loop back to step 2 9 If M=1, save (D/A voltage step)(N-1/2) as the transition voltage

4c Send successive 16-bit numbers 0 to 216–1 to the D/A converter and convert the analog output with the A/D. Whenever the A/D output value changes, store the corresponding D/A value in a transition voltage table To determine absolute accuracy , compare the D/A values for each A/D output transition with the ideal transition values. Since the step size of the D/A is 16 times finer than the average step size of the A/D, this design can measure the A/D transition voltages to an accuracy of 1/16 LSB. [3 points off if only 12 D/A bits are varied. The transition voltages (or the center of the steps) cannot be determined accurately unless more than 12 bits of the accuracy of the 16-bit D/A is used.] 4d Determine the D/A values corresponding to first and last A/D transition voltages, and the equa- tion of the line that passes through them. Linearity is a measure of how closely the other measured transition values pass through the line. 4e Determine the difference in D/A values between each A/D transition voltage. The differential linearity is a measure of the equality of those differences. Alternatively, the A/D step sizes could be determined as the number of successive D/A inputs that produce the same A/D output.

4f The method can determine the A/D accuracies to 1/16 LSB (±1/32 LSB was OK). Note that 1 A/D LSB = 16 D/A LSBs. [5 points off for an answer of 1/2 LSB]

5a A/D converter circuit

R /

R

R

Address Encoder Logic

Digital Output (N bits)

R /

1

2

2 N

2 N – 2

Exclusive OR

V 1

V ref

V (^) ref

[?? points off for not providing a circuit that converts 2 N^ comparator output to an N -bit address]

5b With an input of 1.27 volts, the lower 127 comparators have an output of one and the upper comparators have an output of zero. This pattern of ones and zeros is converted into the number 127, which is a digital representation of the voltage. When the input voltage is increased to 1.28 volts, the lowest comparator that previously had an output of zero now has an output of one, and this pattern is converted into the number 128.