The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> Help required for understanding OP-AMP Verilog AMS code
https://designers-guide.org/forum/YaBB.pl?num=1373013987

Message started by indra0804 on Jul 5th, 2013, 1:46am

Title: Help required for understanding OP-AMP Verilog AMS code
Post by indra0804 on Jul 5th, 2013, 1:46am

Hi all,

I have started doing some work in Verilog-AMS recently. I have used some of the codes available in the designers guide website for modelling different circuits.

I have also used the code for Ideal OP-AMP available in the site and it has worked perfectly for me. But I am having a little trouble in the understanding of the code (means how it works)...!!


I am quoting the code:::



// Ideal Opamp
//
// Version 1a, 1 June 04
//
// Ken Kundert
//
// Downloaded from The Designer's Guide Community (www.designers-guide.org).
// Post any questions on www.designers-guide.org/Forum.
// Taken from "The Designer's Guide to Verilog-AMS" by Kundert & Zinke.
// Chapter 5, Listing 1.

`include "disciplines.vams"

module ideal_opamp (pout, nout, pin, nin);
   output pout, nout;
   input pin, nin;
   electrical pin, nin, pout, nout;
   
   branch (pout,nout) out;
   branch (pin,nin) in;

   analog begin
     V(out): V(in) == 0;
   end
endmodule



I am unable to understand what the branch command does??

and also what does " V(out): V(in) == 0 "  mean??

Anyone having the answer pls help.

Thanks in advance,

Indrajit

Title: Re: Help required for understanding OP-AMP Verilog AMS code
Post by boe on Jul 5th, 2013, 4:13am

indra0804,
see Verilog-AMS LRM (languange reference manual) http://www.designers-guide.org/VerilogAMS/vams231.pdf.
- B O E

Title: Re: Help required for understanding OP-AMP Verilog AMS code
Post by Ken Kundert on Jul 5th, 2013, 11:07am

The branch statement simply declares a branch. It creates the branch and gives it a name.

The magic is in the "V(out): V(in) == 0;". You can read this statement as: Find V(out) such that V(in) == 0. This is just a rather direct statement of the virtual short circuit principle. V(in), meaning the voltage between pin and nin, is forced to be 0, but notice that nothing is contributing to or driving the in branch, and so no current flows from pin to nin.

-Ken

Title: Re: Help required for understanding OP-AMP Verilog AMS code
Post by indra0804 on Jul 8th, 2013, 6:34am

Ok, thanks Ken and Boe, Got the idea.

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