# What is the formula to convert the result of an 8-bit ADC to voltage?

I'm just struggling with one of the questions in my Computer Hardware assignment.

An 8-bit A-D conversion chip is configured to sense a voltage in the range 0 to 6V. Given an analog input voltage of 2.5V, determine, showing full working, what the 8-bit digital output should be.

So, using formula given by professor solution is:

2^8 = 256 so (2.5/6)/255 ≈ 0.002V

But, when I did some extra research, I found a different formula:

(2.5/6) * 255 = 106.25

So, which formula is correct and why?

• The generic form is $\frac {V_{in}} {V_{span}} * 2^n-1$ where n is the number of bits in the converter. Mar 4 '20 at 15:30
• (2.5/6)/255 = 0.002V ? I can't figure out what your professor is trying to say. Is this relation correct dimensionally? Mar 4 '20 at 15:33
• It's more likely you mixed up two formulae. "Which one is right"? Seems obvious on the face of it--how would an answer of 0.002V make sense when asking for an 8-bit digital output be?! Mar 5 '20 at 13:35

(2.5/6)*255=106.25 is the correct formula.

You can check with:

• sensed 0 => code 0
• sensed 6V => code 255

and 2.5V is just above 1/3rd of the way, so code 100 of 255 looks correct (255/3 = 85)

6/255 = 0.0235 also has a meaning, it's the V/code value, to get back the sensed value from the code (106*0.0235 = 2,491V)

The answer given by your professor looks incorrect to me. 2.5V/6V is a unitless quantity. Dividing it by constant should give you a dimensionless result. So, its a incorrect formula.

Second formula is correct because:

6V gives 255 ==> 1V gives 255/6 ==> 2.5V gives (255/6)*2.5. Unitary method holds!!

I like to do the dimensional analysis, I think it helps understand the answer: 8 bit -> 2^8 combinations(bits ADC-Counts) = 256