State(,) function

Hi all,
I found in the revision history that the state(,) function for behavioral sources has been implemented. Does anyone give any detailed description of it?
Thanks!

Best regards
Yi

State(n,x) is a Pspice function that has been added to Qspice based on the request by @RobW. RobW quoted the detailed explanation of State(n,x) from Pspice in this post.
Can QSPICE Simulate Converted IBIS Models Generated by emisleuth.com? - QSPICE - Qorvo Tech Forum

Hi Kelvin,

Thanks for your explanation.
Do you know any plan of LTspice’s state machine function to be implemented in QSPICE? or it has been?

Regards
Yi

I don’t know about that. However, do you think a state machine function is still required in Qspice? Wouldn’t DLL-devices (C++ or Verilog) be able to handle logic you need?

Even C++ or Verilog would be able to handle what he need through code, this does not mean that such a command state machine should not be implemented also in qspice, as LTspice did.

I see it handy to have beside the code, see on second page of below:

I sent few minutes ago an email to Mike about this, if he could implement such a command state machine (.machine) also in QSPICE. Hope he will see my email and consider this. Maybe others which are interested to have such a command available in qspice could write to him to implement this.

Great to have DLL of course, but I have some LTSPICE models based on state machine command and would like to convert some of them to QSPICE. This is the back ground.

Done it as well.
I see the command very convenient for the LTSPICE->QSPICE conversion, especially when the state machine is only a small part of the LTSPICE model.