Author Topic: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)  (Read 1170 times)

WiJans

  • New Member
  • *
  • Posts: 11
Hi all,
I'd like to share Logic, a digital circuit simulator written in Lazarus / Free Pascal.
You place switches, sensors, logic gates, counters, memories, lamps and displays on a panel,
connect them with wires and run the simulation.
(https://raw.githubusercontent.com/willem750-win/Logical/main/docs/screenshot.png)
Features
  • Inputs: push button, switch, DIP switch (0–15), pulse generator, light and heat sensor
  • Processing: AND, OR and NOT gates, counter block, memory block
  • Outputs: lamp, relay, buzzer, 7-segment display (shows 0–F on counter/memory outputs)
  • Grid, rulers, guides, frame and title on the panel; multi-select and move with wires
  • Ready-made exercise panels
  • User interface and help in Dutch, English, French and German
  • Runs on Windows and Linux (GTK2)
Download (Windows installer, Windows zip, Linux .deb and .tar.gz):
https://sourceforge.net/projects/logic-simulator/
https://github.com/willem750-win/Logical/releases
Source: https://github.com/willem750-win/Logical
The simulation components are in the package jwlogic.lpk (palette tab JWLOGIC).
They are based on the freeware components by Jan Verhoeven, ported to Lazarus and extended.
On Windows the help opens in an embedded CEF4Delphi browser, on Linux in the default browser.
License: MIT. Feedback and bug reports are very welcome!
Willy Jansen
« Last Edit: October 10, 2026, 05:06:26 pm by WiJans »

zamtmn

  • Hero Member
  • *****
  • Posts: 706
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #1 on: October 09, 2026, 12:07:35 pm »
Great! But so far, I haven’t been able to model anything((

CM630

  • Hero Member
  • *****
  • Posts: 1842
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #2 on: October 09, 2026, 09:16:38 pm »
I cannot find power sources and GND  %)

As an example, this was a very promising app https://veppa.com/ekts/, AFAIR it is abandoned and I remember that I have found a huge logical issue.
I wish s.o. made something like this, but working.
« Last Edit: October 09, 2026, 09:19:00 pm by CM630 »
Лазар 4,8 32 bit (sometimes 64 bit); FPC3,2,2

WiJans

  • New Member
  • *
  • Posts: 11
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #3 on: October 09, 2026, 10:35:56 pm »
In a real electric circuit the current flows from the + of a source (a battery, for example), through the switch and the lamp, and back to the −. In Logic you do not draw a source, and the components have no + and −. That is not a mistake: Logic works like digital electronics.

All components get their power from an invisible supply: +5 V and 0 V (ground). It is always there; you do not need to draw it.
A wire carries a signal: on is 5 V, off is 0 V, always measured against ground.
The − of every lamp, buzzer and relay is invisibly connected to ground. That is why a single wire can light a lamp.
Switch and lamp with the invisible supply
Solid lines: what you draw in Logic (a switch, a wire and a lamp). Dashed lines: the supply that Logic adds by itself, from +5 V to ground (0 V).

mas steindorff

  • Hero Member
  • *****
  • Posts: 615
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #4 on: October 09, 2026, 11:51:01 pm »
PS: you should just say from +V to ground, and that your LEDs are magic "logic" voltage powered. That way you can say your code works for 12, 9, 5, 3.3, 2.5, 1.8, & 1.0 Volt systems. it just a simple logic system :P
windows 10 &11, Ubuntu 21+ IDE 3.4 general releases

ALLIGATOR

  • Sr. Member
  • ****
  • Posts: 488
  • FPC git[main] Lazarus git[main] 💪🐯💪
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #5 on: October 10, 2026, 06:45:43 am »
...this was a very promising app https://veppa.com/ekts/, AFAIR it is abandoned...

Interestingly, this app is written in .NET, and I just opened it using dnSpyEx - it turns out to be a very small app in terms of code size. I even think that if I integrated AI as a “worker” into it and rewrote it in Lazarus, it would only take a day.

WiJans

  • New Member
  • *
  • Posts: 11
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #6 on: October 10, 2026, 12:53:25 pm »
Dear member zamtmm, I see that you wrote this "Great! But so far, I haven’t been able to model anything((" can you tell me how you installed it? ?

ALLIGATOR

  • Sr. Member
  • ****
  • Posts: 488
  • FPC git[main] Lazarus git[main] 💪🐯💪
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #7 on: October 12, 2026, 05:58:04 am »
...this was a very promising app https://veppa.com/ekts/, AFAIR it is abandoned...
Voilà!

Thanks to C# for being so open to reverse engineering, and thanks to neural networks.
(All of this was done using the free web version of Claude, over five iterations with 5-hour breaks.)
Standard examples can be found in the original project.

zamtmn

  • Hero Member
  • *****
  • Posts: 706
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #8 on: October 12, 2026, 09:26:16 am »
Dear member zamtmm, I see that you wrote this "Great! But so far, I haven’t been able to model anything((" can you tell me how you installed it? ?
I tried to put together a small circuit, but I couldn’t model it. Also, at some point, some connecting lines disappeared.

WiJans

  • New Member
  • *
  • Posts: 11
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #9 on: October 12, 2026, 11:59:36 am »
Can you tell me which version you are using? OS? and give me more details greetings WJans

zamtmn

  • Hero Member
  • *****
  • Posts: 706
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #10 on: October 12, 2026, 12:26:08 pm »
windows11. There are quite a lot of problems: hidpi damages the top toolbar, some links may stop being displayed when moving components, delete button didn't work for me. IMHO bold, but raw. You need to test the program more yourself.

WiJans

  • New Member
  • *
  • Posts: 11
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #11 on: October 13, 2026, 10:46:26 am »
New release version 1.1.0 with improvements :-)
Download  https://sourceforge.net/projects/logic-simulator/files/

ALLIGATOR

  • Sr. Member
  • ****
  • Posts: 488
  • FPC git[main] Lazarus git[main] 💪🐯💪
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #12 on: October 13, 2026, 11:15:56 am »
CEF 😥😟😱

CM630

  • Hero Member
  • *****
  • Posts: 1842
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #13 on: October 13, 2026, 11:43:56 am »
...this was a very promising app https://veppa.com/ekts/, AFAIR it is abandoned...
Voilà!

Thanks to C# for being so open to reverse engineering, and thanks to neural networks.
(All of this was done using the free web version of Claude, over five iterations with 5-hour breaks.)
Standard examples can be found in the original project.

Did you find the source code somewhere or did you convert from binaries or some other .NET thing?

There are some differences between the original EKTS and your port:
1. They both save files in different formats.
2. Your port opens files made with the original EKTS.
3. The original EKTS cannot open files made with your port.
4. In the original EKTS there is “Single phase induction motor with centrifugal switch”, in your it is named "Single phase induction motor with automatic switch”
5. Etc...

Лазар 4,8 32 bit (sometimes 64 bit); FPC3,2,2

ALLIGATOR

  • Sr. Member
  • ****
  • Posts: 488
  • FPC git[main] Lazarus git[main] 💪🐯💪
Re: Logic 1.0.1 – digital circuit simulator (Windows + Linux, MIT)
« Reply #14 on: October 13, 2026, 11:55:46 am »
Did you find the source code somewhere or did you convert from binaries or some other .NET thing?

There are some differences between the original EKTS and your port:
1. They both save files in different formats.
2. Your port opens files made with the original EKTS.
3. The original EKTS cannot open files made with your port.
4. In the original EKTS there is “Single phase induction motor with centrifugal switch”, in your it is named "Single phase induction motor with automatic switch”
5. Etc...

I decompiled it using dnSpyEx - luckily, .NET is practically open source

Then I uploaded the source code archive to Claude (the web version) and asked it to convert it to Lazarus/FreePascal

During the analysis, it made some suggestions that I agreed with; they seemed reasonable (for example, rendering elements using Graphic controls instead of separate Windows controls, as in the original, and so on)

This included the save format. The original format is .NET-specific, so it suggested JSON, I considered it more portable and agreed. And there may have been a few other suggestions that I can’t recall right now...

To be honest, I didn’t thoroughly compare the behavior; I just briefly looked through some examples, and on average, everything seemed similar in terms of behavior

My goal was to port this project to Lazarus (in whatever form), and perhaps someone will find it useful and want to develop it further or draw some ideas from it in their native language (Pascal)

 

TinyPortal © 2005-2018