Here's a quantizer in LT Spice:
ftp://jjlarkin.lmi.net/Quantizer.jpg
It wasn't hard, but the HELP is really obscure about syntax, and there is no example of a schematic with a b-source that I could find.
There is a sample-and-hold schematic symbol, so one can simulate the effects of a clocked ADC or a DAC on a control loop.
John
Version 4 SHEET 1 880 680 WIRE 48 48 0 48 WIRE 112 48 48 48 WIRE 384 48 320 48 WIRE 432 48 384 48 WIRE 0 96 0 48 WIRE 112 112 112 48 WIRE 320 112 320 48 WIRE 432 128 432 48 WIRE 0 224 0 176 WIRE 112 224 112 192 WIRE 320 240 320 192 WIRE 432 240 432 208 FLAG 0 224 0 FLAG 320 240 0 FLAG 112 224 0 FLAG 432 240 0 FLAG 48 48 X FLAG 384 48 OUT SYMBOL bv 320 96 R0 WINDOW 3 36 198 Left 0 SYMATTR InstName B1 SYMATTR Value V=int(5.1*V(X))*0.2 SYMBOL voltage 0 80 R0 WINDOW 3 16 199 Left 0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V1 SYMATTR Value SINE(0 1 1k 0 0 0 3) SYMBOL res 96 96 R0 SYMATTR InstName R1 SYMATTR Value 1k SYMBOL res 416 112 R0 SYMATTR InstName R2 SYMATTR Value 1k TEXT 144 40 Left 0 !.tran 0 .005 0 1u