Live data from Hacker News

Show HN: I made a little digital circuit simulator that operates on PNGs

github.com

41–50 of 54 posts

Re: Show HN: I made a little digital circuit simulator that operates on PNGs

#41
post #31

This reminds me very strongly of the WireWorld cellular automaton: https://quinapalus.com/wires0.html (Also, how did you get a post with both text and a link? I didn’t know it was possible.)

Powder Toy has a set of elements with electric characteristics, including WireWorld-type wires. Useful when you also want to pour sand on your simulated electronic equipment: https://powdertoy.co.uk/Wiki/W/Elements:Electronics.html

Re: Show HN: I made a little digital circuit simulator that operates on PNGs

#44

We’re also working on something like this, but we’re making a game around it https://charperbonaroo.github.io/bls/#0

Oh wow this is awesome. I got through the first few levels and would like to complete it later... Also, is this the same as the 2015 'bitmap logic simulator'? I found this while reworking reso awhile back: https://realhet.wordpress.com/2015/09/02/bitmap-logic-simula...

Yes, I also posted the progress there. The 8bit cpu example runs perfectly in my “game”.

I’m rewriting it to Unity and there I can run the 8 bit cpu from that blog with about 14000 ticks per second.

We’re planning to create a game around it with few dozen of levels, including controlling robots, traffic lights, a bowling pin sorter and tanks/units in a tiny top-down shooter (where programs from players play against each other).

Edit: if you download the cpu image from the blog and upload it to the game, you can see it run. It’s visually a bit broken because the game in its current state isn’t really designed to have such a big canvas, but it runs perfectly fine.

Edit 2: the CPU running in unity web build here: https://charperbonaroo.github.io/microengineer-build/

Re: Show HN: I made a little digital circuit simulator that operates on PNGs

#45

We’re also working on something like this, but we’re making a game around it https://charperbonaroo.github.io/bls/#0

Very cool. One piece of feedback is that it took me an embarrassingly long time to figure out that "edit" was not selected. Since it's highlighted (in red), I tried to edit the circuit on the screen to no avail.

Re: Show HN: I made a little digital circuit simulator that operates on PNGs

#46
Super-cool.

I haven't looked at the source, but I bet it's massively parallel, at the pixel level? (I do see you say it's "not a cellular automaton", though...)

If so, I wonder how difficult it would be to port this to GPU, either writing CUDA yourself, or maybe even using PyTorch.

If PyTorch, you might be able to make it differentiable (by changing ANDs to MULs and such). What would be achieved by making the simulation differentiable I don't know. But surely you'd come up with something interesting. Given how much effort has gone into developing architectures whose gradients don't explode, my guess is you'd run into difficulties, but maybe you could even learn programs that model various sequences.

The main point would just be to run it on the GPU, though.

Re: Show HN: I made a little digital circuit simulator that operates on PNGs

#47

Brilliant idea! That logo however is the most repulsive piece of artwork I've seen in a long time. (I am sorry for being blunt)

I think it's cool, TBH. But sure, another palette might look better. That might push towards more of a special purpose frontend though, vs. whatever image editor you want (RGB are easy).

Re: Show HN: I made a little digital circuit simulator that operates on PNGs

#49

Super-cool. I haven't looked at the source, but I bet it's massively parallel, at the pixel level? (I do see you say it's "not a cellular automaton", though...) If so, I wonder how difficult it would be to port this to GPU, either writing CUDA yourself, or maybe even using PyTorch. If PyTorch, you might be able to make it differentiable (by changing ANDs to MULs and such). What would be achieved by making the simulat…

Thank you! And not parallel, alas. The image compiles to a graph, where contiguous regions are nodes and adjacent regions form edges.

Regarding differentiation, the logic gates could look like a differential equation. Between iterations, input nodes amass a binary vector from adjacent wires, and pass them onto adjacent output nodes. So, mapping {0,1}^n --> {0, 1}, you could write them all in terms of some periodic function. (E.g. xor implemented with sin, or implemented with a sigmoid made from a quarter of a sin, etc.)

Either way, yeah! There is plenty of room to speed this up

Re: Show HN: I made a little digital circuit simulator that operates on PNGs

#50

Similar idea to Wired-Logic https://github.com/martinkirsche/wired-logic Wired-Logic uses a GIF as output. Interesting take on making AND and XOR gates, makes it a bit more colorful.

Oh wow I love this, I missed it while looking for similar projects. The example is very impressive to boot.
Post reply on HN