Comparator output

Hello,

I am trying a simple comparative circuit using a Nonlinear dependent source. The library for the component is as follows:

.SUBCKT COMPARATOR 1 2 3 4 5
ECOMP 3 0 TABLE {V(1,2)} = (-1mV 1nV) (1mV, 3.3V)
.ENDS COMPARATOR

I used the example from the documentation 5.2.3. However, I am not sure if I am doing this right.
Please see below. Main question is what happens when the value is between X0 and X2? The Manual dosen’t clearly explain what (X1,Y1) does. According to my results, when I set the input between the ranges, I see half the max limit at the output.

Regards,
Sam

If you run a dc simulation, varying the input voltage V3, using a fine resolution (small step size), you will see what the output is doing.

I assume that the output varies linearily with the input while the input is between -1mV and 1mV.

The sentence “generate y according to value pairs, using linear interpolation” for me means that:
if x is between x0 and x1 then y is taken from the line connecting points x0,y0 and x1, y1. Then for the next pair (x1,x2) the same method is used. Then for nex pair (x2,x3) and for next pair (x3,x4) and so on until the last pair (x(n-1),xn). Then for any x>xn y=yn.