| |
How can I switch between two voltage source connected to the same node for some time and duration using HSPICE elements.
Answer:
There are two ways to do this. One is to design a Verilog-A module that can be used as a behavioral switch. Another is to use the HSPICE voltage controlled voltage source (E-element) to design a behavioral switch. The netlist is as follows: *************************** .option post Vin1 in1 0 pwl ... $ source 1 Vin2 in2 0 pwl ... $ source 2 Ein in 0 vol='v(in1)*v(ctrl) + v(in2)*(1-v(ctrl))' $ behavioral switch vctrl ctrl 0 pwl 0 1 49n 1 50n 0 $ control voltage .tran 1n 100n .end **************************** In the above example, v(ctrl) is set to 1 initially so that v(in)=v(in1). At 50nS, the control voltage is set to 0 and v(in)=v(in2).