EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: JoeN on August 10, 2016, 05:45:40 am

Title: Is LTSpice an appropirate tool to use to model digital circuits?
Post by: JoeN on August 10, 2016, 05:45:40 am
By digital circuits, I mean transistor circuits working as digital circuits where the circuit is modeled up from transistors up to gates, more complex subcircuits, and finally state machines.  Right now I modeled a RS flip flop and built a test circuit to use it as a frequency divider, just as a test.  I think it is quite interesting how as an analog simulation it shows you the slew of the transistors (especially when it is run at a faster clock), voltage excursions, etc.  Is this the way to do it?  Or is this insane?  How well is this going to perform if there are a few thousand transistors in the simulation?

Comments or advice would be appreciated.

Basic gates:

Inverter

(https://www.eevblog.com/forum/beginners/is-ltspice-an-appropirate-tool-to-use-to-model-digital-circuits/?action=dlattach;attach=246772;image)

2-NAND

(https://www.eevblog.com/forum/beginners/is-ltspice-an-appropirate-tool-to-use-to-model-digital-circuits/?action=dlattach;attach=246776;image)

3-NAND

(https://www.eevblog.com/forum/beginners/is-ltspice-an-appropirate-tool-to-use-to-model-digital-circuits/?action=dlattach;attach=246774;image)

The RS flip flop:

(https://www.eevblog.com/forum/beginners/is-ltspice-an-appropirate-tool-to-use-to-model-digital-circuits/?action=dlattach;attach=246770;image)

The testbench circuit:

(https://www.eevblog.com/forum/beginners/is-ltspice-an-appropirate-tool-to-use-to-model-digital-circuits/?action=dlattach;attach=246768;image)

The results:

(https://www.eevblog.com/forum/beginners/is-ltspice-an-appropirate-tool-to-use-to-model-digital-circuits/?action=dlattach;attach=246766;image)



Title: Re: Is LTSpice an appropirate tool to use to model digital circuits?
Post by: bobaruni on August 10, 2016, 09:57:53 am
Looks good and if it works for you, why not!
Simulations will start to slow down the more components and signal paths you have.
Also, there are a few digital gate components built into LTSpice's shipped library.
I just wonder though, if you are going to design something using thousands of transistor, it might be time to look at something like CPLD/FPGA.
Title: Re: Is LTSpice an appropirate tool to use to model digital circuits?
Post by: rstofer on August 10, 2016, 01:33:26 pm
Or at least use the toolchain for the CPLD/FPGAs.  Most have schematic entry and many have simulators.  There's a bit of a learning curve to using the toolchain and describing circuits but they can be described at the gate level.

Try the free version of Xilinx Vivado.