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:

simulinkslopeadc

Here’s a plot of the input (with an offset) and the integration of the input:

Upper plot showing sinusoid with offset; lower plot integrator-with-reset of the upper

Here’s a plot of the control signal (reset signal on the integrator; active low):

Control signal (output of comparator) has a period proportionate with input signal
Control signal (output of comparator) has a period proportionate with input signal

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.