Hello Torsten, I followed the suggestions of your post, the code attached are the changes I made to the draft code, in which I put the testbench.
Note that I miss to implement the encoder module as TDF, but otherwise things seem to work.
One thing that I would like to ask is what do you advise me to assign values to the elements r1, r2, r3, r4 and give value to the reference voltage vdd, because according to their choice depends on the goodness of the conversion. (even if I was forced to use 2bit output)
Assuming a full scale of 10 volts, 0 to 10V input voltage always positive and I do th