You are on page 1of 14

Electronics Workbench - Digital

1. Start EWB by double-click the EWB shortcut icon,


, if it is available on your
Microsoft Windows desktop or from the Programs group in the Start menu. The main
screen is as shown in the picture below.

2. You then want to assign a name to your file:


Choose File > Save As, type or2.EWB under the File name box to save the new
breadboard/workspace as or2.ewb. Press OK. The filename will then appear in the
upper left hand corner of the workspace. See the picture below.

Filename

Breadboard/Workspace

3. Click on the Logic Gates Parts Bin, then click on the 2-Input OR Gate symbol and
drag it out onto the workspace.

EWB_Digital

Page 1 of 14

Logic Gates Parts Bin

2-Input OR Gate

Tip: To change the number of inputs for a gate, just double-click on the gate to open the
Gate Properties dialog box (see picture below). Notice that you can increase the
number of inputs to a maximum of 8 for the 2-input OR gate.

4. Now label the gate by double-click on the logic gate symbol. Lets name it as OR2 by
typing the name in the Label box as shown below.

The name will then appear on top of the gate. (Tip: When dealing with a more complex
circuit, labeling components help clarify your circuit.)

EWB_Digital

Page 2 of 14

Tip: To get help on this 2-input OR gate or any component and test instrument, just click
on it using the left mouse button and choose Help. The following picture shows the help
menu for a 2-input OR gate.

5. For the inputs (power supply), you can choose from the following options:
a)
Use a BATTERY (DC voltage source) with a Gound.
b)
Use a +Vcc Voltage Source with a Gound.

Ground

EWB_Digital

Battery

Vcc

Page 3 of 14

Using a BATTERY (DC voltage source) with a Gound as Power Supply


If you are using a Battery and a Gound, then connect your circuit as shown in the
picture below. To reflect the nature of digital circuit, change the voltage of the Battery to
5V from 12V.

Using a +Vcc Voltage Source as Power Supply


If you are using a +Vcc Voltage Source, then you should connect the circuit as shown
in the picture below. The +Vcc Voltage Source holds a +5 volts that corresponding to a
binary "1" or logical TRUE.

6. To visualize the output values (simulation results), drag a Red Probe onto the workspace
from the Indicators Parts Bin. Rotate the Red Probe to the way you want it (Right
click on the gate > Rotate). (Note: The numbers of Red Probe you need is equal to
the number of outputs your circuit has.)

EWB_Digital

Page 4 of 14

Red Probe

Now connect the Red Probe as shown in the picture below.

Activate
Simulation

7. To simulate your circuit, just TURN ON the electronic bound power switch by clicking on
the Activate Simulation switch located at the upper right hand corner.
8. You should see the Red Probe turn red indicating a logic 1 or HIGH when both inputs
A and B are HIGH. Now you can fill the truth table of a 2-input OR gate as follow:
INPUTS
A
B
0
0
0
1
1
0
1
1

OUTPUT
F
?
?
?
1

Troubleshooting: Notice that the circuit we built can only simulate 1 out of 4-possibleinput arrangement, so we have a problem. To fix the problem, you need to add 2 simple
switches so that you can select which input to turn ON. (Note: The number of switches
you need is equal to the total number of inputs your circuit has).
9. To add switches to your circuit, drag a Switch from the Basic Parts Bin. Repeat the
process for the 2nd switch.

EWB_Digital

Page 5 of 14

Switch

Now connect the switches as shown in the picture below:

The [Space] labeled on the 2 switches indicates that you can toggle the switches
ON/OFF by pressing the spacebar on the keyboard. Try it to see it yourself.
Remember that the Activate Simulation switch has to be turned on in order to see
any result.
Now, you should be able to fill up the truth table as follow:
INPUTS
A
B
0
0
0
1
1
0
1
1

OUTPUT
F
0
?
?
1

Troubleshooting: Well, we still have a problem. The problem is that we cannot obtain
the outputs of the remaining 2-possible-input arrangement because every time we press
the spacebar on the keyboard, the switches close or open at the same time. To solve this
problem, double-click one switch at a time, rename the Key in the Value tab of the
Switch Properties dialog box from [Space] to [A] and [B] accordingly.

EWB_Digital

Page 6 of 14

Note that you will need to specify the key that controls the switch by entering its name,
provided that the name is available on the keyboard, in the Value tab of the Switch
Properties dialog box as shown in the picture below.

If you want the switch to close or open when the ENTER key is pressed, rename the Key
to ENTER in the Value tab. The following table provides some examples:
To use this key on the keyboard:
ENTER
Letter A
Letter Z
Number 1
Number 9

Rename the Key in the Value tab to this:


ENTER
A
Z
1
9

You will get an error prompt from EWB if you have entered an invalid key.
10. After the changes, your final circuit should look as shown below:

11. Simulate the circuit for all possible input combinations shown in the truth table.

EWB_Digital

Page 7 of 14

This time your simulation results should have shown that any combination other than two
low inputs resulted in a high output. The final truth table for 2-input OR gate simulated
using EWB is displayed below:
INPUTS
A
0
0
1
1

B
0
1
0
1

OUTPUT
F
0
1
1
1

This simple example demonstrated that you could build and test the output of a digital
logic circuit using EWB without requiring a single physical component.
If you want to work on a new circuit, you can choose File > New. If you want to quit,
you can close your file by exiting EWB (choose File > Exit).

EWB_Digital

Page 8 of 14

Using the Logic Converter


Much of the work we have gone through in the previous example can be done quickly and easily
using a tool called the Logic Converter from the Instrument Bin. With the Logic Converter,
you have the ability to carry out several conversions of a logic circuit representation:
1.
2.
3.
4.
5.
6.

Logic Circuit Truth Table


Truth Table Boolean Expression
Truth Table Simplified Boolean Expression
Boolean Expression Truth Table
Boolean Expression Logic Circuit
Boolean Expression NAND-gate only logic circuit

You can connect it to a digital circuit to derive the truth table or Boolean expression the circuit
represents. You can also use it to produce a logic circuit from a truth table or Boolean
expression.
To open the Logic Converter, click on the Instrument Bin as shown below. The Logic
Converter is the first instrument to the right, just click and drag it to the workspace.

Instrument Bin
Logic Converter

The picture below shows the Logic Converter that you have placed in your workspace. The
little circles on the top are the inputs and output terminals. There are 8 input terminals and 1
output terminal available for use. That means if you want to use the Logic Converter to carry
out the conversions, an individual circuit is limited to 8 inputs and 1 output.
1 Output Terminal

Logic Converter icon:


8 Input Terminals

Note that the Logic Converter limits your circuit to 8 inputs and 1 output.
To use the Logic Converter, double-click on the Logic Converter icon. Your workspace should
now look like the picture below:

EWB_Digital

Page 9 of 14

Notice that the 8 input terminals are labeled as A to H with A as the Most Significant Bit (MSB),
and the output terminal is labeled as Out.
8 Input Terminals (A to H)

1 Output Terminal

Boolean expression goes here

EWB_Digital

Page 10 of 14

The converting options available in the Logic Converter are as follows:


Descriptions:
Convert Logic Circuit to Truth Table
Convert Truth Table to Boolean Expression
Convert Truth Table to Simplified Boolean Expression
Convert Boolean Expression to Truth Table
Convert Boolean Expression to Logic Circuit
Convert Boolean Expression to NAND-gate only logic
circuit
Now that you have some basic knowledge about the Logic Converter, lets look at some
examples.
To derive a truth table and Boolean expression from a logic circuit using the logic
converter
1. Construct the circuit by drawing the components from the gate library.

2.

Connect the inputs of your circuit to the input terminals on the logic converter and
single output of the circuit to the output terminal on the logic circuit as shown in the figure
below.

EWB_Digital

Page 11 of 14

3. Click the logic circuit truth table


get the truth table for the logic circuit in the logic converter.

button. You should

The truth table shown that the given circuit is that of 2-input AND gate. To convert to
Boolean expression and Simplified Boolean expression please refer to Table 1.

EWB_Digital

Page 12 of 14

The following table summarized all possible scenarios that you may encounter:
Table 1: Quick guide to converting a digital circuit using the Logic Converter

If you have this:

If you want this:

Truth Table

Boolean Expressions

Click the option(s) in


sequence:

Simplified Boolean
Expressions
Logic Circuit

NAND-gate only logic circuit

Boolean
Expressions

Truth Table

Logic Circuit
NAND-gate only logic circuit
Simplified Boolean
Expressions

Logic Circuit

Truth Table
Boolean Expressions

Simplified Boolean
Expressions

EWB_Digital

Page 13 of 14

EWB_Digital

Page 14 of 14

You might also like