Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The formula for the output of an adc seems to be incorrect #7

Open
FedorSmirnov89 opened this issue Jan 17, 2025 · 0 comments
Open
Labels
documentation Improvements or additions to documentation

Comments

@FedorSmirnov89
Copy link

Error Location
Chapter 6 - "Programming ADCs"; Section - "Conversion Formulas". The formula in question is equation 6.2.

Describe the error
The formula to calculate the output of an adc devides the input voltage V_in by the delta between the max and min reference Voltage, to then multiply it by 2^n. This only works out for the case where the min reference voltage is 0. For all other cases, we would need to first subtract the min reference voltage from the input voltage before dividing it by the delta. Also, the largest number that can be represented with n bits is 2^n -1, so we should probably be multiplying by 2^n -1 instead of by 2^n.

Concrete example:

We have:

  • V_ref_+ = 100
  • V_ref_- = 50
  • V_in = 50

Since V_in is the minimal voltage we can work with, the result should be smallest number the adc can output. However, with the given formula, we would get the highest number. Subtracting V_ref_- from the input before dividing by the delta would fix that.

@FedorSmirnov89 FedorSmirnov89 added the documentation Improvements or additions to documentation label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant