Re: creating a simple digital logic circuit simulator



pete_abel@xxxxxxxxxxx wrote:
: Hi,

: Im in the process of writing a simple digital logic circuit simulator
: application (similar to B2Logic).

What a novel idea! But, ummm, why not contribute to an existing
project such as TkGate:

http://www.tkgate.org/index.html

Or do a quick search on OpenCollector to see what other logic
simulators are already out there:

http://www.opencollector.org/

Why re-invent the wheel, unless you think the world needs yet another
independent logic simulator?

: What would be the best approach or
: design for a project like that?

Extend an existing project.

: I mean should I use the object-oriented
: design: making gates as classes, and if so, should I make ALL gates as
: classes or should it be just the BASIC gates (AND, NOT, OR) and build
: all other components (XOR, NOR, NAND, FULLADDER, etc.) as C-style
: FUNCTIONS that use those basic classes?

Welcome to software engineering 101. This is your first homework
question.

: I guess my questions should be: Whats the most common design in
: commercial applications (e.g. B2Logic)? Is it pure, C-Style code, or is
: it OOD? And how is it generally done (details are highly
: appreciated)???

I believe that it depends upon when the commercial simulators were
written. Older programs tend be be C [1], whereas newer programs tend
to be C++ or Java since the OO discipline is a relatively recent
thing.

Personally, I would avoid C++ and Java altogether and do it in
Python. C++ has all kinds of cross-platform quirks and has also
inherited C's inherent memory bug pitfalls. Java is a cleaner
language, but if you use it you are chained to a Java VM (unless you
can get the GNU Java compiler to work). Python is an OO language
with clean syntax and it handles garbage collection for you, so you
don't have to worry about memory bugs.

But first I would look to see if a suitable logic simulator already
exists, and then just add to it.

Stuart

[1] Really old stuff is written in Fortran. Real men don't need
any foofy object oriented nonsense!
.



Relevant Pages

  • Re: robot gui approach
    ... I wrote a robot simulator in Java. ... particularly the simulator task queue. ... This makes it a nice OO design, but harder to control from an animation ...
    (comp.lang.java.programmer)
  • Wie kann ich dem Garbage Collector auf die =?iso-8859-1?q?Spr=FCnge?= helfen?
    ... Im Rahmen meiner Bachelorarbeit benutze ich einen in Java programmierten ... also mir - nur noch die verschiedenen Peers implementiert werden. ... Um mal eine Zahl in den Raum zu stellen: Während einer Simulation von ca. ... Starten des Simulators mit java -Simulator. ...
    (de.comp.lang.java)
  • Re: Java code generation from sql
    ... I am working on a simulator in Java. ... simulator are stored in a SQL databse. ... database. ...
    (comp.lang.java.databases)
  • Java code generation from sql
    ... I am working on a simulator in Java. ... simulator are stored in a SQL databse. ... database. ...
    (comp.lang.java.databases)
  • Re: Charles Murray "The Plan" ends poverty
    ... I was more concerned about the synchronization of the data path and the control portion that in the original PDPs were separated and had a special circuit to synchronize them at after reset and power up. ... We probably should have simulated the design in an environment with some code, but if we had tried to do that at that time, we would have never completed the project. ... For the first decade of my career I was building special purpose machines -- very high performance, highly parallel machines used primarily to attack foreign cyphers. ... One thing that I didn't mention about Dan Dobberpuhl was that he developed a circuit simulator while a 2nd Lt on duty at NSA in the late '60s. ...
    (soc.retirement)