• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. Getting Flat Outputs while implementing a 6 Bit Flash ADC...

Stats

  • Locked Locked
  • Replies 10
  • Subscribers 125
  • Views 14491
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Getting Flat Outputs while implementing a 6 Bit Flash ADC using VerilogA.

Kulmani
Kulmani over 4 years ago

Hi,

I am trying to model a 6 Bit Flash ADC using VerilogA.

Here is the code : 

`include "constants.vams"
`include "disciplines.vams"

module ADC(vout, vclk,vin);
output [5:0] vout;
electrical [5:0] vout;
input vclk;
electrical vclk;
input vin;
electrical vin;
real vdout[0:5];
real trise = 1;
real tfall = 1;
real tdel = 1;


real vth = 0.9;
real samp;
integer i,vd;
real lsb = 0.015;

analog begin
@(cross(V(vclk) - vth,+1)) samp = V(vin);
vd = (samp - 1.8 )/ lsb;
$display ("The value of samp is %g",samp);
$display ("The value of vd is %g",vd);
$display ("The value of time is %g",$abstime);


for (i=0; i < 6 ; i=i+1 ) begin
vdout[i] = vd%2;
vd=vd/2;
$display ("Value of vdout is %g", vdout[i]);
end

V(vout[0]) <+ transition(vdout[0],tdel,trise,tfall );
V(vout[1]) <+ transition(vdout[1],tdel,trise,tfall );
V(vout[2]) <+ transition(vdout[2],tdel,trise,tfall );
V(vout[3]) <+ transition(vdout[3],tdel,trise,tfall );
V(vout[4]) <+ transition(vdout[4],tdel,trise,tfall );
V(vout[5]) <+ transition(vdout[5],tdel,trise,tfall );
end

endmodule

In output i am getting all the flat lines resting at 0 when i am giving a 100ns period to the applied clock i.e vclk, when i print the conversion values i am getting vdout as per my Vin ( kept 2.1 ) analog voltage in my run log but the waveform still shows it 0 . Can anyone tell me what is wrong with the code or if anyone has a working model of Flash ADC i would be thankful.

Regards,

Kulmani

  • Cancel
Parents
  • ShawnLogan
    ShawnLogan over 4 years ago

    Dear Kulmani,

    Within the Cadence ahdl Library (included in your Cadence installation - refer to Figure 1 -there is an 8 bit ADC which uses 8 input comparators whose name is adc_8bit. Hence, this in effect models a flash converter. You might consider using this in lieu of your veriloga model - or perhaps modify it to meet your needs. From the header information in the 

    // This ADC comprises 8 comparators. An input voltage is compared to

    // half the reference voltage. If the input exceeds it, bit 7 is set and half

    // the reference voltage is subtracted. If not, bit 7 is assigned zero

    // and no voltage is subtracted from the input. Bit 6 is found by doing an

    // equivalent operation comparing double the adjusted input voltage coming

    // from the first comparator with half the reference voltage. Similarly

    // all the other bits are found.

    //

    // Mismatch effects in the comparator reference voltages can be modeled

    // setting 'mismatch' to a non-zero value. The maximum mismatch on a 

    // comparator's reference voltage is then +/-'mismatch' percent of

    // that voltage's nominal value.

    //

    Shawn

    Figure 1

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Kulmani
    Kulmani over 4 years ago in reply to ShawnLogan

    Thank you Shawn for your reply. That helped a ton for references. But i am not sure that they have implemented a Flash ADC there as they are substracting the reference voltage and the doubling up the voltage whereas in a Flash ADC we compare the analog inputs with references to generate a decimal thermometric code and then encode it into desired bits. Found the could a bit confusing or maybe i couldn't understand well. But thanks for pointing out the library, i can take a lot of references from there now :)

    Kulmani

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 4 years ago in reply to Kulmani

    Dear Kulmani,

    Kulmani said:
    But i am not sure that they have implemented a Flash ADC there as they are substracting the reference voltage and the doubling up the voltage whereas in a Flash ADC we compare the analog inputs with references to generate a decimal thermometric code

    You are absolutely correct...I did realize that but thought since it was an "ideal" model of a converter it might accomplish what you needed. Perhaps you wanted access to the thermometer code as the output. Obviously, that implementation will not provide a thermometer code - it's topology is more of a SAR. In any case, the veriloga code examples in the library are helpful and am glad you found the library!

    Thank you for the update Kulman!

    Shawn

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Kulmani
    Kulmani over 4 years ago in reply to ShawnLogan

    Thank you for your time Shawn.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Kulmani
    Kulmani over 4 years ago in reply to ShawnLogan

    Thank you for your time Shawn.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information