In your previous post, you wrote:
> I bounded the delay and it works!
but just now you wrote:
> I added a fixed delay of 500ps to DELAY, then it works.
Which is it?
For the first, I'd expect something like
if (DELAY < 0) DELAY = 0;
else if (DELAY > MAXDELAY) DELAY = MAXDELAY;
whereas the second would be just
DELAY = DELAY + 500p;
In either case, what was the original value of DELAY computed from your formula?
Code:DELAY = (V(DIN[10])*1024+V(DIN[9])*512+V(DIN[8])*256+V(DIN[7])*128+
V(DIN[6])*64+V(DIN[5])*32+V(DIN[4])*16+V(DIN[3])*8+V(DIN[2])*4+
V(DIN[1])*2+V(DIN[0])*1)*tres;
If V(DIN[i]) is between 0 and 1, then wouldn't DELAY be between 0 and 2047*tres? It doesn't seem like you'd need bounding -- unless V(DIN[i]) isn't between 0 and 1.