An in-range voltage maps to the integer code whose bin contains it. Exact arithmetic here means exact results for the stated model inputs; measured inputs still carry uncertainty and significant-figure limits.
highlighted = computed this step
The input voltage selects the containing bin
Input 5 volts lies in code 5's bin.
5V∈[5,6)V
The selected integer code is five
Because the lower edge is 5 volts and the LSB is 1 volt, the code is 5.