Connect with us

Atanua - real-time logic simulator

Discussion in 'CAD' started by Sol_HSA, Jan 29, 2008.

Scroll to continue with content
  1. Sol_HSA

    Sol_HSA Guest

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

    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

    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
    * 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

    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.
  2. John Larkin

    John Larkin Guest

    Real-time? That's impressive. How fast a PC do I need to run, say, a
    16-bit PWM generator at 30 MHz?

  3. Sol_HSA

    Sol_HSA Guest

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

    John Fields Guest

  5. william

    william Guest

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

    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

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

  6. william

    william Guest

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

    -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

    -(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:
    <Wire chip1="2" pad1="0" chip2="15" pad2="1" />

    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 <wire>'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:

    <Chip ID="2" Name="LED (red)" xpos="411041792" ypos="486539264" />

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

    Sol_HSA Guest

    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
    shellexec(""); ? =)
    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.

  8. David Harmon

    David Harmon Guest

    On Tue, 29 Jan 2008 09:00:10 -0800 in sci.electronics.basics, John
    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
  9. John Larkin

    John Larkin Guest

    Then it won't be real-time.

  10. Sol_HSA

    Sol_HSA Guest

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

    Still available from =)

    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.
  11. Mr. Yantho

    Mr. Yantho Guest

    I've been looking to use this in a classroom setting to do some
    experimenting that might be a little too time consuming on an actual
    breadboard. Using it to explain flip-flops and digital counters
    should be good. Ive had a problem with trying to set up a 7 segment
    display using the 7447 chip. I match up the pinouts from the 7447
    (the pop-up labelling is slick) And the other inputs are on, except
    what would be ABCD. I can't get any type of numbers to show up. I've
    done this same experiment physically, so I'm a bit confounded. Any
    idea what I'm doing wrong? PS Love the prog.
  12. Damn, that looks good!
    Nice work.

  13. Sol_HSA

    Sol_HSA Guest

    Still available from
    The output from the 7447 requires "inverted" 7-seg parts, which is the
    most probable reason for problems. Load up the 7447.atanua from
    'tests' directory for a reference.

    P.s. OS X and Linux versions are now also available.
  14. Thanx for not assuming that Windows = the universe. I've seen a few
    other logic simulators for Linux, but they don't include the 74181, and I
    don't feel like stitching one together from individual gates. The CPU I
    want to design to serve as a target for Jack Crenshaw's 'Tiny' compiler
    will take long enough.
  15. lopes


    Oct 26, 2009
    7447 and Mac OsX Version


    I try to use a 7447 with an inverted 7 segments display, all the outpout of the 7447 are in red when I atempt to connect something, and when I put the cursor on the red line I got an error message.

    If I connect the an outpout of the 7447 to an inverted led I also got the same red line error.

    Is something to do to activate the 7447 device.

    Is it a bug of the Mac OsX version of atanua?

    Last edited: Oct 26, 2009
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day