Author Topic: Computer/online tool for simulating logic signals?  (Read 693 times)

0 Members and 1 Guest are viewing this topic.

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Computer/online tool for simulating logic signals?
« on: January 08, 2025, 10:06:10 pm »
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).
« Last Edit: January 08, 2025, 10:26:37 pm by analogix »
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3373
  • Country: us
Re: Computer/online tool for simulating logic signals?
« Reply #1 on: January 09, 2025, 07:43:53 am »
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 2
Position B: pin 2 is connected to pin 3
Position C: pin 2 is connected to pin 4

The switch works the same way as described in this post:

https://electronics.stackexchange.com/questions/524856/sp3t-slide-switch-positions

So the voltages on pins 1 and 3 will be:

Pos.  Pin 1   Pin 3
  A    GND   +5
  B    +5     GND
  C    +5     +5

The 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?
 
The following users thanked this post: analogix

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: Computer/online tool for simulating logic signals?
« Reply #2 on: January 09, 2025, 10:37:51 am »
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 2
Position B: pin 2 is connected to pin 3
Position C: pin 2 is connected to pin 4

Aha!!! 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!


Quote
The switch works the same way as described in this post:

https://electronics.stackexchange.com/questions/524856/sp3t-slide-switch-positions

Useful 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).


Quote
Does this help?

It 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 about the 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 74AHCT126 buffers (which are the same as the Atari side's 74AHCT125 buffers, except they get enabled with the opposite logic signal).
So with a NOT gate, why not just use 74AHCT125 buffers 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?

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1509
  • Country: pl
Re: Computer/online tool for simulating logic signals?
« Reply #3 on: January 09, 2025, 01:03:21 pm »
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.
« Last Edit: January 09, 2025, 01:14:23 pm by golden_labels »
People imagine AI as T1000. What we got so far is glorified T9.
 
The following users thanked this post: analogix

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3373
  • Country: us
Re: Computer/online tool for simulating logic signals?
« Reply #4 on: January 09, 2025, 05:01:43 pm »

But one thing still puzzles me regarding the logic control signals.
I've read about the 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)?

Yes.

Quote
In the current schematic, the VGA side uses 74AHCT126 buffers (which are the same as the Atari side's 74AHCT125 buffers, except they get enabled with the opposite logic signal).
So with a NOT gate, why not just use 74AHCT125 buffers 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?

Yes, 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/SN74HCT244

Or 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.pdf

It's all a matter of balancing cost, availability, board space, routing, etc.
 
The following users thanked this post: analogix

Offline techninja80

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ca
Re: Computer/online tool for simulating logic signals?
« Reply #5 on: January 09, 2025, 06:45:28 pm »
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.
 
The following users thanked this post: analogix

Offline Infraviolet

  • Super Contributor
  • ***
  • Posts: 1190
  • Country: gb
Re: Computer/online tool for simulating logic signals?
« Reply #6 on: January 09, 2025, 07:37:20 pm »
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.
 
The following users thanked this post: analogix

Offline ahsrabrifat

  • Regular Contributor
  • *
  • Posts: 50
  • Country: pk
Re: Computer/online tool for simulating logic signals?
« Reply #7 on: January 10, 2025, 03:47:16 pm »
You can try LTspice. It has a simulator  that can perform various types of analysis such as DC,AC,transient, noise, distortion or Fourier.
 
The following users thanked this post: analogix

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: Computer/online tool for simulating logic signals?
« Reply #8 on: January 10, 2025, 05:55:34 pm »

But one thing still puzzles me regarding the logic control signals.
I've read about the 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)?

Yes.

Thanks for confirming  :-+
I 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)

« Last Edit: January 12, 2025, 10:14:52 pm by analogix »
 

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: Computer/online tool for simulating logic signals?
« Reply #9 on: January 12, 2025, 10:05:32 pm »
Thanks for all the suggestions!
For starters I downloaded and installed both Logisim-Evolution and LTspice on my Mac, and while they both look very capable, to me they're intimidating and confusing ???
For 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.ly
seems 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.
2481523-0

101 Computing's Logic GatesCircuit Simulator is 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!). Nice  :-+
2481503-1

Academo Logic Gate Simulator looks nice as well, but is limited in terms of components you can add.
2481507-2

CircuitVerse isn't as pretty as the ones already mentioned, but has many components and looks decent.
2481511-3

Logic Simulator is also a decent one in terms of components and looks.
2481515-4

WebGates has a clean, simple look, although limited in choice of components.
2481519-5

Are there other similar tools I should have included?
« Last Edit: January 12, 2025, 10:14:05 pm by analogix »
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3373
  • Country: us
Re: Computer/online tool for simulating logic signals?
« Reply #10 on: January 13, 2025, 02:56:04 am »
Logisim-Evolution is another actively developed digital logic simulator:

https://github.com/logisim-evolution/logisim-evolution
 
The following users thanked this post: analogix


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf