Difference between revisions of "Relay"

From Vlsiwiki
Jump to: navigation, search
Line 1: Line 1:
 +
`include "discipline.h" <br />
 +
`include "constants.h" <br />
 
module relay (c1, c2, pin, nin);
 
module relay (c1, c2, pin, nin);
  

Revision as of 03:56, 9 November 2009

`include "discipline.h"
`include "constants.h"
module relay (c1, c2, pin, nin);

inout c1, c2;
input pin, nin;

electrical c1, c2, pin, nin;

parameter real r=1 ;

analog begin @(cross(V(pin,nin))) discontinuity(0) ;
if (V(pin,nin) >= 0)
I(c1,c2) <+ V(c1,c2)/r;
else
I(c1,c2) <+ 0 ; end endmodule

example from http://www.eda.org/verilog-ams/htmlpages/public-docs/lrm/VerilogA/verilog-a-lrm-1-0.pdf