×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Logic Simulator

Logic Simulator

Logic Simulator

(OP)
I'm looking to lash together a collection of decoders and multiplexers (probably 74 series TTL, but I'm not settled on that yet) in a way I haven't done for 30+ years.

Back then, the development process involved a lot of mistake making (sometimes followed by buying new hardware) on a breadboard. It feels like I ought to be able to to do better than that now.

I think I want to run a simulator on my pc. I've used LTSpice from time to time, but wondered which of the Logic equivalents people would recommend. Ideally, I'd like something that was easy to pick up (I don't see me doing this very often, so it would be a fresh learning curve every time) and that came with a reasonably comprehensive component library.

Other information: The aim of the project is to expand the DIO capability of one of my dataloggers to be able to read and write a much larger number of discrete lines. Pacing will be driven by external software and I can afford to run the whole thing slowly enough that I think I don't need the simulation to address timing issues.

Grateful for any thoughts.

A.

RE: Logic Simulator

Wow! A blast from the past.
I am not sure if this will help, but I had a little experience with logic systems way back when.
Programming language:
The two main protocols that I remember were Boolean algebra and line diagram schematics showing the actual wiring connections in a relay based logic system. (NOT single line diagrams)
My students were mostly journeyman electricians who had previous experience with line diagrams and found them easy to work with.
Some of the equipment (PLCs) used was programmed in Boolean, and almost all of the students were able to pick up Boolean.
We did a lot of training on GE Solid State Logic systems. The connections between the logic gates on the diagram represented the actual wires that interconnected the gates on the bread board.
We found that a logic diagram similar to the relay based line diagrams was easy to develop, easy to analyze and easy to trouble shoot.
A feature of the series 74 circuits and the GE Logic ciruits is that when an input changes state, the output and/or memory value immediately changes state.

As for PLC based systems a new issue arose;
CIRCUIT RACE. A PLC scans the inputs, scans the logic, solves the logic and then sets the outputs.
Some scanned a line and set the output for the line.
Some PLCs broke the logic into blocks, scanned a block and set the output for a block.
Some PLCs scanned the entire program and then set all of the outputs.
I developed a simple two or three line program to illustrate circuit race.
If the order that the lines was reversed, the operation change.
If one line was entered into a following block the action of the circuit changed.
I forget the details but there were at least three different operations depending on how the circuit was entered and how the PLC scanned the program.

What does this have to do with series 74 TTL?
Nothing.
BUT
Beware of using a simulation program that may be intended for PLCs.
It may not give an accurate simulation of a TTL logic circuit.
Hope this helps.

Bill
--------------------
"Why not the best?"
Jimmy Carter

RE: Logic Simulator

I have LTspice downloaded too. I use it for power stuff, not logic stuff, but I've seen in many places that logic modules can be added. AFAIK Linear doesn't include much TTL themselves, if any, but they sure have a lot of op-amps. Are you sure you want discrete logic modules, or just something that simulates a particular ADC?
If I were looking for advice on which LTSpice modules work best, and where to find them, I'd go asking at a forum such as: Electro-Tech or, obviously, by contacting Linear Technologies themselves and letting them recommend a source.

STF

RE: Logic Simulator

Anecdote warning.
One advantage of logic such as the 74 series was speed when compared to the early Z80 and 8080 processors.
When dealing with large sorts such as lumber sorters. the logic systems could be extended in parallel as much as needed and the logic would be solved in one clock pulse.
With an 8080, the large number of choices as to where the next board was to be dropped resulted in a lot of thrashing to memory and back.
The early attempts to use 8080 based control failed.
It was found that in some cases, before a board was processed by the 8080, the next board had arrived and the system would have a nervous breakdown.
Typically,
Check thickness, 2"
Check width, 6"
Check length, 10 '
Check count, 2" x 6" x 10' bin.
Bin full.
Assign second bin, 2" x 6" x 10'
Add one to count, 2" x 6" x 10'.
Set drop off solenoids, 2" x 6" x 10' bin.
In the background.
Dump initial 2" x 6" x 10' bin.
Reset hardware, initial 2x6x10 bin.
Reset count, initial 2x6x10 bin.
Assign initial 2x6x10 bin to empty bin queue.
In some high speed mills the interval between boards may be less than one second.
At times the 8080 could not complete the solution in that time.
As slow as the old logic systems were, they could be expanded with parallel shift registers as much as was needed and could easily solve the logic in much less than one second.
A knew one of the first men to try to convert the logic systems to 8080 systems. He was brilliant but he failed. One of his only failures.

Bill
--------------------
"Why not the best?"
Jimmy Carter

RE: Logic Simulator

(OP)
Thank you everyone.

Smartsim is looking closest to what I thought I had in mind, so I'm going to spend a bit of time trying to make it work for me (first experience is a bit worrying - it crashed about five minutes into the opening tutorial)

Love the war stories.

A.

RE: Logic Simulator

Might I suggest a simple FPGA, or perhaps even a GAL/PAL? May simplify the overall board design, as well as timing.

Dan - Owner
http://www.Hi-TecDesigns.com

RE: Logic Simulator

(OP)
MacGyvers, FPGA wasn't an option the last time I did any logic design. I need to go away and catch up with what the technology's been up to, because that looks like it might be a real boon.

A.

RE: Logic Simulator

ZF,
I hope you can report some of your impressions about Smartsim after you've climbed the learning curve a little.
There's a (small) chance that I'll have to give myself a crash course in logic circuit design in the near future.
I have recently been flipping through Lancaster's TTL cookbook and all I've discovered is the depth of my ignorance.

STF

RE: Logic Simulator

(OP)
Working on it. I've found enough problems with Smartsim to lead me to take a smart step back and try Logisim instead - but I want to tinker a bit more before I go into detail.

A.

RE: Logic Simulator

I have found my wife to be an incredible logic simulator at times. Her arguments are an amazing simulation of logic without actually containing logic at all... bigcheeks

RE: Logic Simulator

Time to upgrade to the latest version, handleman... but I highly suggest backing everything up and storing it in a safe place first.

Dan - Owner
http://www.Hi-TecDesigns.com

RE: Logic Simulator

(OP)
Long post. After a bit of fiddling with the tools people sugested, here are my totally biased opinions.

LTSpice
Let’s start with LTSpice, partly because it’s probably better known than the other products mentioned in this thread and partly because it’s somewhat different from the others. This is a longstanding installable application provided free of charge by a chip manufacturer and is probably best seen as a lowish-end pro-tool.

Where it differs from the other products is that it’s primarily an analog simulation tool that’s designed to provide detailed time-domain emulation of circuits made of devices with real-world characteristics. None of the other tools has anything like the transient analysis capability

There’s a large built-in component library, and the ability to import SPICE models for a vast array of additional devices. For example, TI provides compatible models for the entire 74 series (which is a huge boon for my purposes)

Visualising what’s going on in big logic networks with LTSpice is much more fiddly than any of the other tools I looked at – it’s just not what it was optimised to do.

The documentation is extensive and there’s a large online user community

SmartSIM
This one is interesting. So far as I can make out, it’s a sixth-form computer science project that got published at the end and hasn’t really been supported since. As a school project, it’s an astonishing tour de force – but I think it’s got a way to go before you’d call it a mature tool.

What it does – quite easily – is to let you build generic logic circuits and to simulate their operation, visualising the state of all the lines along the way. Creating subcircuits and embedding them in more complex systems is quite straightforward.

The built-in toolkit of generic logic gates is fairly limited and seems to be missing things I think are important (for instance, there are no pullup resistors, making it difficult to simulate the open emitter inputs of TTL logic. Probably not a burning issue for basic education, but a bit of a deal-breaker for the system I was exploring). I couldn’t find any evidence of external component libraries.

The simulation is an area where I started well, then ran into trouble. Simulations run in a separate pane and it takes a few clicks to launch this (though nowhere as many as LTSpice does). Once the simulation pane is open, you see the network with lines colour coded according to their logic state and can poke the inputs to change their state (seeing the effect on the rest of the network as you go). I got into trouble when I simulated a pair of tri-state buffers talking onto the same bus. I think there was a race on the enable lines, causing a transient bus contention, which in turn made the simulation terminate. I would have preferred it if the simulation had given a warning and then carried on simulating to see if the race would resolve itself. As it was, everything just ground to a halt.

There’s about forty pages of documentation which actually manages to be quite comprehensive (indicative of the basic nature of the product) and includes a well-written tutorial. I can’t see online evidence of any user base.

Logisim
This is an open-source application. Although it spent some time maturing in service, support seems to have stopped in 2014 (though there's at least one live fork somewhere else). In spite of that, it feels quite solid - like a high-end hobbyist tool.

In many ways, it tries to do the same job as SmartSim – but does it in a bit more detail and a bit more reliably.

Once again, there’s a toolkit of generic gates, but these are supplemented by a large collection of intermediate level devices (generic adders, multipliers, multiplexers, registers, etc) and also the stuff like pullup resistors that I missed so badly in SmartSim. There’s a mechanism for importing libraries from the web and, although the particular devices I was interested in don’t appear to be there, I could find a substantial proportion of the 74 series when I looked.

There’s plenty of capacity for creating subcircuits and nesting them to your heart’s content. Having said that, there is something about the business of navigating between the levels (in particular, extracting myself from down among the weeds after I’d burrowed in for a closer look that kept causing me problems). Not sure if this was a gap in the menu system, or a flaw in my head (I have my suspicions).

The simulation works on the same screen as building the circuit, which is great if you’re as impatient as I am. There’s the usual collection of inputs you can poke to change their state and colour coding of lines. It proved much more resistant to transient contentions than SmartSim was - it certainly didn’t crash out on me. On the other hand, there was no warning of there having been any glitchy behaviour. On a different project, I might have been keen to know about that.

Documentation exists, and is helpful – and there’s a low-key online support community.

Everycircuit.com
I came to everycircuit.com last of all, partly because I was put off by the introductory video. Having got there, I didn’t stay long, mostly because it seems to be entirely undocumented. On the basis of my short visit, I think it’s probably best as a basic educational tool, but one with more versatility than I initially gave it credit for. It’s web-based, rather that an installable application, with a lifetime subscription coming in at about $15

Everycircuit’s big selling point looks like it ought to be the way it lets you visualise what’s going on in both digital and analog domains. Digital lines are colour coded and respond to poke buttons (with an interestingly and potentially valuable slow propagation) in much the same way as Logisim or Smartsim, while points on analog lines can be marked up with stripcharts (a little like LTSpice, but drawn in miniature in location) for voltage and a flowing dot visualisation (maybe helpful in a basic educational environment) for current.

There’s a fairly wide-ranging palette of basic generic components – analog, logic and electromechanical, but I didn’t see any real device models and I couldn’t see any tri-state output options on the logic gates. A quick web search didn’t reveal any libraries of industry-standard components.

The lack of documentation really started to annoy me when I began to try to see whether I could create subcircuits and use them to build more complex systems. At the same time, I started to realise that when you’ve got both analog and generic logic simulation going on in the same network, you really need better documentation to be able to tell how the one is going to influence the other.

There seems to be a fairly active user community, with three or four new circuits appearing online in the time it’s taken me to type the last few paragraphs.

My choice
There isn't a clear Swiss Army knife here. I think I’m going to use LogiSim to verify the layout of my overall logic, but then drop down to LTSpice for the few places where I’ve got a nonstandard interface to make sure that the generic assumptions made by LogiSim are actually going to be honoured.

A.

RE: Logic Simulator

Virtual purple star for you ZF, this is a very valuable review! Thank you

STF

RE: Logic Simulator

Quote (OP)

I got into trouble when I simulated a pair of tri-state buffers talking onto the same bus. I think there was a race on the enable lines, causing a transient bus contention, which in turn made the simulation terminate. I would have preferred it if the simulation had given a warning and then carried on simulating to see if the race would resolve itself. As it was, everything just ground to a halt.
I was concerned about something like this. It may not be possible for a computer program to properly simulate all discrete logic circuits.
There may be a circuit race in the program that does not exist in the actual circuit.

Bill
--------------------
"Why not the best?"
Jimmy Carter

RE: Logic Simulator

ZF, Care to share how many DIO lines you are needing to handle and at what speed you need to do the read/write? Does the outside world change slow enough so you can poll or do you need to take a snapshot of all of the lines at the same time?

RE: Logic Simulator

(OP)
Here's the story: I'm in the interesting position at work where one of my "stakeholders" has turned a card rack (something like five 96 pin Eurocards and half a dozen 24 pin external connectors all interconnected in a maze of wire wrap) into a dribbly short-circuity mess. The OEM is happy to rebuild the rack for me, but not to test it afterwards. The application is critical enough that installing the repaired rack without prior testing isn't acceptable.

I'm really doing a "buy a loom tester" Vs "shop the testing out to somebody else" Vs "get somebody I trust to do both rebuild and test and have the IPR argument afterwards" comparison, but I thought it would be an interesting exercise to scope out a "build my own loom tester" option as well.

In principle, this would be something that asserted one of the terminals (probably pulled it low), then polled each of the others in turn to see which were connected to the first one - then asserted the next terminal along the line and repeated until complete. In hardware terms, this would take anything from 64 to 640 separately addressable I/O terminals. Switching speed is controlled by the tester (the outside world being essentially steady state).

I can see how I could do all the bits of this - for instance, demultiplexers with open collector outputs, TTL demultiplexers that pull their own inputs high, a USB DAQ box to interface the logic with a PC and a python script to talk to the datalogger would all fit together.

Then the real education begins: For a one-off job, I can't justify the hardware (especially connector) and construction-time costs of a 640 terminal tester. On the other hand, as soon as I reduce the number of terminals and test the rack in blocks, the number of blocks I need to test gets out of control really quickly.

This exercise has been a good way of reminding myself about logic design and finding out about some simulation tools I hadn't seen before, but the thing I've really learnt is why the OEM was so reluctant to quote for the testing in the first place. That's a lesson I can take back to work.

A.

RE: Logic Simulator

Did I get the math right? Will 640 inputs have over 200,000 possible combinations?
Does the OEM test new circuits or just push them out the door and hope for the best?

Bill
--------------------
"Why not the best?"
Jimmy Carter

RE: Logic Simulator

(OP)
That's the sort of number I get. The redeeming feature is that the vast majority of those combinations are intended to be open-circuit and the design documentation is pretty clear about the minority that are meant to be connected together. Stepping through 100 combinations a second, the whole thing could be tested for opens, miswires and shorts in well under an hour. Given a loom tester with enough inputs, time and cost are likely to be driven by programming and by making (and testing) interfacing connectors.

I like to think the OEM tested the units when they originally built them - but that was nearly 20 years ago, they only ever made two of the things and then they stopped doing their own electronics shortly afterwards.

A.

RE: Logic Simulator

Brother, I feel your pain.

Bill
--------------------
"Why not the best?"
Jimmy Carter

RE: Logic Simulator

Quote (zeusfaber)

Stepping through 100 combinations a second
My microprocessor-laden brain cringes at such low values...

Dan - Owner
http://www.Hi-TecDesigns.com

RE: Logic Simulator

ZF - FPGAs were mentioned earlier. Most FPGA development tools have very nice built in simulators. You can check almost everything before you commit to hardware. You might find an FPGA evaluation board available that you'll just need to add a power supply, interface logic, and cabling to have a quick solution.

Z

RE: Logic Simulator

(OP)
I might end up buying myself one of the real cheapy evaluation boards and have a play just for education - as I think I may have mentioned already, FPGAs are completely new territory for me.

I've already convinced myself that using a homebrew device to do my full-scale one-off at-work test job isn't going to be the favoured solution - but I think doing a mini version might be a good vehicle for teaching myself FPGA sometime.

A.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close