Difference between revisions of "Relay"

From Vlsiwiki
Jump to: navigation, search
(Created page with '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(pi…')
 
Line 1: Line 1:
module relay (c1, c2, pin, nin) ;
+
module relay (c1, c2, pin, nin);
inout c1, c2 ;  
+
 
input pin, nin  
+
inout c1, c2;<br />
 +
input pin, nin;<br />
 +
 
 
electrical c1, c2, pin, nin;  
 
electrical c1, c2, pin, nin;  
 +
 
parameter real r=1 ;
 
parameter real r=1 ;
analog begin @(cross(V(pin,nin))) discontinuity(0) ;
+
 
if (V(pin,nin) >= 0)
+
analog begin @(cross(V(pin,nin))) discontinuity(0) ; <br />
I(c1,c2) <+ V(c1,c2)/r;  
+
if (V(pin,nin) >= 0)<br />
else
+
I(c1,c2) <+ V(c1,c2)/r; <br />
 +
else<br />
 +
I(c1,c2) <+ 0 ;
 
end endmodule
 
end endmodule

Revision as of 22:49, 8 November 2009

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