Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
`include "disciplines.vams"
module relay (p, n, ps, ns);
parameter real thresh=0; // threshold (V)
output p, n;
input ps, ns;
electrical p, n, ps, ns;
analog begin
@(cross( V(ps,ns) - thresh, 0 ))
;
if (V(ps,ns) > thresh)
V(p,n) <+ 0;
else
I(p,n) <+ 0;
end
endmodule