(a) A C program reads from an ADC to measure the voltage across a capacitor. The
ID: 2085202 • Letter: #
Question
(a) A C program reads from an ADC to measure the voltage across a capacitor. The voltage is first measured just before a switch is closed to allow the capacitor to discharge and thereafter the measurement is repeated at 1ms intervals with the results being stored in an array of 16-bit integers A dump of the locations in memory where this array has been stored is shown below in Figure Q2A Determine the number of bits of the ADC and the time constant of the capacitor discharge. 1000 FF 0F 18 0D B8 0A C7 08 1008 30 07 E2 05 D1 04 F1 03 1010 3A 03 A4 02 2A 02 C5 01 1018 73 01 30 01 F9 00 CB 00 (b) A C program contains 3 variables x, y and z, which are all floating point numbers stored in the standard IEEE format. The variable x=13.0 and y=19.0 Figure Q2B is a memory dump of the area used to store these variables. Verify that the variables x and y are correctly stored in memory. What are their addresses? Hence find where z is stored and determine the value of z. 1000 03 FF C0 04 C0 04 DE 5B 1008 E3 01 D1 1E 00 FF 34 00 1010 7B 5B 12 32 00 00 C0 C0 1018 00 00 98 41 00 00 50 41 1020 00 00 4E 01 6C 59 00 00 (a) By considering a 4-bt number P = P_3 times 2^3 + P_2 times 2^2 + P_1 times 2^3 + P_0 times 2^0 prove that the process of taking the 2's complement of a number gives us a number which represents the negative of the original number, provided thatExplanation / Answer
(a)
Let first extract the ADC reading from Memory...
1st Reading : 0x0FFF : 4095 (Max / Full Charged)
2ed Reading : 0x0D18 : 3352
3rd Reading : 0x0AB8 : 2744
4th Reading : 0x08C7 : 2247
5th Reading : 0x0730 : 1840
6th Reading : 0x05E2 : 1506
7th Reading : 0x04D1 : 1233
8th Reading : 0x03F1 : 1009
9th Reading : 0x033A : 826
10th Reading : 0x02A4 : 676
11th Reading : 0x022A : 554
12th Reading : 0x01C5 : 453
13th Reading : 0x0173 : 371
14th Reading : 0x0130 : 304
15th Reading : 0x00F9 : 249
16th Reading : 0x00CB : 203
For above table it's easy to understand that the ADC is 12 bit.
Now, For Time constant, the voltage equation
Current Voltage = Max Voltage * exp(-t/T)
Here,
T = Time Constant
Current Voltage = Capacitor Voltage at t time.
Let's find Time constant from above equation,
8th Reading, Time t = 7 ms.
Current Voltage / Max Voaltage = exp (-(7 ms)/T)
T = 7ms * ln (Max Voltage / Current Voltage)
T = 7ms * ln (4095 / 1009)
T = 7ms * ln (4.0584737363726461843409316154609)
T = 7ms * 1.4008069759335608420529691666993
T = 28.409316154608523290386521308226 ms.
The Final answers are 12 bit ADC and Time Period is 28.409316154608523290386521308226 ms
(b)
x = 13.0 (0x41500000) at location 1018
y = 19.0 (0x41980000) at
z = x + y = 42.0 (0x42280000)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.