Computer/online tool for simulating logic signals? - Page 1
Forum section: electronics / beginners

author: analogix
author_rank: Frequent Contributor
timestamp: January 08, 2025, 10:06:10 pm
content: I'm trying to get my head around how a physical slide-switch (schematic attached below -see the green wires) affects the logic signal which further controls various ICs (i.e. where is the signal high and where is it low?).Pen and paper helps, but is still confusing, so I've been wondering if there are suitable computer tools (online or as a Mac app) which allows me to insert the switch, voltage pins/pullup-/down resistors and the XOR gate (74AHC86). I've found a few such online browser-based tools, but they appear quite complicated and I can't find any switch component (DP3T) to add either.Suggestions?(NOTE: I can't take credit for the attached schematic;it's from another contributor who kindly posted it here). I just added the orange comments as my own notes for understanding it better).

author: ledtester
author_rank: Super Contributor
timestamp: January 09, 2025, 07:43:53 am
content: Here is how I see how the slide switch operates:There are three positions the switch can be in:Position A: pin 1 is connected to pin 2Position B: pin 2 is connected to pin 3Position C: pin 2 is connected to pin 4The switch works the same way as described in this post:https://electronics.stackexchange.com/questions/524856/sp3t-slide-switch-positionsSo the voltages on pins 1 and 3 will be:Pos. Pin 1 Pin 3A GND +5B +5 GNDC +5 +5The voltage on SW1 pin 1 determines if the video from CN3 will be sent to the Atari or VGA connector. The voltage on pin 3 determines color vs. monochrome if the VGA connector is specified.Does this help?

author: analogix
author_rank: Frequent Contributor
timestamp: January 09, 2025, 10:37:51 am
content: Quote from: ledtester on January 09, 2025, 07:43:53 amAha!!! I was completely mistaken about switch position C, thinking the slider always shorts the next two pins, hence pin 3 connects to 4.I should have looked more closely at the switch part in the schematic, which indeed gives away the connections.Thanks for clearing this up!QuoteUseful info indeed!And the comment in there about always measuring non-standard components before designing/ordering the PCB is something I'm going to follow. Actually I read somewhere that it's always a good idea to print out the PCB layout on paper in order to measure if all the components fit/have the correct footprint).QuoteIt certainly does!I had to spend some time with this (I tend to understand things better visually, hence my question about a beginner-friendly logic simulator), but your pointing out the switch behaviour and the resulting voltages on those pins was just what I needed!But one thing still puzzles me regarding the logic control signals.I've read aboutthe basics of logic gates, and while the 74AHC86 (U7) is an XOR gate, couldn't I just use a NOT gate instead (to invert the "enable" signals between the Atari and VGA multiplexers)?In the current schematic, the VGA side uses 74AHCT126buffers (which are the same as the Atari side's 74AHCT125buffers, except they get enabled with the opposite logic signal).So with a NOT gate, why not just use 74AHCT125buffers there as well, having its "enable" pins connected to the VGA multiplexer's (U1) enable pin? Or is there something I've missed, and there's a specific reason the XOR gate is chosen as an inverter?

author: golden_labels
author_rank: Super Contributor
timestamp: January 09, 2025, 01:03:21 pm
content: Regarding the software question: take a look at logisim-evolution. It’s a fork of the now unmaintained Logisim. MacOS support is advertised, which should be true given it only requires a Java environment.Repo at GitHub&downloads.Among primary devs:Theo Kluter of Bern University of Applied Sciences(listed in “Focus areas”),Torsten Mähne(linked GitHub account).References:Cornell University,Manchester Metropolitan University,Gary Zoppetti of Millersville University(person).But note that any software is just a fancy calculator. It is user’s job to make sure the mathematical model fits matches the reality. With real world digital circuits the common traps are: signaling details (e.g. open collector vs active drive), propagation time, timing restrictions, unwanted analog effects.

author: ledtester
author_rank: Super Contributor
timestamp: January 09, 2025, 05:01:43 pm
content: Quote from: analogix on January 09, 2025, 10:37:51 amYes.QuoteYes, you could have U5, U6, U3 and U4 all be the same type of buffer (either '125s or '126s) and drive them with the appropriate logic signal. This could simplify your bill of materials.There are other "bus transceiver" chips which also might work for U3 - U6, such as the '244:https://www.ti.com/product/SN74HCT244Or even possibly use additional TS5V330PWR's in place of the '125s and '126s.Note that the schematic uses single gate versions of the '125 and '126, but you can get four of these buffers on a single chip which might work for this application:https://www.ti.com/lit/ds/symlink/sn74hct125.pdfIt's all a matter of balancing cost, availability, board space, routing, etc.

author: techninja80
author_rank: Regular Contributor
timestamp: January 09, 2025, 06:45:28 pm
content: Although the real question was answered I would like to post that, Microcap could simulate those logic signals. For the sig gen, it has a PWL feature that can be used to create any logic signal.

author: Infraviolet
author_rank: Super Contributor
timestamp: January 09, 2025, 07:37:20 pm
content: It's not for pure logic, it has logic gates though among parts you can drop in to otherwise analogue circuits, but Falstad (https://www.falstad.com/circuit/) is a useful online circuit simulator. Probably not particularly computationally efficient or super precise compared to other simulators, but good for getting a flavour of things. And I think it has a downloadable version too.

author: ahsrabrifat
author_rank: Regular Contributor
timestamp: January 10, 2025, 03:47:16 pm
content: You can try LTspice. It has a simulator that can perform various types of analysis such as DC,AC,transient, noise, distortion or Fourier.

author: analogix
author_rank: Frequent Contributor
timestamp: January 10, 2025, 05:55:34 pm
content: Quote from: ledtester on January 09, 2025, 05:01:43 pmThanks for confirmingI hope you don't mind, but since I'm the OP of the original project's thread and your reply is directly to that, I've replied back there instead:VGA display switching with debouncer/multiplexer/buffer circuitry?(reply #78)

author: analogix
author_rank: Frequent Contributor
timestamp: January 12, 2025, 10:05:32 pm
content: Thanks for all the suggestions!For starters I downloaded and installed bothLogisim-EvolutionandLTspiceon my Mac, and while they both look very capable, to me they're intimidating and confusingFor now I just need something very basic and mostly self-explanetory so as to visually understand what a logic gate does and so on (like how the switch and inverter in the schematic works with the various settings).So I've kept searching and found a few free online tools. Here are some screenshots as well (click them for full-size views), in case others reading are looking for something like this:Logic.lyseems to be the prettiest looking one, and mostly self-explaining, but costs US$ 59. I'm not sure how much I can do with the demo, and if it's time limited or if I can use it as much as I like online though. I must admit I'm a sucker for a pretty user-interface.101 Computing's Logic GatesCircuit Simulatoris similar in pretty looks to Logic.ly, but free. More limited (I wish I could add pullup/pulldown resistors to see what they do as well, like with Logic.ly, but free goes a long way!). NiceAcademo Logic Gate Simulatorlooks nice as well, but is limited in terms of components you can add.CircuitVerseisn't as pretty as the ones already mentioned, but has many components and looks decent.Logic Simulatoris also a decent one in terms of components and looks.WebGateshas a clean, simple look, although limited in choice of components.Are there other similar tools I should have included?

author: ledtester
author_rank: Super Contributor
timestamp: January 13, 2025, 02:56:04 am
content: Logisim-Evolution is another actively developed digital logic simulator:https://github.com/logisim-evolution/logisim-evolution