Since you know vPlusRef
, vMinusRef
and nExp
, you can always calculate q
(which is 1.25
in this case).
Then, to convert from digital to analog simply multiply the digital value with q
. For example the 3-bit value 011
, which is 3
in decimal, will be converted to 3.75
which is the lower bound of the required range 3.75
to 5.00
.
Finally, to convert from analog to digital do:
int digitalValue = (int) Math.floor(analogValue / q);
For example an analog value of 8.19
would return 6
, which is the 3-bit value 110
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.