Sie sind auf Seite 1von 5

Journal of the Technical University of Gabrovo, Vol.

37’2009 (-----)

WEB BASED INTERACTIVE DIGITAL LOGIC CIRCUIT SIMULATOR

Nenad Jovanović*, Suzana Marković, Zoran Jovanović


Business School of Professional Studies – Blace
Ranko Popović
Faculty of Informatics and Management, Singidunum University, Belgrade

Received …; accepted ….

Abstract - This paper describes a Web-based digital logic circuits simulator. System is realised in Java programming language and can be
executed as a standalone Java application or Java applet. Simulator can be used in educational purposes like an appendix of standard
learning methods or like a part of distance learning systems on Internet. System support composite model, i.e. it is possible to evolve
independence composition with arbitrary number of input and output, which is composed of basic digital logic elements, and use altogether.

Keywords: Modeling, simulation, distance learning, Java.

INTRODUCTION In this paper is being described the system for digital


logic circuit design and simulation [1]. We explore logic
Traditional educational system, which is mostly based circuit simulator features in detail, and we examine its use
on theoretical learning, doesn’t give good results in the in class assignments. Circuit simulator enables design and
aspect qualification of students for resolution practical analysis of logic circuits. User can build his circuits using
problems. Theoretical learning must be combined with an on-line logic circuit simulator.
practical experience, while laboratories represent ideal There are many simulators which are used in process of
place for upgrade theoretical knowledge with practical design and simulation in switch logic circuits. LogicSim [2]
skills. enables design and simulation of digital logic circuits using
Acceleration in development of technologies, and basic logic elements such as AND, OR, FlipFlop, etc.
possibilites of informatical age, intend to change playing SirSim [3] is a symbolic simulator on transistor level based
rules in education. Educational system should be adapted on procedures delay calculation. Inputs are logic variables
and be gave us new educational forms which will maintain instead constant 0 or 1. Silos [4] is logic simulator on basic
new students to use technological achievements in switch circuits level. He support IEEE standard format
educational process, without addition money expences, and delay. ModelSim [5] is system for verification and
they phisical absence will not be a disadvantage. debugging which simulates design on basic switch circuit
On this challenge, many educational institutions give level and on RTL level.
response with development of online educational programs.
When we have possibility for transfer of educational ARCHITECTURE OF SYSTEM
content over the Internet, it is necessary to give student an
online interaction with real or virtual equipment like System is defined in Java programming language. Basic
computers, routers, electronic circuits, lasers, microscopes classes in system are presented in figure 1.
etc. When we have online control of equipment, we create Entities in observed model are characterized by
an online laboratory. attributes. State of system is determined with a set of
Online laboratories is used in technical and attributes that define static characteristics of entity.
mathematical sciences, and on field of society science. Functionality for an entity is defined by functions that
In order to online labs would be adequate tool in process represent dynamically review of system.
of education, they must to realise three academic principles: Entity can be modeled in Java by object that is an
 Authenticity: Enable easy division of instance of class (Figure 2), which have to define all static
development tools attributes of that entity and to enable functional relation of
 Complex: Posibility of visualisation an that entity with the other entities.
complex process Base class in system is Entity [6][7][8]. UML notation
 Colaboration: Posibility of computer class Entity is shown in Figure 2. Class Entity models
communication structure properties of digital logic circuit entities (NOT,
AND, OR...) and enables establish function dependency.

*
Tel.:+381631045301; е-mail:jovanovic@vpskp.edu.rs
Paleta Sistem Konekcija Port Kompozicija

Editor
IN Entitet OUT

Port Entitet Svojstvo


NOT AND OR NAND NOR

Fig. 1.Basic classes in system

Attribute Type defines to whom the type of system Property


components entity belongs. The type can be “NOT”, - name : String
“AND”, “Connection”, “Port”... - value : String
Attribute nextType presents reference to the connected - nextProperty : Property
list of next entities of different types wherewith the given + Property()
entity is connected in progressive order. Attribute nextType + Property(String name,String value)
for last entity in the structure has null value. + setName(String name)
Attribute previousType presents the reference to the + getName(String name):String
connected list of previous entities of different types + setValue(String value)
wherewith the given entity is connected. Attribute + getValue(String value):String
previousType for first entity in structure has null value. + setNextProperty(Property next)
Attribute nextEntity presents reference to the connected + getNextProperty(Property next):Property
list of next entities same type wherewith given entity is Fig. 3. Class Property
connected in progressive order.
Attribute previousEntity presents reference to the A Ports present logical construction and they define all
connected list of previous entities same type wherewith the points of access between connection entity and functional
given entity is connected. entity.
Attribute port Property defines reference to a connected
Entity list whose elements determine port property. Port properties
# type : String are the name presented by port serial number, and I/O
# properties : Property property which determines whether it is output port or
# nextType : Entity input. If it is the output, than its attribute nextType presents
# previousType : Entity reference to the object Connection and priviousType
# nextEntity : Entity present reference to a functional object (for instance: AND).
# previousEntity : Entity If it is the input, than its attribute nextType presents
+ Entity() reference to the functional object, and previousType
+ Entity(String type) presents reference to the object Connection.
+ addProperty(String name, String value)
+ findProperty(String name) : String Entity activity modeling
+ changeProperty(String name, String value)
+ setNextType(Entity nextType) Active entity can be presented by objects which execute
+ setPreviousType(Entity previousType) as independently Java threads which can start and finish
+ setNextEntity(Entity nextEntity) some control activity. That object is active object. Active
+ setPreviousEntity(Entity previousEntity) object is like every object instance of some class, in this
Fig. 2. UML diagram of class Entity case active class. Active class is class which objects have
independence flow of control.
Attribute properties presents reference to the head of Digital logic circuit entity can be modeled by Java class
chained list whose elements define all characteristics of the Entity which defines all structure attributes of entities and
given entity. Static properties of entity are defined with its relations between other entities in the model.
attribute. Entity properties are presented with objects of Attributes and references of active entities can be
class Property (figure 3). presented by class Entity also. However, in order to present
The reference to the head of the list is preceded in the independent manage activities within active entity (e.g.
entity whose properties are defined by the list, and the logic operation AND in AND element), class Entity can be
attribute value of the objects which is referenced by modified so that support possibility of executing
attribute nextProperty of the last property is null. independent Java threads.

Listing 1. Class ActiveEntity


class ActiveEntity extends Entity implements Runnable {
// ...
Thread thread;
public ActiveEntity() {
// ...
thread = new Thread(this);
thread.start();
}
public void run(){
// Define behaviour of entity ActiveEntity
// ...
}
}

Modified class named ActiveEntity should has all Fig. 5. Control part
attributes of class Entity, but it should define others
possibilities. Following command buttons are available:
Class ActiveEntity has to be subclass of class Entity,  Connection; enable connection of basic logic elements
and since Java does not support concept of multi  Input; defines input values
inheritance, in order to embed facilities of executing  Output; defines output values
independent activities into class ActiveEntity, it has to  NOT element; enables insertion on white drawing area
implement interface Runnable (Listing 1.) logic element which simulate operation NOT logic
gate.
SIMULATOR CAPABILITY  OR element; enables insertion logic element which
simulate operation OR logic gate.
Visual simulator contains series control buttons. User  NOR element; enables insertion logic element which
can edit arbitrary switch circuit and control simulation simulate operation NOR logic gate.
process.  AND element; enables insertion logic element which
After starting the software system, one can use basic simulate operation AND logic gate.
system window (figure 4.). This window contains two parts.  NAND element; enables insertion logic element which
First part is palette of command buttons, and the second is simulate operation NAND logic gate.
white drawing area.  Half-adder; enables insertion logic element which
The three basic logic gates are the NOT gate, the AND simulate half-adder operation.
gate, and the OR gate. These are symbolized as in figures 4  Full-Adder; enables insertion logic element which
and 5. User can combine these basic gates as building simulate full-adder operation.
blocks for more complex circuits. User can build his  Composition; enables insertion on white drawing area
circuits using an on-line logic circuit simulator. User can composition with arbitrary number of input and output
open a new browser window and go to the page [1] to run afterward defined
the simulator. To use the simulator user can click and drag  Displacement component; this button enables
logic gates and other elements onto the page and connect operating mode of displacement element over drawing
them to form circuits. area.
 Delete; this button deletes all elements on drawing area
and set initially system state.
 Info; this button gives basic system information.
 Help; this button gives basic information about
working with system.

Desktop

Desktop serves for logic circuits drawing. Basic


information that you can execute on this area are: insertion
of new object, configuration connection between one
Fig. 4. Basic system window element output and input of the other element, set on
certainly input signal on logic 1, respectively 0, and object
Palette of command buttons displacement.
To use the simulator one can click and drag logic gates
Control part contains command buttons (figure 5.) and other elements onto the page and connect them to form
circuits (figure 6.).
Fig.6. Click and drag logic gates

To create a new circuit element, simply left click on the


element in the window on the upper side of the interface.
Hold down the mouse button and drag the element into the
white drawing area.
All inputs are initially set on value 0. One can right
click on the appropriate input to change input element state.
Connection drawing is optimized (figure 7 a.) Every
connection consists of four turning points so that
connection can be corrected when displacement element
(displacement button is active) (figure 7. b).

a. b.
Fig. 7. Connection drawing is optimized

SIMULATOR IMPLEMENTATION IN EDUCATION


PURPOSE: EXAMPLE

Consider the standard combinational module decoder


DC2/4 with two inputs and four outputs (figure 8).

Fig.8. Graphical symbol of decoder DC2/4

Principle of functioning decoder DC2/4 is:


D0 = x1x0E
D1 = x1x2E
D2 = x1x0E
D3 = x1x0E
Figure 9. Structural schema of decoder DC2/4
Structural schema of decoder DC2/4 resides in figure 9.
Realized decoder, as composite element, is described in
figure 10.
Fig.10. Realized decoder

CONCLUSIONS REFERENCES
In this paper, we have described digital logic circuits
simulator, which is realised in Java programming language. [1] A software demo:
System enables arbitrary switch circuit design using basic http://weblab.vpskp.edu.yu/osovi/logicsim/index.htm
logic circuits and simulation of designed module. [2] http://www.tetzl.de/java_logic_simulator.html
Environment is interactive, topologies are arbitrary, so that [3] (SirSim)C. B. McDonald and R.E. Bryant. Symbolic
it is possible to fabricate and execute many laboratory timing simulation using cluster scheduling. In
exercises. System enables students in introductory courses Proceedings of the 37th conference on Design
automation, 2000, pp. 254-259.
to design and simulate logic circuits. Simulator is Web-
[4] Silos User’s Manual Version 2002.1. By Simucad Inc.,
based and can be used as a part of distance learning system 2002.0
or electronic classroom. [5] ModelSim SE, PSL Assertions Guide. Version 5. 8 Beta.
By Model Technology, August 2003.
[6] N.Jovanović, R.Popović, Z.Jovanović, Defining a
General Object Model of Distributed Systems Entities in
Java, Facta Univ. Ser.: Elec. Energ., vol. 16, No. 2,
August 2003, pp. 185-194
[7] N.Jovanović, R.Popović, Z.Jovanović, Modeling
Synchronous Comunication in Java, JOURNAL of the
Technical University of Gabrovo, vol.28, 2003, pp. 77-
81.
[8] N.Jovanović, R.Popović, Z.Jovanović, Modeling
Distributed System Entities Which Comunicate
Asynchronous via Message Passing in Java, Neural,
Parallel & Scientific Computations, Atlanta, vol. 13,
2005, pp.63-76.

Das könnte Ihnen auch gefallen