Professional Documents
Culture Documents
Inrto Ewb Lab
Inrto Ewb Lab
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
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
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
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
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
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
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
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
EWB_Digital
Page 10 of 14
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
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
Truth Table
Boolean Expressions
Simplified Boolean
Expressions
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