Atanua - real-time logic simulator

As the final project in my school, I'm building a real-time logic simulator called Atanua. It's available from:

formatting link

Although it's a pure ideal-component logic simulator (not SPICE), it's rather functional. The workflow for trying out different configurations is pretty optimized, and the whole point is to be a rather 'lightweight' tool for learning logic components.

I'm trying to do daily releases of it, building a part or two a day while working full time, but as of this writing the simulated parts include:

Base parts list:

  • Logic '0' (ground) and '1' (vcc) * Logic AND, OR, NAND, NOR, XOR and NOT gates, in both US and Finnish symbols * SR-latch (NOR and NAND versions), Synchronized SR-latch, D- latch, T-latch, JK-latch * JK-flipflop, D-flipflop, T-flipflop, SR-flipflop * 2-bit MUX block, 3-bit DX-block * Synchronized clock generators (0.1Hz, 0.2Hz, 0.5Hz, 1Hz, 2Hz,
5Hz, 10Hz, 20Hz, 50Hz, 100Hz, 200Hz, 500Hz) * Labels

Chips list:

  • 7400 - Quad 2-input NAND Gate * 7402 - Quad 2-input NOR Gate * 7404 - Hex Inverter * 7408 - Quad 2-input AND Gate * 7410 - Triple 3-input NAND Gate * 7420 - Dual 4-input NAND Gate * 7432 - Quad 2-input OR Gate * 7447 - BCD to 7-segment Decoder/Driver * 7473 - 7473: Dual J-K Flip-Flop with Clear * 7474 - 7474: Dual D Positive Edge Triggered Flip-Flop with Preset and Clear * 7485 - 4-bit Magnitude Comparator * 7486 - Quad 2-input XOR Gate * 7490 - Decade Counter (separate Divide-by-2 and Divide-by-5 sections) * 74138 - 3 to 8-line Decoder/Demultiplexer * 74139 - Dual 2 to 4-line Decoder/Demultiplexer * 74151 - 8-Line to 1-Line Data Selector/Multiplexer * 74195 - 4-bit Parallel-Access Shift Register * 74163 - Synchronous 4-bit Binary Counter with Synchronous Clear * 74164 - 8-bit Parallel-Out Serial Shift Register with Asynchronous Clear * 74283 - 4-bit Binary Full Adder * 74574 - Octal D-Type Edge-Triggered Flip-Flop with Three-State Outputs

I/O parts list:

  • LEDs (red, green, blue, cyan, magenta, yellow, white) * 7-segment displays in same colors, normal and inverted * Keyboard keys (0,1,2...9, a,b,c...z)

If you take it for a spin, please send me mail about your experiences! Many of the features I've implemented are result of user feedback.

Reply to
Loading thread data ...

Real-time? That's impressive. How fast a PC do I need to run, say, a

16-bit PWM generator at 30 MHz?


Reply to
John Larkin


Heh, I did not state the fact that the simulation clock runs at 1kHz. If you want 30MHz, get a FPGA.

Reply to

Then it\'s not running real-time, is it?
Reply to
John Fields

Silly argument on the realtime aspect. It's limited in frequency, so what?

It's a beautiful program, I love the graphics. I am stretching my brain right now, to see if I can come up with any creative designs.

As a musician, of course, I would like to see some musical i/o via audio, or midi... But I nag everyone about that so feel free to ignore.

It's great that you got to work on this for school, but I must encourage you to continue development when the class is over. =)


Reply to

-The use of keyboard keys as switches is brilliant. Very well implemented.

-I am not sure if the analyzer is supposed to graph the waveforms?

-I am a big fan of the realism with the graphics. It looks like you used photographs of the chips. Please keep doing that. If possible, even have more than one photograph of chips. For example, perhaps the white 7seg display uses a slightly different photo than the yellow



-When I double click on a Chip, it would be nice if a specification/ help sheet came up, or an internet link was given.

-(minor) The font seems to be pre anti-aliased for a specific zoom, but ideally would be dynamically anti aliased every time you switch zooms.

-(not very serious): One click shopping. Press one button on the corner, and have all the parts purchased for you.

-When I open a .atanua file with Atanua.exe (from the "open with.." prompt) it does not work. It crashes.

-When I edit a .atanua file with a text editor, I noticed that the syntax of a wire is:

Does chip "2" stand for the second chip that is defined in the order of the text file? That could be problematic for people editing the xml file, because they would have to update many of the 's every time they insert or remove a chip. If you do continue to use chip index number's, perhaps that number should be included in the chip definition. EX:

I'm not sure how much this would solve, but perhaps something along these lines could be used to improve manual/third-party editing.

Reply to

Useful, constructive feedback on the usenet?

/me pinches himself.

Yes, I'm still awake.

Thanks, and if you come up with anything, I'd love to see them.

I'm considering making some kind of audio chip, most probably in a form of a preprogrammed microcontroller of some sort, which could be used for audio. I'd rather not make any components that can't be found in real life, even if it is tempting and would be quite easy.. Some kind of aural feedback from the program would be nice in any case.

All real-life sound chips that I've found so far are way too complicated for this kind of use. Something like "select note with pins 1-4, trigger note with pin 5" would be ideal.

It's not for a class, this is my final project. Any further development will depend on the interest - if nobody's using it, there's really no point.. =)

Not sure what you mean?

I think the 7seg I photographed was green, but anyway.. that all depends on how much time I'm going to spend on texture work. And so far I think it's more important to get functionality in than tune the graphics.


formatting link
"); ? =)

The fonts are bitmapped, so I'm not going to touch this.

Heh, many electronics CAD programs actually do have a 'shopping list' generators, so that far it wouldn't be too far-fetched. However, any actual design will need other parts as well.. and you can collect the shopping list from the XML fairly easily.

Heh, that isn't implemented at all, a good catch. I probably have some placeholder code there which causes the crash.

The XML format isn't too flexible at the moment, i.e. the parts must come before the wires. Chip "2" stands for the third chip (since first chip is #0). Pad/pin numbering is more confusing, as it doesn't follow the actual pin number in data sheets, but instead whatever order the pins are defined in code. Most often this is "top row, left to right, bottom row, left to right" but there's no definite rule on that.

In any case, the XML format is more flexible for possible third parties than the binary format was.

Thanks, Jari

Reply to

On Tue, 29 Jan 2008 09:00:10 -0800 in sci.electronics.basics, John Larkin wrote,

It doesn't matter how fast your PC is. Of course it will be a simulated 30 Mhz. He didn't say it was an Emulator, just a Simulator.

Reply to
David Harmon

Then it won't be real-time.


Reply to
John Larkin

Ever since my first post about this, lots of new features have been added, bugs fixed, etc.

Still available from

formatting link

The website has also been updated to include more information, screenshots etc. Requests, ideas, and so on still appreciated.


- New chips: 74181 (some signals may be inverted), 74240, 74241,

74244, 74245

- New chip: 2051 (a 20-pin 8051 variant) based on my 8051 simulator

- Inverted (low-active) LEDs added

- New/load/save button order changed

- Wires now use anti-aliased lines with variable thickness depending on the zoom factor. Probably have to make a config file to control these kinds of features vs. performance.

- Windows open-with system should now work (as well as giving atanua filename to open, same thing in practise)

- Wire tooltip for invalid state re-labeled

- Homework validation system added

- Deleting connection pins with only two wires will now join the two lines (as if they were never split). Pins with more (or less) than two wires are deleted as before.

- Wires are now "fried" when a chip is deleted - connecting wires are deleted recursively if connected to non-complicated connection pins.

- Added atanua.xml, user-editable config file with several options.

- Made toolkit 15 pixels wider by default.

- Crash at startup in some configurations fixed.

- Using 7420 caused crash; fixed.

- Major logic change: invalid state is now propagated. That is, if you feed 'invalid' signal to a chip, it will generate 'invalid' signal out. The old behavior (i.e. invalid input generating highz state) can be enabled by changing the option PropagateInvalidState to 0 in the configuration file. Due to the severity of this change it's possible that this introduced some bugs.

- I believe 7447 BI/RBO pin functionality is now fixed.

- New program icon

- Added some custom, context-sensitive mouse cursors. These can be disabled in the config file.

- Toolkit slider now works more like people might expect it to, for good or bad. This one can't be disabled in the config file. =)

- If user clicked on an item, released, and then click-dragged item from the toolkit, the work area would move a bit when the item was created. Fixed.

- Newly created items now get keyboard focus.

- Labels can now span several lines (i.e. accept enter) Still can't, and probably won't, support cursor movement.

Reply to

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.