Response to: ADC in Matlab simulink:
The first time I did this I misinterpreted the question, posting a sigma-delta example rather than an integrating (slope) ADC. Anyway, here’s a slope ADC starting point:
Here’s a plot of the input (with an offset) and the integration of the input:
Here’s a plot of the control signal (reset signal on the integrator; active low):
From this, the counter logic should be easy: simply run a counter that resets itself with the control signal. You can pretty much use the integrator inside the ADC itself as a template for this.