The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> 1-bit A2D having flexible thresholds for the analog signal
https://designers-guide.org/forum/YaBB.pl?num=1472826894

Message started by Zorro on Sep 2nd, 2016, 7:34am

Title: 1-bit A2D having flexible thresholds for the analog signal
Post by Zorro on Sep 2nd, 2016, 7:34am

Hi All,

I have a question regarding "Digital Sensitivity to Analog Events".

I am using following code to convert the electrical signal V(in, vss) to digital and it is working fine.

     always @(above(V(in, vss)-thr_high)) begin
           in_dig = 1;
     end

     always @(above(thr_low-V(in, vss))) begin
           in_dig = 0;
     end      
     
This works fine when the thresholds thr_high and thr_low are well known and fixed. Let's say for example if the input signal "in" goes from 0V to 3V I can define thr_high=2V, thr_low=1V and everything is fine.

The problem is: how to discretize the analog signal "in" if the signal values for the threshols are flexible???


Example
Imagine that the input signal looks like in the attached picture.
The input signal "in" is allowed to be between 2V and 3V, and the peak-to-peak variation can be 100mV to 200mV.


Region 1
should be discretized because "in" is between the allowed limits 2V and 3V and the peak-to-peak is between 100mV and 200mV.

Region 2
should be discretized because "in" is between the allowed limits 2V and 3V and the peak-to-peak is between 100mV and 200mV.

Region 3
should be discretized because "in" is between the allowed limits 2V and 3V and the peak-to-peak is between 100mV and 200mV.

Region 4
should not be discretized because "in" is above the allowed limits 2V and 3V .

Region 5
should not be discretized because "in" is below the allowed limits 2V and 3V .

Region 6
should not be discretized;  "in" is between the allowed limits 2V and 3V but the peak-to-peak is larger than 200mV.

Region 7
should be discretized because "in" is between the allowed limits 2V and 3V and the peak-to-peak is between 100mV and 200mV.

So my problem in general is how to detect a variable transition of the input signal as long as it is inside the valid limits?

Thank you!
Zorro

Title: Re: 1-bit A2D having flexible thresholds for the analog signal
Post by Ken Kundert on Sep 3rd, 2016, 12:55am

I have no idea what you are asking.

What does "The input signal "in" is allowed to be between 2V and 3V" mean?

What does "should be discretized" mean?

-Ken

Title: Re: 1-bit A2D having flexible thresholds for the analog signal
Post by Zorro on Sep 3rd, 2016, 1:15am

Hello Ken,

sorry the question was not asked correctly.

The conversion from analog to digital applies only if the analog signal "in" is between 2V and 3V. If "in" is above 3V or below 2V then the digital signal "in_dig" should remain low.

Thank you!
Zorro.

Title: Re: 1-bit A2D having flexible thresholds for the analog signal
Post by Zorro on Sep 3rd, 2016, 1:22am

The tricky part is that the maximum peak-to-peak voltage of the input signal is 200mV.
This means an input signal "in" could have pulses from 1.0V to 1.2V. (a)
Then the input signal "in" could have pulses from 1.4V to 1.6V. (b)
Then the input signal "in" could have pulses from 1.8V to 2.0V. (c)
In other words, we don't have the same threshold crossings all the time.

1. if we define a fixed threshold of let's say 1.1V then only (a) would be converted to digital but not (b) and (c).
2. if we define a fixed threshold of let's say 1.5V then only (b) would be converted to digital but not (a) and (c).

Thank you!
Zorro.


Title: Re: 1-bit A2D having flexible thresholds for the analog signal
Post by Geoffrey_Coram on Sep 6th, 2016, 6:02am


Zorro wrote on Sep 3rd, 2016, 1:15am:
If "in" is above 3V or below 2V then the digital signal "in_dig" should remain low.


Is this what you meant, or should the output be high when "in" is above 3V? It looks to me that your original post indicated the latter:


Code:
    always @(above(V(in, vss)-thr_high)) begin
          in_dig = 1;
    end


I don't understand what "in_dig" is supposed to be; you call it a digital signal and show values of 0 or 1, but then you talk about an analog to digital conversion, as though maybe it's not just a single bit.

I'm not sure you need the @above event; why not just have

Code:
 if (V(in,vss) > thr_high) begin
   in_dig = 1;
 end else if (V(in,vss) < thr_low) begin
   in_dig = 0;
 end else begin
   // not sure if this is what you meant by "discretized" or "converted"
   in_dig = (V(in,vss) - thr_low)/(thr_high-thr_low);
 end


The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.