Pulse Code Modulation
Uses a Flash ADC to convert an analogue signal input to a parallel binary value from 0-5. This then gets sampled and held by the counter at the top for 3ms. Then the output transistors are activated in succession producing a Pulse Code Modulated output.
The red waveform shows when the conversion begins.
Blue=1
Green=2
Orange=4
You may have to stop and restart the simulation upon changing values.