N-bit ADC vams model

1. N bit Adc vams model

I am modelling a 12 bit ADC in vams.
The input range is 0.3 to 1.5V. i.e 0.3 = 000'H and 1.2V = FFF'H.

Need your help in selecting midpoint values
max= 1.5;
min=0.3
fullscale = max-min;
midpoint = fullscale/2.0;

This logic doesnt work. •

2. Re: N bit Adc vams model

In case "midpoint" refers to the voltage level between min and max, I suggest

midpoint = (min + max)/2.0, or 0.9 V •

3. Re: N bit Adc vams model

Code:
analog
begin
V(VREF)<+ 0.7 + (TRIM * 0.0266667);
max_1=V(VREF) + 0.6;
min_1=V(VREF) - 0.6;

//	min_1=0;
fullscale_1=max_1+min_1;
midpoint1=fullscale_1/2.0;
end

always@( posedge (CLK_IN) or !(fault_avdd) )
begin

//if (!(fault_avdd))
//	begin
sample1=V(VIN);
//sample1=sample1-dummy;
\$display("INSIDE LOOP");
for (i=0;i<`BITS;i=i+1)
begin
if(sample1 >= midpoint1)
begin
V_DOUT[`BITS-1-i]=1;
sample1=sample1-midpoint1;
\$display("VALUE OF Sample inside if %f",sample1);
\$display("VALUE OF MIDPOINT inside if %f",midpoint1);
\$display("VALUE OF DUMMY %f", dummy);
\$display("VALUE OF MAX %f", max_1);

end

else
begin
V_DOUT[i]=0;
\$display("VALUE OF Sample inside else %f",sample1);
\$display("VALUE OF MIDPOINT inside else %f",midpoint1);
\$display("VALUE OF DUMMY %f", dummy);
\$display("VALUE OF MAX %f", max_1);
end
sample1 = 2.0*sample1;
end
//	end

if (fault_avdd)
begin
for (i=0;i<`BITS;i=i+1)
begin
V_DOUT[i]=0;
end
end

end

VREF keeps on changing based on TRIM bits •

4. Re: N bit Adc vams model

Hi,

fullscale_1=max_1+min_1;
midpoint1=fullscale_1/2.0;
fullscale should be "max - min", but as long as you don´t use the value for other calculation it is OK.
The midpoint calculation is correct.

Klaus 5. Re: N bit Adc vams model

The calculation seems to mix absolute and relative voltage levels, which might cause confusion and unexpected results.

It's difficult to guess the meaning of the code without knowing the related hardware. --[[ ]]--