Download the vi and check out the internals, as they will explain exactly what I'm trying to do.
Briefly, I am writing a deMUX for a signal that has digital components
of 0.25V, 0.5V, 1V, 2V, and 4V. The max signal being 7.75V and the min
being 0V. For example, if the input is 0.25V, the 5 bit digital output
will be 00001; if the input is 0.50V, the digital output will be 00010;
if the input is 0.75, then the digital output will be 00011; ... and if
the input is 7.75, then the digital output will be 11111.
In order to make the system realistic I have added tolerances to the
search. So, the tolerance I picked is 0.1V (which is well less than the
required 1/2 of the smallest voltage increment of 0.25V, which is
0.125V). Thus, any of the 32 possible voltages +/- 0.1V should decode
correctly according to the <= circuit I have set up toward the
bottom of my while loop in the attached vi. It does work for most, but
it does not work for 1.1V, 2.1V, and 3.1V... and possibly some others.
For these listed numbers, the comparison acts as a less than, rather
than a less than or equal to.
Let me know if you need more information.
Cheers,
Joe