Scooby Posted December 1, 2016 Share Posted December 1, 2016 (edited) I wrote an Avionics exam today and one question stumped me. It should have been very easy. After doing this for 25 plus years you'd think I knew this! I was given an A/D converter output of 0000 (Hex) for 0 volts. 10 volts was 7777 (Hex). I was asked what the value would be for 5 volts (in hex). I decided to convert to 7777 Hex to decimal and came up with 20583. I divided by 2 and the result was 15291.5. That is where I was stumped. I was expecting an even number. Although I shouldn't have expected an even number. I chopped off the decimal and converted 15291 to 3BBB Hex. Was I in error? I know this should be easy. I even converted to binary and came up with the same result. Edited December 1, 2016 by Scooby Quote Link to post Share on other sites
Helmsman Posted December 1, 2016 Share Posted December 1, 2016 (edited) There are 30584 distinct values between 0000 and 7777 so you probably should have got 15292 which is 3BBC(hex). Edited December 1, 2016 by Helmsman Quote Link to post Share on other sites
KursadA Posted December 1, 2016 Share Posted December 1, 2016 As ADC outputs almost always use integer math and follow proportionality, your calculation is correct. However, I find it odd that the question does not give you what Vmax is, and what the resolution of the ADC is (a 4-digit hex output likely implies 16 bits but the question should have made it clear). FInding the exact representation of 5V would require knowing the resolution and Vmax. If this question appeared in an engineering test, the entire class would have protested. The fact that they did not bother to specify the details tells me that they only care that you know about hex-to-decimal conversion and proportionality of ADC outputs; so your answer should be correct. Quote Link to post Share on other sites
Scooby Posted December 1, 2016 Author Share Posted December 1, 2016 4 minutes ago, KursadA said: As ADC outputs almost always use integer math and follow proportionality, your calculation is correct. However, I find it odd that the question does not give you what Vmax is, and what the resolution of the ADC is (a 4-digit hex output likely implies 16 bits but the question should have made it clear). FInding the exact representation of 5V would require knowing the resolution and Vmax. If this question appeared in an engineering test, the entire class would have protested. The fact that they did not bother to specify the details tells me that they only care that you know about hex-to-decimal conversion and proportionality of ADC outputs; so your answer should be correct. There were no other details. Thank-you for replies. Quote Link to post Share on other sites
Scooby Posted December 2, 2016 Author Share Posted December 2, 2016 2 hours ago, Helmsman said: There are 30584 distinct values between 0000 and 7777 so you probably should have got 15292 which is 3BBC(hex). Can you explain how there are 30584 distinct values? Thank much! Quote Link to post Share on other sites
KursadA Posted December 2, 2016 Share Posted December 2, 2016 (edited) His reasoning seems to be that there are n+1 distinct points the between 0 and n; endpoints inclusive. However, the mid point is *not* (n+1)/2. Your calculation is the right one; although from an engineer's standpoint what voltage that value precisely describes depends on the ADC characteristics. Edited December 2, 2016 by KursadA Quote Link to post Share on other sites
Helmsman Posted December 2, 2016 Share Posted December 2, 2016 (edited) 3 hours ago, Scooby said: Can you explain how there are 30584 distinct values? Thank much! In decimal, whole numbers only, zero included. Edited December 2, 2016 by Helmsman Quote Link to post Share on other sites
spejic Posted December 2, 2016 Share Posted December 2, 2016 16 minutes ago, Helmsman said: In decimal, whole numbers only, zero included. Yes, but the problem is you computed the 15292nd value which (starting from zero) is 15291, which is &H3BBB. Quote Link to post Share on other sites
Helmsman Posted December 2, 2016 Share Posted December 2, 2016 (edited) Well, perhaps I was wrong :) Anyway, the midpoint here cannot be represented with whole number, at least from math POV. Edited December 2, 2016 by Helmsman Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.