SlideShare a Scribd company logo
1 of 25
© Dmitriy Shironosov/ShutterStock, Inc.
LABORATORY
Logic Circuits
6
■■
Experiment■with■digital■logic■circuits■using■a■simple■logic
■gate■simulator.
■Software■needed:
■ 1)■
LogicGates■app■from■the■Lab■Manual■website■(Logic■Gate
s.jar)■
OBJECTIVE
REFERENCES
© Jones & Bartlett Learning, LLC
NOT FOR SALE OR DISTRIBUTION
Logic Circuits | 43
BACKGROUND
Review these topics from your textbook, lecture notes, or online
resources:
■ Logic gates: AND, OR, NOT, XOR, NAND, NOR
■ Truth tables, combinational circuits, gate processing, 1-bit
full adders, multiplexers
ACTIVITY
Digital logic circuits are the bedrock of computer design. CPU
chips from companies like
Intel and AMD are silicon wafers in which millions of circuits
are embedded. Everything
your computer does depends upon them.
In this lab, we will learn how to use the LogicGates app to draw
and test digital logic
circuits. Chip manufacturers, such as Intel and AMD, use
sophisticated (and extremely
expensive) software to help them design and test their chips.
But the basic idea of what
we will be doing is the same.
First, start the LogicGates app. You can load a number of
examples by pulling down
the example choice pull-down menu. Load the example labeled
1 simple, as shown here:
Each logic gate has a distinctive shape. The wire coming out of
the gate shows its
current value. Gates are oriented so that their inputs come in
from the left side and their
outputs go out from the right side. This design cannot be
changed; nor can the gates be
rotated in this app.
Two special boxes exist for input and output. The switch box
has a lever in it along
with 1 or 0. To flip the lever and change the value, click on the
number right in the
center. The other box has only 1 or 0 in it. This is the output
box, which accepts a wire
from a gate and displays its value.
To propagate new values through the circuit, click on the Run
button. It changes
to say Stop, so that when you click on it again, the simulator
stops running. When the
circuit is running, you can click on the switches and watch
values change throughout
the circuit.
© Jones & Bartlett Learning, LLC
NOT FOR SALE OR DISTRIBUTION
44 | Laboratory 6
To practice using the simulator, we’ll build the logic circuit
encoding the Boolean
expression (AB) OR (AC), which will require three total
switches and three total gates
connected sequentially. First, if your simple example circuit is
still running, click the
Stop button. Now, clear the screen by clicking the Clear button.
To build the circuit,
you’ll need to add three switches, two AND gates, one OR gate,
and one output box. To
create them, click on the New button, pull down the gate menu,
and select the gate or
other item you want. Then click once where you want the
switch, gate, or output box to
sit. You can reposition gates, switches, and outputs by dragging
them to a new location.
Notice that when you are adding gates, the New button changes
to say *New. Most
of the buttons in this app work like this: They show they are
still active by displaying an
asterisk in front of the label on the button. Because the button
stays active, you can click
on different gates without having to reclick the New button over
and over.
Click on the New button again to stop adding components. The
asterisk will go away.
Let’s also attach labels to the boxes. However, in the logic gate
simulator, labels
attach to boxes, not wires, as you may see in textbooks or other
diagrams.
First, click on the Label button, which allows us to label gates
and switches. Then
click on the top switch. A text field opens up right above the
switch. Type the letter “A”
into it and press Return.
Here’s what you should see:
© Jones & Bartlett Learning, LLC
NOT FOR SALE OR DISTRIBUTION
Logic Circuits | 45
Label the middle switch as “B” and the bottom switch as “C.”
Also label the
output “X.” If you want to be thorough, label the top AND gate
as “D” and the bottom
AND gate as “E.” When done labeling, click on the Label
button so that the asterisk
doesn’t appear.
Now it’s time to connect the gates, so click on the Connect
button. Click once on
switch A. A red line flashes into view, anchored in the center of
the switch and following
the mouse pointer around the screen. Click on the top AND
gate. Repeat this process and
connect all the boxes so they match the screenshot below. If you
make a mistake, click
on the Disconnect button, then click on a gate. All lines
between that gate and all other
components will be removed.
A gate’s output may have any number of wires coming out of it
so that it connects
to more than one other gate. Merely select the same gate as the
left end of a wire more
than once.
Automatic elbows break lines up into horizontal and vertical
segments. To see a
version that uses diagonal lines, click on the Stepped button.
However, in most circuit
fabrication technologies, all wires must lie on a grid, so
diagonal wires are either
impossible or expensive. To see the elbowed lines again, click
on the bottom button,
which has changed from Stepped to Diagonal.
Sometimes the elbows make it hard to see overlapped wires, and
that plagues this
circuit; move the bottom AND gate a little to the left until the
wires show more clearly.
Here’s the final picture:
Now run the circuit by clicking the Run button. Click on the
switches to change
their values. Record the results in a truth table.
Imagine what a terrible thing it would be if a major chip
manufacturer’s simulation
software didn’t give the right values and they sent a chip into
production with flaws in
it. Well, actually, don’t bother imagining: It’s already
happened! In the early 1990s, Intel
recalled its new Pentium processor when scientists and
engineers pointed out that in
certain calculations the chip gave the wrong answer! Analysts
have estimated that this
bug in the chip’s division algorithm cost the company about
$500 million. (Too bad they
weren’t using our simulator to check their circuit design!)
© Jones & Bartlett Learning, LLC
NOT FOR SALE OR DISTRIBUTION
46 | Laboratory 6
Our simulator provides you with six types of gates: AND, OR,
NOT, NAND, NOR, and
XOR. All of these are defined in most textbooks and many
online references. Another type
of “gate” available in our circuit simulation is the truth table,
which allows you to avoid
building really complicated circuits with lots of gates. Instead,
you fill in the truth table
values and the simulator treats it as a gate. A truth table “gate”
can have two, three, or
more inputs.
Let’s build a circuit using truth tables. Clear the screen and add
three new switches
and one output.
The trickiest part is putting the correctly-sized truth table into
the circuit. To do
this, make sure the New button is activated (has an asterisk next
to *New). Then pull
down on the Gates menu and bring Truthtable into view. In the
yellow message box,
LogicGates will ask you how many inputs your truth table
should have. The default is
2, but since we have 3 switches, replace the 2 with 3. Then click
once in the middle of
the area to create the truth table. Click off the New button and
connect these gates as
shown below:
Important note! Make sure that when you connect the switches,
you connect the top
one first, then the middle one, and finally the bottom one. Using
the proper sequence is
necessary because the order of the incoming wires determines
which value is associated
with which column in the truth table. The first wire connected
will correspond to the
first column in the table, the second wire will correspond to the
second column, and so
on. If you connect them in a different order, the wires going
into the truth table will not
correspond to the columns of your truth table.
New truth tables list all the input values in canonical order, but
since the output is
shown as always 0, we need to edit the truth table so it
implements our desired output.
To edit a truth table, click once on it (after making sure that all
the buttons on the left
are off [i.e., do not have asterisks in front of their names]). This
makes the truth table
the top gate, and its border will turn red. Now click on EditTT.
A green window pops up,
allowing you to edit this truth table.
© Jones & Bartlett Learning, LLC
NOT FOR SALE OR DISTRIBUTION
Logic Circuits | 47
The input values are separated from the output value by a
vertical bar symbol, (|).
Go through the truth table and change some of the output
values, as shown in the
picture below.
Once you are done, click OK to dismiss the truth table editing
window, and then click on
Refresh or just drag the truth table around so that the simulator
will repaint the screen.
Run the simulator and play with the switches, comparing the
value in the output box
to what you see in the truth table. Do they match?
Since the truth table “gate” bypasses digital logic gates
altogether and implements
the given truth table, it might seem like using it is cheating!
Actually, the truth table
is similar to something called an SSI chip. Sometimes we are
more interested in the
function that the circuit computes (the pairing up of inputs and
outputs) than in exactly
which gates are needed to implement that function.
By the way, if there are only two inputs to the truth table, there
will be two columns
and four rows. If there are three inputs, there will be three
columns and eight rows, as
shown in the example. Four inputs would require four columns
and 16 rows, and five
inputs would require five columns and 32 rows. Do you see a
pattern?
The input values in all the truth tables you see in this lab are
shown in canonical
(standard) order, which is the professional convention. This
isn’t necessary for the
simulator to work properly, but canonical order helps us
fallible, distracted humans keep
track of our inputs and outputs.
TIP
LogicGates can load and save your programs. It saves the data
in a plain text
file format.
© Jones & Bartlett Learning, LLC
NOT FOR SALE OR DISTRIBUTION
60 | Laboratory 6
DEEPER INVESTIGATION
The LogicGates app can create some very complicated circuits.
Its main limitation is due to
the finite amount of space available—if you have very many
gates, you’ll eventually run out
of room. However, judicious use of the truth table box can cut
down on screen clutter.
Example 5 of the sample circuits in the app is a model of a
circuit called an S-R latch,
also known as a “memory latch.” Try running it. When it starts,
the output boxes will
cycle between 0 and 1. To stop that, click on one of the
switches so that it reads 1. Now
the circuit is stable. Experiment with it by setting one of the
inputs to 1, then changing it
back to 0, and watch the outputs change.
S-R latches are 1-bit memories built out of logic gates. Real
computer chips use
something like them in the main CPU for registers and other
small, high-speed storage.
Because the S-R latch has some serious timing problems,
variants of it such as the clocked
D-latch are used instead, as are even more complicated circuits
called “flip-flops.”
S-R latches are circuits that have a peculiar characteristic about
their wiring. Can
you tell what it is? If not, pretend that the top switch pours a
blue-colored liquid through
the wires and the bottom switch pours a red-colored liquid.
Trace the liquids with colored
pens. What do you notice? What would you call this
characteristic of S-R latch circuits?
Your teacher might be able to give you a hint.
Because of this characteristic, circuits like the S-R latch are
called “sequential
circuits.” The output of sequential circuits depends not just on
the current inputs, but
also on the previous values on all the wires. They give a
different sequence of results
over time. Straight-through circuits like the others in this lab
are called “combinational
circuits” because their outputs depend only on the combination
of their input values.
Try to find out more about logic circuits. Look in some
hardware books for an
example of a flip-flop circuit. Try tracing its workings.
© Jones & Bartlett Learning, LLC
NOT FOR SALE OR DISTRIBUTION
CS1150 Introduction to Computer Science
Lab #4 – Logic Gates and Circuits, 40 points
Objective:
To experiment with digital logic circuits using a simple logic
simulator.
Instructions:
Make sure to do the Activity as outlined in the LabCH06.pdf
file. The activity is actually a tutorial that will help you to
solve the problems in the exercises. It is expected that you will
complete the Activity before you begin the exercises.
When you are finished, save and rename the completed
document as “firstname_lastname_lab4.docx”. Then, submit
the saved document to Pilot.
Exercise 1: (10 points)
1) Start the "LogicGates" applet, and add
· Two (2) switch(inputs)elements,
· One (1) AND gate elements,
· One(1) NOT gate elements,
· One (1) output element.
Arrange them like so:
· with the two (2) switches feeding into the AND
· with the output of the AND going to the NOT
· with the NOT's output going to the output element.
Take one screenshot of your circuit. Submit it with the rest of
your work.
Put the screenshot of your completed circuit below this line.
2)
Press the Run button and try out all four combinations of inputs
for the switches, recording the results in your word document,
formatted as a truth table.
Construct your truth table for the above circuit below:
Exercise 2: (10 points)
1) Start the "LogicGates" applet and add
· Four (4) switch(inputs) elements,
· Three (2) OR gates,
· One (1) AND gate and
· One (1) output elements.
Arrange them so
· two switches feed into one OR
· while the other two switches feed into the other OR gate.
· Then the two outputs of these OR gates feed into the AND
gate….
· And the output of that AND gate goes to the output element.
Take one screenshot of your circuit. Submit it with the rest of
your work.
2) How many combinations of switch values can you have with
four switches? How did you get this number?
Write your answer here:
3) Press the Run button and try out all combinations of inputs
for the switches, recording the results in a truth table in your
word document.
Put your Truth Table below this line. Remember: Don’t record
the combinations randomly, count up from zero!
Exercise 3: (10 points)
1) Start the "LogicGates" applet and add
· Four (4) switch(inputs) elements,
· Three (2) XOR gates,
· One (1) NAND gate and
· One (1) output elements.
Arrange them so
· two switches feed into one XOR
· while the other two switches feed into the other XOR gate.
· Then the two outputs of these XOR gates feed into the NAND
gate….
· And the output of that NAND gate goes to the output element.
Take one screenshot of your circuit. Submit it with the rest of
your work.
2) How many combinations of switch values can you have with
four switches? How did you get this number?
Write your answer here:
3) Press the Run button and try out all combinations of inputs
for the switches, recording the results in a truth table in your
word document.
Put your Truth Table below this line. Remember: Don’t record
the combinations randomly, count up from zero!
Exercise 4: (10 points)
Now we will do an exercise with custom logic gates.
Every logic gate’s behavior can be entirely described using its
truth table. To put it another way, if you want a special, custom
logic gate, you need to simply write down what its response is
for every possible input combination. The applet you are using
allows you to put “Truth Tables” (custom logic gates) in your
circuit, then edit them to achieve whatever logic gate behavior
you wish.
We will use our truth table gates to implement one-bit binary
addition. One gate will output the “SUM” part of the addition,
the other one will output the “CARRY-OUT” part
1) Start the “LogicGates” applet. Build a circuit with:
· three (3) switch elements,
· two (2) custom logic gates (the applet calls these “Truth
Tables”),
· and two (2) output elements.
Example 4 from the pull-down examples sets up some of this.
Choose example 4 and add to it.
2) Connect all switches to both truth tables, then connect each
custom gate to one output.
3) Label your inputs A, B, and C.
4) Label one custom gate “SUM”, and the other “CARRY-OUT”
5) Adjust the two custom gates so that one implements SUM
and the other implements CARRY-OUT (see next page)
TIP: Click “Edit TT” with the custom gate selected, then add
rows and columns as necessary. It’s easiest to do this in a text
editor like notepad++, then copy and paste to the applet.
See the next page for a pair of truth tables you can copy.
Here is the truth table for the SUM gate. Edit your custom gate
to match.
A
B
C
SUM
0
0
0
0
0
0
1
1
0
1
0
1
0
1
1
0
1
0
0
1
1
0
1
0
1
1
0
0
1
1
1
1
Here is the truth table for the CARRY-OUT gate. Edit your
custom gate to match.
A
B
C
CARRY-OUT
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
1
1
0
0
0
1
0
1
1
1
1
0
1
1
1
1
1
See the next page for a picture of how it is all supposed to look.
This is what it should look like.
6) Test your circuit, and make sure it gives you the correct
results for binary addition.
7) Take a screenshot of your program after you run it on one of
the combinations of the three (3) inputs. Submit the screenshot
with the rest of your work.
Place the screenshot of your one-bit binary adder below this
line:
Rubric (40 pts possible):
Exercise
Points
1
Question 1
5
Question 2
5
2
Question 1
4
Question 2
2
Question 3
4
3
Question 1
4
Question 2
2
Question 3
4
4
Question 1
2
Question 2
1
Question 3
1
Question 4
1
Question 5
2
Question 6
2
Question 7
1
Total
40
Lab4_Applets/Logic Gates.jar
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Created-By: 1.6.0_38 (Sun Microsystems Inc.)
Main-class: Main
EditWindow$1.classsynchronizedclass EditWindow$1 extends
java.awt.event.WindowAdapter {
void EditWindow$1(EditWindow);
public void windowClosing(java.awt.event.WindowEvent);
}
EditWindow.classpublicsynchronizedclass EditWindow extends
java.awt.Frame implements java.awt.event.ActionListener {
java.awt.Button okB;
java.awt.Button cancelB;
java.awt.TextArea ta;
Gate g;
public void EditWindow(Gate);
public void actionPerformed(java.awt.event.ActionEvent);
}
Gate.classpublicsynchronizedclass Gate {
int id;
String type;
String label;
int x;
int y;
int height;
int width;
java.util.Vector inputgates;
String connectionList;
int currentValue;
int newValue;
String truthtable;
static int nextid;
int[] inputvals;
LogicGates parent;
static int[] midpoints;
static int nummidpoints;
public void Gate(LogicGates, String, int, int, int);
public void Gate(LogicGates, String, int, int);
private String makeTruthTable(int);
private String decToBinary(int, int);
public void setLabel(String);
public int getValue();
public void flipValue();
public void compute();
public int matchTruthTable();
public void paint(java.awt.Graphics, boolean);
public void drawOR(java.awt.Graphics, int, int, boolean);
public void drawAND(java.awt.Graphics, int, int, boolean);
public void drawNOT(java.awt.Graphics, int, int);
public void drawXOR(java.awt.Graphics, int, int);
public void drawSWITCH(java.awt.Graphics, int, int);
public void drawOUTPUT(java.awt.Graphics, int, int);
public void drawTRUTHTABLE(java.awt.Graphics, int, int);
public void drawCONNECTOR(java.awt.Graphics, int, int);
publicstatic void resetMidpoints();
private void drawLines(java.awt.Graphics);
public void drawComplexLine(java.awt.Graphics, Gate, int,
int, int, int);
public boolean withinCenter(int, int);
public boolean within(int, int);
public void connect(Gate);
public String toString();
publicstatic Gate parseString(LogicGates, String);
static void <clinit>();
}
LogicGates$1.classsynchronizedclass LogicGates$1 extends
java.awt.event.WindowAdapter {
void LogicGates$1(LogicGates);
public void windowClosing(java.awt.event.WindowEvent);
}
LogicGates$2.classsynchronizedclass LogicGates$2 extends
Thread {
void LogicGates$2(LogicGates);
public void run();
}
LogicGates.classpublicsynchronizedclass LogicGates extends
java.awt.Frame implements java.awt.event.ActionListener,
java.awt.event.ComponentListener, java.awt.event.ItemListener,
java.awt.event.MouseListener,
java.awt.event.MouseMotionListener {
java.awt.Button runB;
java.awt.Button newB;
java.awt.Button labelB;
java.awt.Button delB;
java.awt.Button conB;
java.awt.Button disconB;
java.awt.Button clearB;
java.awt.Button editB;
java.awt.Button refreshB;
java.awt.Button loadB;
java.awt.Button saveB;
java.awt.Button lineStyleB;
java.awt.Choice gatesCH;
java.awt.Choice exampleCH;
java.awt.TextField msgTF;
java.awt.TextField tempInputField;
java.awt.Image buffer;
java.awt.Graphics gg;
java.awt.Color acolor;
java.util.Vector gates;
boolean running;
boolean newing;
boolean dragging;
boolean deleting;
boolean connecting;
boolean connecting_2;
boolean disconnecting;
public boolean diagonal;
boolean labeling;
int startx;
int starty;
int endx;
int endy;
int distX;
int distY;
int runtoggle;
Gate topgate;
public void LogicGates();
public void actionPerformed(java.awt.event.ActionEvent);
private void clearAllAsterisks();
public void
componentResized(java.awt.event.ComponentEvent);
public void
componentHidden(java.awt.event.ComponentEvent);
public void
componentMoved(java.awt.event.ComponentEvent);
public void
componentShown(java.awt.event.ComponentEvent);
public void itemStateChanged(java.awt.event.ItemEvent);
public void paint(java.awt.Graphics);
public void update(java.awt.Graphics);
public void mouseEntered(java.awt.event.MouseEvent);
public void mouseExited(java.awt.event.MouseEvent);
public void mousePressed(java.awt.event.MouseEvent);
public void mouseReleased(java.awt.event.MouseEvent);
public void mouseClicked(java.awt.event.MouseEvent);
public void doubleClick(java.awt.event.MouseEvent);
public void singleClick(java.awt.event.MouseEvent);
public void breakConnections(Gate);
public void mouseMoved(java.awt.event.MouseEvent);
public void mouseDragged(java.awt.event.MouseEvent);
public Gate findConnected(Gate);
public boolean verify();
public void run();
public void loadExample(int);
public void loadCircuit();
public void saveCircuit();
private void reconnect(Gate, String);
public Gate findID(int);
private void backDoorControl();
private void showGatePositions();
}
Main.classpublicsynchronizedclass Main {
public void Main();
publicstatic void main(String[]);
}
Popup$1.classsynchronizedclass Popup$1 extends
java.awt.event.WindowAdapter {
void Popup$1(Popup);
public void windowClosing(java.awt.event.WindowEvent);
}
Popup.classsynchronizedclass Popup extends java.awt.Frame {
java.awt.TextArea ta;
public void Popup(String);
public void Popup(String, java.awt.Color);
public void Popup(String, int, int);
public void Popup(String, int, int, java.awt.Color);
public void Popup(String, int, int, int, int, java.awt.Color);
public void add(String);
public void setFont(java.awt.Font);
}
U.classpublicsynchronizedclass U {
public void U();
publicstatic int atoi(String);
publicstatic long atol(String);
publicstatic double atod(String);
publicstatic String[] copy(String[]);
publicstatic String[] tokenize(String);
publicstatic String[] tokenize(String, String);
publicstatic String detokenize(String[]);
publicstatic boolean equals(String[], String[]);
publicstatic void sleep(long);
publicstatic int power(int, int);
publicstatic String convert(int, int);
publicstatic boolean isint(String);
publicstatic String dec2bin(int);
publicstatic int bin2dec(String);
publicstatic String twoscomplement(String);
publicstatic String padout(String, char, int);
publicstatic String squish(String, char);
publicstatic java.awt.Color translateColor(String);
publicstatic String replaceChar(String, char, char);
publicstatic String getField(String, int);
publicstatic String getField(String, int, char);
publicstatic String skipFields(String, int);
publicstatic void main(String[]);
}
© Dmitriy ShironosovShutterStock, Inc.LABORATORYLogic C.docx

More Related Content

Similar to © Dmitriy ShironosovShutterStock, Inc.LABORATORYLogic C.docx

Logisim tutorial
Logisim tutorialLogisim tutorial
Logisim tutorialTâm Tâm
 
Express pcb tutorial
Express pcb tutorialExpress pcb tutorial
Express pcb tutorialawazapki
 
Practica 4 algebra booleana por compuertas lógicas.
Practica 4 algebra booleana por compuertas lógicas.Practica 4 algebra booleana por compuertas lógicas.
Practica 4 algebra booleana por compuertas lógicas.JavierDeJesusCamacho1
 
Lab 7 multisim software tutorial
Lab 7 multisim software tutorialLab 7 multisim software tutorial
Lab 7 multisim software tutorialSyed Umar
 
Magazine awr-ims-3
Magazine awr-ims-3Magazine awr-ims-3
Magazine awr-ims-3Sam Sambala
 
OCR GCSE Computing - Binary logic and Truth Tables
OCR GCSE Computing - Binary logic and Truth TablesOCR GCSE Computing - Binary logic and Truth Tables
OCR GCSE Computing - Binary logic and Truth Tablesnorthernkiwi
 
Electronic Workbench - R.D.Sivakumar
Electronic Workbench - R.D.SivakumarElectronic Workbench - R.D.Sivakumar
Electronic Workbench - R.D.SivakumarSivakumar R D .
 
Calculator scientific
Calculator scientificCalculator scientific
Calculator scientificAnil Sharma
 
Computer hardware troubleshooting
Computer hardware troubleshootingComputer hardware troubleshooting
Computer hardware troubleshootingthehackerconcept .
 
This assignment is using Logism to create circuits. I have been tryi.pdf
This assignment is using Logism to create circuits. I have been tryi.pdfThis assignment is using Logism to create circuits. I have been tryi.pdf
This assignment is using Logism to create circuits. I have been tryi.pdfambikacomputer4301
 
Power Systems Fundamentals - EE3500 - Lab 1.pptx
Power Systems Fundamentals - EE3500 - Lab 1.pptxPower Systems Fundamentals - EE3500 - Lab 1.pptx
Power Systems Fundamentals - EE3500 - Lab 1.pptxengrodriguesyuri
 

Similar to © Dmitriy ShironosovShutterStock, Inc.LABORATORYLogic C.docx (20)

Logisim tutorial
Logisim tutorialLogisim tutorial
Logisim tutorial
 
Express pcb tutorial
Express pcb tutorialExpress pcb tutorial
Express pcb tutorial
 
P spice tutorialhkn
P spice tutorialhknP spice tutorialhkn
P spice tutorialhkn
 
Dtmf robot
Dtmf robotDtmf robot
Dtmf robot
 
PCB DESIGN - Introduction to PCB Design Library Creation
PCB DESIGN -  Introduction to PCB Design Library Creation PCB DESIGN -  Introduction to PCB Design Library Creation
PCB DESIGN - Introduction to PCB Design Library Creation
 
Control chap9
Control chap9Control chap9
Control chap9
 
Logic converter
Logic converterLogic converter
Logic converter
 
Practica 4 algebra booleana por compuertas lógicas.
Practica 4 algebra booleana por compuertas lógicas.Practica 4 algebra booleana por compuertas lógicas.
Practica 4 algebra booleana por compuertas lógicas.
 
Lab 7 multisim software tutorial
Lab 7 multisim software tutorialLab 7 multisim software tutorial
Lab 7 multisim software tutorial
 
Plc fatek
Plc fatekPlc fatek
Plc fatek
 
Magazine awr-ims-3
Magazine awr-ims-3Magazine awr-ims-3
Magazine awr-ims-3
 
Workshop diy 3 d printing makerbots 2012
Workshop diy 3 d printing   makerbots 2012Workshop diy 3 d printing   makerbots 2012
Workshop diy 3 d printing makerbots 2012
 
OCR GCSE Computing - Binary logic and Truth Tables
OCR GCSE Computing - Binary logic and Truth TablesOCR GCSE Computing - Binary logic and Truth Tables
OCR GCSE Computing - Binary logic and Truth Tables
 
Electronic Workbench - R.D.Sivakumar
Electronic Workbench - R.D.SivakumarElectronic Workbench - R.D.Sivakumar
Electronic Workbench - R.D.Sivakumar
 
Calculator scientific
Calculator scientificCalculator scientific
Calculator scientific
 
Manual LogixPro
Manual LogixProManual LogixPro
Manual LogixPro
 
Computer hardware troubleshooting
Computer hardware troubleshootingComputer hardware troubleshooting
Computer hardware troubleshooting
 
DE notes
DE notesDE notes
DE notes
 
This assignment is using Logism to create circuits. I have been tryi.pdf
This assignment is using Logism to create circuits. I have been tryi.pdfThis assignment is using Logism to create circuits. I have been tryi.pdf
This assignment is using Logism to create circuits. I have been tryi.pdf
 
Power Systems Fundamentals - EE3500 - Lab 1.pptx
Power Systems Fundamentals - EE3500 - Lab 1.pptxPower Systems Fundamentals - EE3500 - Lab 1.pptx
Power Systems Fundamentals - EE3500 - Lab 1.pptx
 

More from gerardkortney

· Describe strategies to build rapport with inmates and offenders .docx
· Describe strategies to build rapport with inmates and offenders .docx· Describe strategies to build rapport with inmates and offenders .docx
· Describe strategies to build rapport with inmates and offenders .docxgerardkortney
 
· Debates continue regarding what constitutes an appropriate rol.docx
· Debates continue regarding what constitutes an appropriate rol.docx· Debates continue regarding what constitutes an appropriate rol.docx
· Debates continue regarding what constitutes an appropriate rol.docxgerardkortney
 
· Critical thinking paper ·  ·  · 1. A case study..docx
· Critical thinking paper ·  ·  · 1. A case study..docx· Critical thinking paper ·  ·  · 1. A case study..docx
· Critical thinking paper ·  ·  · 1. A case study..docxgerardkortney
 
· Create a Press Release for your event - refer to slide 24 in thi.docx
· Create a Press Release for your event - refer to slide 24 in thi.docx· Create a Press Release for your event - refer to slide 24 in thi.docx
· Create a Press Release for your event - refer to slide 24 in thi.docxgerardkortney
 
· Coronel & Morris Chapter 7, Problems 1, 2 and 3.docx
· Coronel & Morris Chapter 7, Problems 1, 2 and 3.docx· Coronel & Morris Chapter 7, Problems 1, 2 and 3.docx
· Coronel & Morris Chapter 7, Problems 1, 2 and 3.docxgerardkortney
 
· Complete the following problems from your textbook· Pages 378.docx
· Complete the following problems from your textbook· Pages 378.docx· Complete the following problems from your textbook· Pages 378.docx
· Complete the following problems from your textbook· Pages 378.docxgerardkortney
 
· Consider how different countries approach aging. As you consid.docx
· Consider how different countries approach aging. As you consid.docx· Consider how different countries approach aging. As you consid.docx
· Consider how different countries approach aging. As you consid.docxgerardkortney
 
· Clarifying some things on the Revolution I am going to say som.docx
· Clarifying some things on the Revolution I am going to say som.docx· Clarifying some things on the Revolution I am going to say som.docx
· Clarifying some things on the Revolution I am going to say som.docxgerardkortney
 
· Chapter 9 – Review the section on Establishing a Security Cultur.docx
· Chapter 9 – Review the section on Establishing a Security Cultur.docx· Chapter 9 – Review the section on Establishing a Security Cultur.docx
· Chapter 9 – Review the section on Establishing a Security Cultur.docxgerardkortney
 
· Chapter 10 The Early Elementary Grades 1-3The primary grades.docx
· Chapter 10 The Early Elementary Grades 1-3The primary grades.docx· Chapter 10 The Early Elementary Grades 1-3The primary grades.docx
· Chapter 10 The Early Elementary Grades 1-3The primary grades.docxgerardkortney
 
· Chapter 5, Formulating the Research Design”· Section 5.2, Ch.docx
· Chapter 5, Formulating the Research Design”· Section 5.2, Ch.docx· Chapter 5, Formulating the Research Design”· Section 5.2, Ch.docx
· Chapter 5, Formulating the Research Design”· Section 5.2, Ch.docxgerardkortney
 
· Chap 2 and 3· what barriers are there in terms of the inter.docx
· Chap 2 and  3· what barriers are there in terms of the inter.docx· Chap 2 and  3· what barriers are there in terms of the inter.docx
· Chap 2 and 3· what barriers are there in terms of the inter.docxgerardkortney
 
· Case Study 2 Improving E-Mail Marketing ResponseDue Week 8 an.docx
· Case Study 2 Improving E-Mail Marketing ResponseDue Week 8 an.docx· Case Study 2 Improving E-Mail Marketing ResponseDue Week 8 an.docx
· Case Study 2 Improving E-Mail Marketing ResponseDue Week 8 an.docxgerardkortney
 
· Briefly describe the technologies that are leading businesses in.docx
· Briefly describe the technologies that are leading businesses in.docx· Briefly describe the technologies that are leading businesses in.docx
· Briefly describe the technologies that are leading businesses in.docxgerardkortney
 
· Assignment List· My Personality Theory Paper (Week Four)My.docx
· Assignment List· My Personality Theory Paper (Week Four)My.docx· Assignment List· My Personality Theory Paper (Week Four)My.docx
· Assignment List· My Personality Theory Paper (Week Four)My.docxgerardkortney
 
· Assignment List· Week 7 - Philosophical EssayWeek 7 - Philos.docx
· Assignment List· Week 7 - Philosophical EssayWeek 7 - Philos.docx· Assignment List· Week 7 - Philosophical EssayWeek 7 - Philos.docx
· Assignment List· Week 7 - Philosophical EssayWeek 7 - Philos.docxgerardkortney
 
· Assignment 3 Creating a Compelling VisionLeaders today must be .docx
· Assignment 3 Creating a Compelling VisionLeaders today must be .docx· Assignment 3 Creating a Compelling VisionLeaders today must be .docx
· Assignment 3 Creating a Compelling VisionLeaders today must be .docxgerardkortney
 
· Assignment 4· Week 4 – Assignment Explain Theoretical Perspec.docx
· Assignment 4· Week 4 – Assignment Explain Theoretical Perspec.docx· Assignment 4· Week 4 – Assignment Explain Theoretical Perspec.docx
· Assignment 4· Week 4 – Assignment Explain Theoretical Perspec.docxgerardkortney
 
· Assignment 2 Leader ProfileMany argue that the single largest v.docx
· Assignment 2 Leader ProfileMany argue that the single largest v.docx· Assignment 2 Leader ProfileMany argue that the single largest v.docx
· Assignment 2 Leader ProfileMany argue that the single largest v.docxgerardkortney
 
· Assignment 1 Diversity Issues in Treating AddictionThe comple.docx
· Assignment 1 Diversity Issues in Treating AddictionThe comple.docx· Assignment 1 Diversity Issues in Treating AddictionThe comple.docx
· Assignment 1 Diversity Issues in Treating AddictionThe comple.docxgerardkortney
 

More from gerardkortney (20)

· Describe strategies to build rapport with inmates and offenders .docx
· Describe strategies to build rapport with inmates and offenders .docx· Describe strategies to build rapport with inmates and offenders .docx
· Describe strategies to build rapport with inmates and offenders .docx
 
· Debates continue regarding what constitutes an appropriate rol.docx
· Debates continue regarding what constitutes an appropriate rol.docx· Debates continue regarding what constitutes an appropriate rol.docx
· Debates continue regarding what constitutes an appropriate rol.docx
 
· Critical thinking paper ·  ·  · 1. A case study..docx
· Critical thinking paper ·  ·  · 1. A case study..docx· Critical thinking paper ·  ·  · 1. A case study..docx
· Critical thinking paper ·  ·  · 1. A case study..docx
 
· Create a Press Release for your event - refer to slide 24 in thi.docx
· Create a Press Release for your event - refer to slide 24 in thi.docx· Create a Press Release for your event - refer to slide 24 in thi.docx
· Create a Press Release for your event - refer to slide 24 in thi.docx
 
· Coronel & Morris Chapter 7, Problems 1, 2 and 3.docx
· Coronel & Morris Chapter 7, Problems 1, 2 and 3.docx· Coronel & Morris Chapter 7, Problems 1, 2 and 3.docx
· Coronel & Morris Chapter 7, Problems 1, 2 and 3.docx
 
· Complete the following problems from your textbook· Pages 378.docx
· Complete the following problems from your textbook· Pages 378.docx· Complete the following problems from your textbook· Pages 378.docx
· Complete the following problems from your textbook· Pages 378.docx
 
· Consider how different countries approach aging. As you consid.docx
· Consider how different countries approach aging. As you consid.docx· Consider how different countries approach aging. As you consid.docx
· Consider how different countries approach aging. As you consid.docx
 
· Clarifying some things on the Revolution I am going to say som.docx
· Clarifying some things on the Revolution I am going to say som.docx· Clarifying some things on the Revolution I am going to say som.docx
· Clarifying some things on the Revolution I am going to say som.docx
 
· Chapter 9 – Review the section on Establishing a Security Cultur.docx
· Chapter 9 – Review the section on Establishing a Security Cultur.docx· Chapter 9 – Review the section on Establishing a Security Cultur.docx
· Chapter 9 – Review the section on Establishing a Security Cultur.docx
 
· Chapter 10 The Early Elementary Grades 1-3The primary grades.docx
· Chapter 10 The Early Elementary Grades 1-3The primary grades.docx· Chapter 10 The Early Elementary Grades 1-3The primary grades.docx
· Chapter 10 The Early Elementary Grades 1-3The primary grades.docx
 
· Chapter 5, Formulating the Research Design”· Section 5.2, Ch.docx
· Chapter 5, Formulating the Research Design”· Section 5.2, Ch.docx· Chapter 5, Formulating the Research Design”· Section 5.2, Ch.docx
· Chapter 5, Formulating the Research Design”· Section 5.2, Ch.docx
 
· Chap 2 and 3· what barriers are there in terms of the inter.docx
· Chap 2 and  3· what barriers are there in terms of the inter.docx· Chap 2 and  3· what barriers are there in terms of the inter.docx
· Chap 2 and 3· what barriers are there in terms of the inter.docx
 
· Case Study 2 Improving E-Mail Marketing ResponseDue Week 8 an.docx
· Case Study 2 Improving E-Mail Marketing ResponseDue Week 8 an.docx· Case Study 2 Improving E-Mail Marketing ResponseDue Week 8 an.docx
· Case Study 2 Improving E-Mail Marketing ResponseDue Week 8 an.docx
 
· Briefly describe the technologies that are leading businesses in.docx
· Briefly describe the technologies that are leading businesses in.docx· Briefly describe the technologies that are leading businesses in.docx
· Briefly describe the technologies that are leading businesses in.docx
 
· Assignment List· My Personality Theory Paper (Week Four)My.docx
· Assignment List· My Personality Theory Paper (Week Four)My.docx· Assignment List· My Personality Theory Paper (Week Four)My.docx
· Assignment List· My Personality Theory Paper (Week Four)My.docx
 
· Assignment List· Week 7 - Philosophical EssayWeek 7 - Philos.docx
· Assignment List· Week 7 - Philosophical EssayWeek 7 - Philos.docx· Assignment List· Week 7 - Philosophical EssayWeek 7 - Philos.docx
· Assignment List· Week 7 - Philosophical EssayWeek 7 - Philos.docx
 
· Assignment 3 Creating a Compelling VisionLeaders today must be .docx
· Assignment 3 Creating a Compelling VisionLeaders today must be .docx· Assignment 3 Creating a Compelling VisionLeaders today must be .docx
· Assignment 3 Creating a Compelling VisionLeaders today must be .docx
 
· Assignment 4· Week 4 – Assignment Explain Theoretical Perspec.docx
· Assignment 4· Week 4 – Assignment Explain Theoretical Perspec.docx· Assignment 4· Week 4 – Assignment Explain Theoretical Perspec.docx
· Assignment 4· Week 4 – Assignment Explain Theoretical Perspec.docx
 
· Assignment 2 Leader ProfileMany argue that the single largest v.docx
· Assignment 2 Leader ProfileMany argue that the single largest v.docx· Assignment 2 Leader ProfileMany argue that the single largest v.docx
· Assignment 2 Leader ProfileMany argue that the single largest v.docx
 
· Assignment 1 Diversity Issues in Treating AddictionThe comple.docx
· Assignment 1 Diversity Issues in Treating AddictionThe comple.docx· Assignment 1 Diversity Issues in Treating AddictionThe comple.docx
· Assignment 1 Diversity Issues in Treating AddictionThe comple.docx
 

Recently uploaded

MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 

Recently uploaded (20)

MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 

© Dmitriy ShironosovShutterStock, Inc.LABORATORYLogic C.docx

  • 1. © Dmitriy Shironosov/ShutterStock, Inc. LABORATORY Logic Circuits 6 ■■ Experiment■with■digital■logic■circuits■using■a■simple■logic ■gate■simulator. ■Software■needed: ■ 1)■ LogicGates■app■from■the■Lab■Manual■website■(Logic■Gate s.jar)■ OBJECTIVE REFERENCES © Jones & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION Logic Circuits | 43 BACKGROUND Review these topics from your textbook, lecture notes, or online resources: ■ Logic gates: AND, OR, NOT, XOR, NAND, NOR
  • 2. ■ Truth tables, combinational circuits, gate processing, 1-bit full adders, multiplexers ACTIVITY Digital logic circuits are the bedrock of computer design. CPU chips from companies like Intel and AMD are silicon wafers in which millions of circuits are embedded. Everything your computer does depends upon them. In this lab, we will learn how to use the LogicGates app to draw and test digital logic circuits. Chip manufacturers, such as Intel and AMD, use sophisticated (and extremely expensive) software to help them design and test their chips. But the basic idea of what we will be doing is the same. First, start the LogicGates app. You can load a number of examples by pulling down the example choice pull-down menu. Load the example labeled 1 simple, as shown here: Each logic gate has a distinctive shape. The wire coming out of the gate shows its current value. Gates are oriented so that their inputs come in from the left side and their outputs go out from the right side. This design cannot be changed; nor can the gates be rotated in this app. Two special boxes exist for input and output. The switch box has a lever in it along with 1 or 0. To flip the lever and change the value, click on the number right in the center. The other box has only 1 or 0 in it. This is the output
  • 3. box, which accepts a wire from a gate and displays its value. To propagate new values through the circuit, click on the Run button. It changes to say Stop, so that when you click on it again, the simulator stops running. When the circuit is running, you can click on the switches and watch values change throughout the circuit. © Jones & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION 44 | Laboratory 6 To practice using the simulator, we’ll build the logic circuit encoding the Boolean expression (AB) OR (AC), which will require three total switches and three total gates connected sequentially. First, if your simple example circuit is still running, click the Stop button. Now, clear the screen by clicking the Clear button. To build the circuit, you’ll need to add three switches, two AND gates, one OR gate, and one output box. To create them, click on the New button, pull down the gate menu, and select the gate or other item you want. Then click once where you want the switch, gate, or output box to sit. You can reposition gates, switches, and outputs by dragging them to a new location. Notice that when you are adding gates, the New button changes
  • 4. to say *New. Most of the buttons in this app work like this: They show they are still active by displaying an asterisk in front of the label on the button. Because the button stays active, you can click on different gates without having to reclick the New button over and over. Click on the New button again to stop adding components. The asterisk will go away. Let’s also attach labels to the boxes. However, in the logic gate simulator, labels attach to boxes, not wires, as you may see in textbooks or other diagrams. First, click on the Label button, which allows us to label gates and switches. Then click on the top switch. A text field opens up right above the switch. Type the letter “A” into it and press Return. Here’s what you should see: © Jones & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION Logic Circuits | 45 Label the middle switch as “B” and the bottom switch as “C.” Also label the output “X.” If you want to be thorough, label the top AND gate as “D” and the bottom AND gate as “E.” When done labeling, click on the Label
  • 5. button so that the asterisk doesn’t appear. Now it’s time to connect the gates, so click on the Connect button. Click once on switch A. A red line flashes into view, anchored in the center of the switch and following the mouse pointer around the screen. Click on the top AND gate. Repeat this process and connect all the boxes so they match the screenshot below. If you make a mistake, click on the Disconnect button, then click on a gate. All lines between that gate and all other components will be removed. A gate’s output may have any number of wires coming out of it so that it connects to more than one other gate. Merely select the same gate as the left end of a wire more than once. Automatic elbows break lines up into horizontal and vertical segments. To see a version that uses diagonal lines, click on the Stepped button. However, in most circuit fabrication technologies, all wires must lie on a grid, so diagonal wires are either impossible or expensive. To see the elbowed lines again, click on the bottom button, which has changed from Stepped to Diagonal. Sometimes the elbows make it hard to see overlapped wires, and that plagues this circuit; move the bottom AND gate a little to the left until the wires show more clearly.
  • 6. Here’s the final picture: Now run the circuit by clicking the Run button. Click on the switches to change their values. Record the results in a truth table. Imagine what a terrible thing it would be if a major chip manufacturer’s simulation software didn’t give the right values and they sent a chip into production with flaws in it. Well, actually, don’t bother imagining: It’s already happened! In the early 1990s, Intel recalled its new Pentium processor when scientists and engineers pointed out that in certain calculations the chip gave the wrong answer! Analysts have estimated that this bug in the chip’s division algorithm cost the company about $500 million. (Too bad they weren’t using our simulator to check their circuit design!) © Jones & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION 46 | Laboratory 6 Our simulator provides you with six types of gates: AND, OR, NOT, NAND, NOR, and XOR. All of these are defined in most textbooks and many online references. Another type of “gate” available in our circuit simulation is the truth table, which allows you to avoid building really complicated circuits with lots of gates. Instead, you fill in the truth table values and the simulator treats it as a gate. A truth table “gate”
  • 7. can have two, three, or more inputs. Let’s build a circuit using truth tables. Clear the screen and add three new switches and one output. The trickiest part is putting the correctly-sized truth table into the circuit. To do this, make sure the New button is activated (has an asterisk next to *New). Then pull down on the Gates menu and bring Truthtable into view. In the yellow message box, LogicGates will ask you how many inputs your truth table should have. The default is 2, but since we have 3 switches, replace the 2 with 3. Then click once in the middle of the area to create the truth table. Click off the New button and connect these gates as shown below: Important note! Make sure that when you connect the switches, you connect the top one first, then the middle one, and finally the bottom one. Using the proper sequence is necessary because the order of the incoming wires determines which value is associated with which column in the truth table. The first wire connected will correspond to the first column in the table, the second wire will correspond to the second column, and so on. If you connect them in a different order, the wires going into the truth table will not correspond to the columns of your truth table. New truth tables list all the input values in canonical order, but
  • 8. since the output is shown as always 0, we need to edit the truth table so it implements our desired output. To edit a truth table, click once on it (after making sure that all the buttons on the left are off [i.e., do not have asterisks in front of their names]). This makes the truth table the top gate, and its border will turn red. Now click on EditTT. A green window pops up, allowing you to edit this truth table. © Jones & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION Logic Circuits | 47 The input values are separated from the output value by a vertical bar symbol, (|). Go through the truth table and change some of the output values, as shown in the picture below. Once you are done, click OK to dismiss the truth table editing window, and then click on Refresh or just drag the truth table around so that the simulator will repaint the screen. Run the simulator and play with the switches, comparing the value in the output box to what you see in the truth table. Do they match? Since the truth table “gate” bypasses digital logic gates altogether and implements the given truth table, it might seem like using it is cheating!
  • 9. Actually, the truth table is similar to something called an SSI chip. Sometimes we are more interested in the function that the circuit computes (the pairing up of inputs and outputs) than in exactly which gates are needed to implement that function. By the way, if there are only two inputs to the truth table, there will be two columns and four rows. If there are three inputs, there will be three columns and eight rows, as shown in the example. Four inputs would require four columns and 16 rows, and five inputs would require five columns and 32 rows. Do you see a pattern? The input values in all the truth tables you see in this lab are shown in canonical (standard) order, which is the professional convention. This isn’t necessary for the simulator to work properly, but canonical order helps us fallible, distracted humans keep track of our inputs and outputs. TIP LogicGates can load and save your programs. It saves the data in a plain text file format. © Jones & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION 60 | Laboratory 6
  • 10. DEEPER INVESTIGATION The LogicGates app can create some very complicated circuits. Its main limitation is due to the finite amount of space available—if you have very many gates, you’ll eventually run out of room. However, judicious use of the truth table box can cut down on screen clutter. Example 5 of the sample circuits in the app is a model of a circuit called an S-R latch, also known as a “memory latch.” Try running it. When it starts, the output boxes will cycle between 0 and 1. To stop that, click on one of the switches so that it reads 1. Now the circuit is stable. Experiment with it by setting one of the inputs to 1, then changing it back to 0, and watch the outputs change. S-R latches are 1-bit memories built out of logic gates. Real computer chips use something like them in the main CPU for registers and other small, high-speed storage. Because the S-R latch has some serious timing problems, variants of it such as the clocked D-latch are used instead, as are even more complicated circuits called “flip-flops.” S-R latches are circuits that have a peculiar characteristic about their wiring. Can you tell what it is? If not, pretend that the top switch pours a blue-colored liquid through the wires and the bottom switch pours a red-colored liquid. Trace the liquids with colored pens. What do you notice? What would you call this characteristic of S-R latch circuits? Your teacher might be able to give you a hint.
  • 11. Because of this characteristic, circuits like the S-R latch are called “sequential circuits.” The output of sequential circuits depends not just on the current inputs, but also on the previous values on all the wires. They give a different sequence of results over time. Straight-through circuits like the others in this lab are called “combinational circuits” because their outputs depend only on the combination of their input values. Try to find out more about logic circuits. Look in some hardware books for an example of a flip-flop circuit. Try tracing its workings. © Jones & Bartlett Learning, LLC NOT FOR SALE OR DISTRIBUTION CS1150 Introduction to Computer Science Lab #4 – Logic Gates and Circuits, 40 points Objective: To experiment with digital logic circuits using a simple logic simulator. Instructions: Make sure to do the Activity as outlined in the LabCH06.pdf file. The activity is actually a tutorial that will help you to solve the problems in the exercises. It is expected that you will complete the Activity before you begin the exercises.
  • 12. When you are finished, save and rename the completed document as “firstname_lastname_lab4.docx”. Then, submit the saved document to Pilot. Exercise 1: (10 points) 1) Start the "LogicGates" applet, and add · Two (2) switch(inputs)elements, · One (1) AND gate elements, · One(1) NOT gate elements, · One (1) output element. Arrange them like so: · with the two (2) switches feeding into the AND · with the output of the AND going to the NOT · with the NOT's output going to the output element. Take one screenshot of your circuit. Submit it with the rest of your work. Put the screenshot of your completed circuit below this line. 2) Press the Run button and try out all four combinations of inputs for the switches, recording the results in your word document, formatted as a truth table. Construct your truth table for the above circuit below: Exercise 2: (10 points) 1) Start the "LogicGates" applet and add · Four (4) switch(inputs) elements, · Three (2) OR gates, · One (1) AND gate and · One (1) output elements. Arrange them so · two switches feed into one OR · while the other two switches feed into the other OR gate. · Then the two outputs of these OR gates feed into the AND gate…. · And the output of that AND gate goes to the output element. Take one screenshot of your circuit. Submit it with the rest of
  • 13. your work. 2) How many combinations of switch values can you have with four switches? How did you get this number? Write your answer here: 3) Press the Run button and try out all combinations of inputs for the switches, recording the results in a truth table in your word document. Put your Truth Table below this line. Remember: Don’t record the combinations randomly, count up from zero! Exercise 3: (10 points) 1) Start the "LogicGates" applet and add · Four (4) switch(inputs) elements, · Three (2) XOR gates, · One (1) NAND gate and · One (1) output elements. Arrange them so · two switches feed into one XOR · while the other two switches feed into the other XOR gate. · Then the two outputs of these XOR gates feed into the NAND gate…. · And the output of that NAND gate goes to the output element. Take one screenshot of your circuit. Submit it with the rest of your work. 2) How many combinations of switch values can you have with four switches? How did you get this number? Write your answer here: 3) Press the Run button and try out all combinations of inputs for the switches, recording the results in a truth table in your word document.
  • 14. Put your Truth Table below this line. Remember: Don’t record the combinations randomly, count up from zero! Exercise 4: (10 points) Now we will do an exercise with custom logic gates. Every logic gate’s behavior can be entirely described using its truth table. To put it another way, if you want a special, custom logic gate, you need to simply write down what its response is for every possible input combination. The applet you are using allows you to put “Truth Tables” (custom logic gates) in your circuit, then edit them to achieve whatever logic gate behavior you wish. We will use our truth table gates to implement one-bit binary addition. One gate will output the “SUM” part of the addition, the other one will output the “CARRY-OUT” part 1) Start the “LogicGates” applet. Build a circuit with: · three (3) switch elements, · two (2) custom logic gates (the applet calls these “Truth Tables”), · and two (2) output elements. Example 4 from the pull-down examples sets up some of this. Choose example 4 and add to it. 2) Connect all switches to both truth tables, then connect each custom gate to one output. 3) Label your inputs A, B, and C. 4) Label one custom gate “SUM”, and the other “CARRY-OUT” 5) Adjust the two custom gates so that one implements SUM and the other implements CARRY-OUT (see next page) TIP: Click “Edit TT” with the custom gate selected, then add rows and columns as necessary. It’s easiest to do this in a text editor like notepad++, then copy and paste to the applet. See the next page for a pair of truth tables you can copy. Here is the truth table for the SUM gate. Edit your custom gate to match. A B
  • 15. C SUM 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 Here is the truth table for the CARRY-OUT gate. Edit your custom gate to match.
  • 17. See the next page for a picture of how it is all supposed to look. This is what it should look like. 6) Test your circuit, and make sure it gives you the correct results for binary addition. 7) Take a screenshot of your program after you run it on one of the combinations of the three (3) inputs. Submit the screenshot with the rest of your work. Place the screenshot of your one-bit binary adder below this line: Rubric (40 pts possible): Exercise Points 1 Question 1 5 Question 2 5 2 Question 1 4 Question 2 2 Question 3 4 3 Question 1 4 Question 2 2
  • 18. Question 3 4 4 Question 1 2 Question 2 1 Question 3 1 Question 4 1 Question 5 2 Question 6 2 Question 7 1 Total 40 Lab4_Applets/Logic Gates.jar META-INF/MANIFEST.MF Manifest-Version: 1.0 Created-By: 1.6.0_38 (Sun Microsystems Inc.) Main-class: Main
  • 19. EditWindow$1.classsynchronizedclass EditWindow$1 extends java.awt.event.WindowAdapter { void EditWindow$1(EditWindow); public void windowClosing(java.awt.event.WindowEvent); } EditWindow.classpublicsynchronizedclass EditWindow extends java.awt.Frame implements java.awt.event.ActionListener { java.awt.Button okB; java.awt.Button cancelB; java.awt.TextArea ta; Gate g; public void EditWindow(Gate); public void actionPerformed(java.awt.event.ActionEvent); } Gate.classpublicsynchronizedclass Gate { int id; String type; String label; int x; int y; int height; int width; java.util.Vector inputgates; String connectionList; int currentValue; int newValue; String truthtable;
  • 20. static int nextid; int[] inputvals; LogicGates parent; static int[] midpoints; static int nummidpoints; public void Gate(LogicGates, String, int, int, int); public void Gate(LogicGates, String, int, int); private String makeTruthTable(int); private String decToBinary(int, int); public void setLabel(String); public int getValue(); public void flipValue(); public void compute(); public int matchTruthTable(); public void paint(java.awt.Graphics, boolean); public void drawOR(java.awt.Graphics, int, int, boolean); public void drawAND(java.awt.Graphics, int, int, boolean); public void drawNOT(java.awt.Graphics, int, int); public void drawXOR(java.awt.Graphics, int, int); public void drawSWITCH(java.awt.Graphics, int, int); public void drawOUTPUT(java.awt.Graphics, int, int); public void drawTRUTHTABLE(java.awt.Graphics, int, int); public void drawCONNECTOR(java.awt.Graphics, int, int); publicstatic void resetMidpoints(); private void drawLines(java.awt.Graphics); public void drawComplexLine(java.awt.Graphics, Gate, int, int, int, int); public boolean withinCenter(int, int); public boolean within(int, int); public void connect(Gate); public String toString(); publicstatic Gate parseString(LogicGates, String); static void <clinit>(); }
  • 21. LogicGates$1.classsynchronizedclass LogicGates$1 extends java.awt.event.WindowAdapter { void LogicGates$1(LogicGates); public void windowClosing(java.awt.event.WindowEvent); } LogicGates$2.classsynchronizedclass LogicGates$2 extends Thread { void LogicGates$2(LogicGates); public void run(); } LogicGates.classpublicsynchronizedclass LogicGates extends java.awt.Frame implements java.awt.event.ActionListener, java.awt.event.ComponentListener, java.awt.event.ItemListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener { java.awt.Button runB; java.awt.Button newB; java.awt.Button labelB; java.awt.Button delB; java.awt.Button conB; java.awt.Button disconB; java.awt.Button clearB; java.awt.Button editB; java.awt.Button refreshB; java.awt.Button loadB; java.awt.Button saveB; java.awt.Button lineStyleB; java.awt.Choice gatesCH; java.awt.Choice exampleCH; java.awt.TextField msgTF; java.awt.TextField tempInputField; java.awt.Image buffer;
  • 22. java.awt.Graphics gg; java.awt.Color acolor; java.util.Vector gates; boolean running; boolean newing; boolean dragging; boolean deleting; boolean connecting; boolean connecting_2; boolean disconnecting; public boolean diagonal; boolean labeling; int startx; int starty; int endx; int endy; int distX; int distY; int runtoggle; Gate topgate; public void LogicGates(); public void actionPerformed(java.awt.event.ActionEvent); private void clearAllAsterisks(); public void componentResized(java.awt.event.ComponentEvent); public void componentHidden(java.awt.event.ComponentEvent); public void componentMoved(java.awt.event.ComponentEvent); public void componentShown(java.awt.event.ComponentEvent); public void itemStateChanged(java.awt.event.ItemEvent); public void paint(java.awt.Graphics); public void update(java.awt.Graphics); public void mouseEntered(java.awt.event.MouseEvent); public void mouseExited(java.awt.event.MouseEvent);
  • 23. public void mousePressed(java.awt.event.MouseEvent); public void mouseReleased(java.awt.event.MouseEvent); public void mouseClicked(java.awt.event.MouseEvent); public void doubleClick(java.awt.event.MouseEvent); public void singleClick(java.awt.event.MouseEvent); public void breakConnections(Gate); public void mouseMoved(java.awt.event.MouseEvent); public void mouseDragged(java.awt.event.MouseEvent); public Gate findConnected(Gate); public boolean verify(); public void run(); public void loadExample(int); public void loadCircuit(); public void saveCircuit(); private void reconnect(Gate, String); public Gate findID(int); private void backDoorControl(); private void showGatePositions(); } Main.classpublicsynchronizedclass Main { public void Main(); publicstatic void main(String[]); } Popup$1.classsynchronizedclass Popup$1 extends java.awt.event.WindowAdapter { void Popup$1(Popup); public void windowClosing(java.awt.event.WindowEvent); } Popup.classsynchronizedclass Popup extends java.awt.Frame { java.awt.TextArea ta;
  • 24. public void Popup(String); public void Popup(String, java.awt.Color); public void Popup(String, int, int); public void Popup(String, int, int, java.awt.Color); public void Popup(String, int, int, int, int, java.awt.Color); public void add(String); public void setFont(java.awt.Font); } U.classpublicsynchronizedclass U { public void U(); publicstatic int atoi(String); publicstatic long atol(String); publicstatic double atod(String); publicstatic String[] copy(String[]); publicstatic String[] tokenize(String); publicstatic String[] tokenize(String, String); publicstatic String detokenize(String[]); publicstatic boolean equals(String[], String[]); publicstatic void sleep(long); publicstatic int power(int, int); publicstatic String convert(int, int); publicstatic boolean isint(String); publicstatic String dec2bin(int); publicstatic int bin2dec(String); publicstatic String twoscomplement(String); publicstatic String padout(String, char, int); publicstatic String squish(String, char); publicstatic java.awt.Color translateColor(String); publicstatic String replaceChar(String, char, char); publicstatic String getField(String, int); publicstatic String getField(String, int, char); publicstatic String skipFields(String, int); publicstatic void main(String[]); }