Hi boe!
boe wrote on Oct 7th, 2009, 8:55am:I'd use code like
Code:analog begin
@(posedge HG or negedge HG or posedge LG or negedge LG) begin
if (~HG & ~LG)
begin vvsw = Vhigh; res = Ron; end
else if (HG & LG)
begin vvsw = Vlow; res = Ron; end
else if (~HG & LG)
begin vvsw = Vx; res = Rx; end
else
res = Roff;
end
V(VSW) <+ transition(vvsw, ...) + transition(res, ...) * I(VSW);
end
BOE
Thank you for your cooperation in always
In this code,
real vvsw,res;
parameter Vhigh = 4.5;
parameter Vlow = 0.0;
parameter Vx = -10;
parameter Ron = 100m;
parameter Roff = 10M;
parameter Rx = 1;//not occur cuz w/t deadtime
a) V(VSW) <+ transition(vvsw, ...);
or
V(VSW) <+ vvsw;
b) V(VSW) <+ transition(vvsw, ...) + transition(res, ...) * I(VSW);
case a) is having a good behavior(expected)
case b) is not well. this behavior is like as first problem.
I wonder that resister should be modeled both HG and LG...
but your way is good way to keep energy of Kirchhoff's laws.
I want to make this model behave as logical function only,
so i should make this model as case a)
a) V(VSW) <+ transition(vvsw, ...);
Thank's a lots of your kinds
ciao
See you soon!! bye for now