Difference between revisions of "CSC103 Logic Lab 2013"

From dftwiki3
Jump to: navigation, search
(Created page with "--~~~~ ---- - <meta name="keywords" content="computer science, How Computers Work, Dominique Thiebaut, smith college" /> <meta name="description" content="Dominique Thieba...")
 
 
(6 intermediate revisions by the same user not shown)
Line 18: Line 18:
 
[[CSC103 2011 | Back to CSC103 Main Page]]
 
[[CSC103 2011 | Back to CSC103 Main Page]]
  
 +
<br />
 +
A newer version of this page can be found [[CSC103_Logic_Lab_2014 |  here]].
 +
<br />
 +
<br />
 
__TOC__
 
__TOC__
  
Line 30: Line 34:
  
 
=Logic Simulator=
 
=Logic Simulator=
 
+
<br />
 
==Reference==
 
==Reference==
 +
<br />
  
 
* You can find a nice description of the simulator used in this lab at http://math.hws.edu/TMCM/java/xLogicCircuits/
 
* You can find a nice description of the simulator used in this lab at http://math.hws.edu/TMCM/java/xLogicCircuits/
  
 +
<br />
 
==The Applet==
 
==The Applet==
# Go to [http://maven.smith.edu/~thiebaut/classes/103/applets.htm this page] ( or [http://xgridmac.dyndns.org/~thiebaut/classes/103/applets.htm this one] if the previous one seems slow to load up) and click on the middle button: "Launch xLogicCircuit" and wait for the simulator to show up.
+
<br />
 +
# Go to [http://maven.smith.edu/~thiebaut/classes/103/applets.htm this page] ( or [http://xgridmac.dyndns.org/~thiebaut/classes/103/applets.htm this one]) if the previous one seems slow to load up) and click on the middle button: "Launch xLogicCircuit" and wait for the simulator to show up.
 
<br />
 
<br />
 
<br />
 
<br />
Line 46: Line 53:
 
<br />
 
<br />
 
<center>[[Image:CSC103_Circuit_Simulator.png]]</center>
 
<center>[[Image:CSC103_Circuit_Simulator.png]]</center>
 +
 +
<br />
  
 
==NOT, OR, and AND gates==
 
==NOT, OR, and AND gates==
 +
<br />
  
 
Study all three fundamental gates: the NOT gate, the OR gate, and the AND gate.
 
Study all three fundamental gates: the NOT gate, the OR gate, and the AND gate.
  
 +
<br />
 
===The NOT gate===
 
===The NOT gate===
 +
<br />
  
 
# Drag an '''input''' symbol on the leftmost part of the wiring area
 
# Drag an '''input''' symbol on the leftmost part of the wiring area
Line 66: Line 78:
 
Once you're done, '''clear''' your wiring area and wire up an OR gate, as shown below:
 
Once you're done, '''clear''' your wiring area and wire up an OR gate, as shown below:
  
 +
<br />
 
===The OR gate===
 
===The OR gate===
 +
<br />
  
 
Take the similar steps as you did for the NOT gate, and wire up an OR gate with 2 inputs.  Try all possible combinations of the two inputs and verify that it's truth table is the following one:
 
Take the similar steps as you did for the NOT gate, and wire up an OR gate with 2 inputs.  Try all possible combinations of the two inputs and verify that it's truth table is the following one:
 
<center>
 
<center>
  
{| border="1"
+
{| border="1" cellpadding="10" cellspacing="0"
 
|-
 
|-
 
| input1  
 
| input1  
Line 97: Line 111:
 
<br />
 
<br />
 
</center>
 
</center>
 +
 +
<br />
  
 
===The AND gate===
 
===The AND gate===
 +
<br />
  
 
Take the similar steps as you did for the OR gate, and wire up an AND gate with 2 inputs.  Try all possible combinatins of the two inputs and verify that it's truth table is the following one:
 
Take the similar steps as you did for the OR gate, and wire up an AND gate with 2 inputs.  Try all possible combinatins of the two inputs and verify that it's truth table is the following one:
Line 252: Line 269:
 
<br />
 
<br />
 
<br />
 
<br />
* Use the simulator to verify that the logic expression for the '''carry''' bit is
+
* Generate the boolean equations (using a, b, c, AND, OR and NOT) for the sum and the carry.
 +
 
 +
* Use the simulator to verify that the logic expression for the '''carry''' bit can also be realized by a different equation, very likely shorter than the one you found (there can be many equations that result in the same behavior):
  
           carry  =  ( a and b ) or ( a and c ) or ( b and c )
+
           carry  =  ( a AND b ) OR ( a AND c ) OR ( b AND c )
  
* Once you have ''wired'' and ''tested'' it, demonstrate it to your instructor, please! :-)
+
* Once you have ''wired'' and ''tested'' it, demonstrate it to your instructor! :-)
  
  
Line 263: Line 282:
 
<center>
 
<center>
 
<br />
 
<br />
You are now ready for [[CSC103_Homework_2_Fall_2012 | Homework 2]]!
 
 
<br />
 
<br />
 
</center>
 
</center>

Latest revision as of 16:09, 24 August 2014

--D. Thiebaut (talk) 06:08, 12 September 2013 (EDT)


-


<meta name="keywords" content="computer science, How Computers Work, Dominique Thiebaut, smith college" /> <meta name="description" content="Dominique Thiebaut's Web Page" /> <meta name="title" content="Dominique Thiebaut -- Computer Science" /> <meta name="abstract" content="Dominique Thiebaut's Computer Science Web pages" /> <meta name="author" content="thiebaut at cs.smith.edu" /> <meta name="distribution" content="Global" /> <meta name="revisit-after" content="10 days" /> <meta name="copyright" content="(c) D. Thiebaut 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,2008" /> <meta name="robots" content="FOLLOW,INDEX" />

Back to CSC103 Main Page


A newer version of this page can be found here.



This lab is about logic design. Work in pairs and alternate with your lab partner when working at the keyboard. You do not have to turn in anything at the end of the lab. The goal of the lab is to get you to play with a logic gate simulator.



Logic Simulator


Reference



The Applet


  1. Go to this page ( or this one) if the previous one seems slow to load up) and click on the middle button: "Launch xLogicCircuit" and wait for the simulator to show up.



CSC103 AppletPage.png



You should see this window:



CSC103 Circuit Simulator.png


NOT, OR, and AND gates


Study all three fundamental gates: the NOT gate, the OR gate, and the AND gate.


The NOT gate


  1. Drag an input symbol on the leftmost part of the wiring area
  2. Drag an output symbol on the rightmost part of the wiring area
  3. Drag a NOT gate in the middle of the area
  4. Connect the input symbol to the input of the NOT gate with a wire (left click and drag), and the output of the NOt gate to the output symbol with another wire
  5. Turn the power on (bottom of the window)
  6. Left-click on the input symbol to generate a 1 (red) or a zero (blue). Try all possible variations of the input and verify that the output symbol is always the opposite of the input value.

    Remember that you can drag symbols around by right-clicking on them.



CSC103 Not Gate.png



Once you're done, clear your wiring area and wire up an OR gate, as shown below:


The OR gate


Take the similar steps as you did for the NOT gate, and wire up an OR gate with 2 inputs. Try all possible combinations of the two inputs and verify that it's truth table is the following one:

input1 input2 input1 OR input2
0 0 0
0 1 1
1 0 1
1 1 1



CSC103 OR Gate.png


The AND gate


Take the similar steps as you did for the OR gate, and wire up an AND gate with 2 inputs. Try all possible combinatins of the two inputs and verify that it's truth table is the following one:

input1 input2 input1 OR input2
0 0 0
0 1 0
1 0 0
1 1 1



CSC103 AND Gate.png

Binary Adder

Wire up the circuit of the binary adder which we have seen in class.

CSC103 Binary Adder.png


Try all possible combinations of the inputs, and verify that the outputs correspond to the sum of the two inputs, in binary.

bit1 + bit2 = carry   sum
0 + 0 = 0 0
0 + 1 = 0 1
1 + 0 = 0 1
1 + 1 = 1 0

3-Bit Adder

  • A 3-bit adder is a circuit with 3 inputs, or bits, and two outputs, corresponding to the carry and the sum, as for the 2-bit adder.
  • On a piece of paper, write the truth table for the 3-bit adder.




b1 b2 b3 carry sum
0 0 0    
0 0 1    
0 1 0    
0 1 1    
1 0 0    
1 0 1    
1 1 0    
1 1 1    



  • Generate the boolean equations (using a, b, c, AND, OR and NOT) for the sum and the carry.
  • Use the simulator to verify that the logic expression for the carry bit can also be realized by a different equation, very likely shorter than the one you found (there can be many equations that result in the same behavior):
         carry  =  ( a AND b ) OR ( a AND c ) OR ( b AND c )
  • Once you have wired and tested it, demonstrate it to your instructor! :-)


Hope you enjoyed the lab!