Difference between revisions of "CSC231 Logic Design Lab 2014"

From dftwiki3
Jump to: navigation, search
(Created page with "--~~~~ ---- __TOC__ <br /> <br /> <center> =Logic Design LAB= </center> ==Data Sheets== If you need to refer to the data sheets of various chips during the lab, you can...")
 
(Useful Boolean Axioms)
 
(30 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
=Logic Design LAB=
 
=Logic Design LAB=
 
</center>
 
</center>
 
+
<bluebox>
 +
This lab is worth 100 points.  You get the 100 points when you demonstrate that you can add 2 bits and get a correct sum and carry.  You do not need to provide a lab report for this lab.
 +
</bluebox>
 
   
 
   
==Data Sheets==
+
==EXPERIMENT #1: INVESTIGATING THE KIT==
 
+
<br />
If you need to refer to the data sheets of various chips during the lab, you can click on any of the links below:
+
===Overview of the Kit===
If the datasheets haven't been printed yet, print a set from these links: [http://cs.smith.edu/~thiebaut/classes/270/datasheets/sn74ls04rev5.pdf 74LS04 (NOT gate)]
+
<br />
[http://cs.smith.edu/~thiebaut/classes/270/datasheets/sn74ls08rev5.pdf 74LS08 (AND gate)]
+
<center>[[Image:DigitalKit.jpg|550px]]</center>
[http://cs.smith.edu/~thiebaut/classes/270/datasheets/sn74ls32rev5.pdf 74LS32 (OR gate)]
+
<br />
[http://cs.smith.edu/~thiebaut/classes/270/datasheets/sn74ls86rev5.pdf 74LS86 (XOR gate)]
+
The main tools for us today are the switches, the LEDs, the +5 and GND wiring plots, and the ''breadboard'' area. You will put ''Integrated Circuits'' (ICs) on the breadboard area.
 +
<br />
  
==EXPERIMENT #1: INVESTIGATING THE KIT==
+
===Exploration===
     
+
<br />     
For this part, concentrate only on the flatter part of the Digital Kit, not the circuit board that is upright, facing you. Please follow the steps below.
+
For this part, concentrate only on the '''flatter''' part of the Digital Kit, not the ''vertical'' circuit board that is upright, facing you. Please follow the steps below.
 
# '''Power OFF'''.  <font color="red">Always turn OFF the power when you are wiring circuits.  This will prevent shorts and extend the life of your circuits.</font>
 
# '''Power OFF'''.  <font color="red">Always turn OFF the power when you are wiring circuits.  This will prevent shorts and extend the life of your circuits.</font>
 
# Connect a wire between the Logic Indicator '''L4''' and the '''Logic Switch A'''.  
 
# Connect a wire between the Logic Indicator '''L4''' and the '''Logic Switch A'''.  
Line 27: Line 30:
 
# Activate Switch A, and observe the LED (Light Emitting Diode) turn ON and OFF.  
 
# Activate Switch A, and observe the LED (Light Emitting Diode) turn ON and OFF.  
 
# '''Power OFF'''
 
# '''Power OFF'''
# Switch the wire from A to A-Bar, turn the power back ON, and see how the LED reacts .
+
# Switch the wire from A to A-Bar, turn the power back ON, and see how the LED reacts .<br /><br /><br />
<br />
+
# Same experiment, but this time replace the Logic Switch by one of the '''Data Switches'''.<br /><br /><br />
# Same experiment, but this time replace the Logic Switch by one of the '''Data Switches'''.
 
<br />
 
 
# '''Power OFF'''.  
 
# '''Power OFF'''.  
 
# Connect one of the Logic Indicators to the Clock signal. Connect a second wire from another Logic Indicator to the Clock-bar signal. Make sure the sliding switch is on the 1Hz mark.
 
# Connect one of the Logic Indicators to the Clock signal. Connect a second wire from another Logic Indicator to the Clock-bar signal. Make sure the sliding switch is on the 1Hz mark.
Line 39: Line 40:
  
 
==EXPERIMENT #2: INTEGRATED CIRCUITS AND LOGIC GATES==
 
==EXPERIMENT #2: INTEGRATED CIRCUITS AND LOGIC GATES==
 +
<br />
 +
Below are the simplified data sheets for the Integrated Circuits you will use today.
 +
{|
 +
|
 +
[[Image:7404.png]]
 +
|
 +
Inverter: 74LS04
 +
|-
 +
|
 +
[[Image:7408.png]]
 +
|
 +
AND gate: 74LS08
 +
|-
 +
|
 +
[[Image:7432.png]]
 +
|
 +
OR gate: 74LS32
 +
|-
 +
|
 +
[[Image:7486.png]]
 +
|
 +
Exclusive OR: 74LS86
 +
|}
 +
<br />
  
You should have the data sheets of the integrated circuits implementing the AND gate (74LS08), the OR gate (74LS32), and the XOR gate (74LS86).  The XOR is not and ''universal'' gate, but its function is encountered enough times in the real world that manufacturers have built a circuit just for this function.  The equation for ''a XOR b'' is ''( a and not b ) or ( not a and b)'', which can be implemented using the simple AND, OR, and NOT.
+
'''Note:''' The XOR is not a ''universal'' gate, but its function is encountered enough times in the real world that manufacturers have built a circuit just for this function.  The equation for ''a XOR b'' is ''( a and not b ) or ( not a and b)'', which can be implemented using the simple AND, OR, and NOT.
 
+
<br />
You will be given three circuits in class, with a piece of tape hiding its part number.  The circuits are labeled '''A''', '''B''', and '''C'''.  Your job is to
+
===Testing ===
* pick one gate of the circuit,
 
* wire up the inputs of the gate to switches,
 
* attach the output of the gate to an LED,
 
* activate the different inputs
 
* figure out which circuit contains AND gates, which contains OR gates, and which contains XOR gates.
 
 
 
Use the information shown in the Figure 1 to help you wire the circuit.
 
  
 +
* <font color="Red">Power OFF</font>
 +
* Put a 74LS08 on the breadboard. 
 +
<br />
 +
<blockquote>
 
<tanbox>
 
<tanbox>
 
;Rule 1
 
;Rule 1
 
:Always make sure the notch on the circuit is facing left.  This way the circuit matches the diagram on the datasheets.
 
:Always make sure the notch on the circuit is facing left.  This way the circuit matches the diagram on the datasheets.
 
</tanbox>
 
</tanbox>
 +
</blockquote>
 
<br />
 
<br />
 +
* Connect its pin 14 to +5V.  See Figure 1 below for illustration of this step.
 +
* Connect its pin 7 to GND.
 +
<blockquote>
 
<tanbox>
 
<tanbox>
 
;Rule 2
 
;Rule 2
 
: Always make sure that the circuit is connected to +5V through its pin 14, and to GND via its pin 7.
 
: Always make sure that the circuit is connected to +5V through its pin 14, and to GND via its pin 7.
 
</tanbox>
 
</tanbox>
 
+
</blockquote>
 +
* Connect Pin 1 to a data switch.
 +
* Connect the Data Switch you just used to one of the Logic Indicators.
 +
* Connect Pin 2 to a data switch.
 +
* Connect the Data Switch you just used to another the Logic Indicators.
 +
* Connect Pin 3 to a third Logic Indicator.
 +
* <font color="Red">Power ON</font>
 +
* Activate the different data switches.
 +
* Verify that your circuit implements an AND boolean operator.
 +
<br />
 +
* Leave the wires as they are, and remove the 74LS08 being careful not to disconnect any of the wires.
 +
* Replace the 74LS08 by the 74LS86. 
 +
* Verify that the new circuit implements an XOR operator.
 +
<br />
 +
* Leave the wires as they are, and remove the 74LS86 being careful not to disconnect any of the wires.
 +
* Replace the 74LS86 by the 74LS32. 
 +
* Verify that the new circuit implements an OR operator.
 +
<br />
 +
* We'll skip the 74LS04, since this circuit is not pin-to-pin compatible with the other 3 (look at the schematic above to verify that this is, indeed,  not the case).
  
  
Line 69: Line 113:
 
'''Figure 1''':''Wiring of an IC on the breadboard. Always identify pin 1 of the IC which is on the left (or below) the notch or circle embossed on the top of the chip''
 
'''Figure 1''':''Wiring of an IC on the breadboard. Always identify pin 1 of the IC which is on the left (or below) the notch or circle embossed on the top of the chip''
  
You may find the tables below useful for keeping notes of what is going on.
+
<br />
{|
+
=2-Bit Adder=
! Input 1
+
<br />
! Input 2
+
<blockquote>
! Output
+
<bluebox>
|-
+
If you are ambitious and feel you have at least 30 minutes left ahead of you, select to implement the 2-bit adder with only AND, OR, and NOT operators.  If you are interested in a simpler solution with fewer wires, implement the 2-bit adder with an AND and an XOR operator.
|
+
</bluebox>
----
+
</blockquote>
|
+
<br />
----
+
* Generate the equations for the Carry and Sum bits as the sum of two bits B1 and B2.
|
+
* Wire up the circuit.
----
 
|-
 
| width="50px" |  0
 
| width="50px" | 0
 
| width="50px" | &nbsp;
 
|-
 
|  0
 
| 1
 
| &nbsp;
 
|-
 
| 1
 
| 0
 
| &nbsp;
 
|-
 
| 1
 
| 1
 
| &nbsp;
 
|}
 
  
 +
<br />
 +
<br />
 +
=3-Bit Adder=
 +
<br />
 +
* If you are ''really'' ambitious and have time, implement a 3-bit adder!
 +
<br />
 +
<center>[[Image:CSC270BreadboardArea.png]]</center>
 +
<br />
 +
<br />
  
{|
+
   
! Input 1
 
! Input 2
 
! Output
 
|-
 
|
 
----
 
|
 
----
 
|
 
----
 
|-
 
| width="50px" | 0
 
| width="50px" | 0
 
| width="50px" | &nbsp;
 
|-
 
|  0
 
| 1
 
| &nbsp;
 
|-
 
| 1
 
| 0
 
| &nbsp;
 
|-
 
| 1
 
| 1
 
| &nbsp;
 
|}
 
  
  
{|
 
! Input 1
 
! Input 2
 
! Output
 
|-
 
|
 
----
 
|
 
----
 
|
 
----
 
|-
 
| width="50px" |  0
 
| width="50px" | 0
 
| width="50px" | &nbsp;
 
|-
 
|  0
 
| 1
 
| &nbsp;
 
|-
 
| 1
 
| 0
 
| &nbsp;
 
|-
 
| 1
 
| 1
 
| &nbsp;
 
|}
 
  
==EXPERIMENT #3: MYSTERY CIRCUIT==
+
==Useful Boolean Axioms==
 
+
<br />
Get a new circuit from your instructor, one that will also have its part number hidden, and which is labeled '''D'''.  The gates inside are wired similarly as the gates in Circuits '''A''', '''B''', and '''C'''.
+
* You may find these axioms useful in simplifying functions (taken from [http://en.wikipedia.org/wiki/Boolean_algebra_(structure) Wikipedia])
 
 
Energize one of the gates and figure out what logic function is performed by the gate.
 
 
 
{|
 
! Input 1
 
! Input 2
 
! Output
 
|-
 
|
 
----
 
|
 
----
 
|
 
----
 
|-
 
| width="50px" |  0
 
| width="50px" | 0
 
| width="50px" | &nbsp;
 
|-
 
| 0
 
| 1
 
| &nbsp;
 
|-
 
| 1
 
| 0
 
| &nbsp;
 
|-
 
| 1
 
| 1
 
| &nbsp;
 
|}
 
 
 
==EXPERIMENT #4: BOOLEAN ALGEBRA==
 
 
 
For those who have taken CSC231, your job for today is to use AND, OR, and NOT gates and show that they are designed following the axioms of the Boolean Algebra.
 
 
 
* Get together as a group and discuss the axioms of a Boolean Algebra shown below (and taken from [http://en.wikipedia.org/wiki/Boolean_algebra_(structure) Wikipedia])
 
  
 
::{| cellpadding=5
 
::{| cellpadding=5
Line 222: Line 165:
 
|}
 
|}
  
* Figure out how to test each axiom
+
 
* Divide the work to be done into tasks and assign each task to a group or to an individual
 
* Demonstrate to the class that the gates found in the integrated circuits used in the lab verify the axioms of the Boolean Algebra.
 
 
 
==EXPERIMENT #5: CIRCUIT WIRING==
 
 
 
Build a circuit implementing the function ''f''(''a, b, c'') = &Sigma;(1, 2, 3, 5, 7).
 
 
 
Note: you might want to try to simplify ''f'' as much as you can, since the simpler ''f'' becomes, the simpler your hardware will be!
 
 
 
Generate the truth table for your circuit and verify that it generates a 1 for Minterm 1, Minterm 2, Minterm 3, Minterm 5, and Minterm 7.
 
 
 
==LAB REPORT==
 
 
 
That's it for this lab! Translate your notes into a lab report that you will hand in next Wednesday. The first lab report will be graded generously, and you will get feedback that will help you better organize the next reports (if necessary).
 
 
 
When preparing your lab reports, keep these important points in mind:
 
 
 
* Your lab should bear your name, and the date of the lab.
 
 
 
* Your lab report should be '''self-contained'''. Somebody should be able to redo the same experiments using the information contained in your report. Including the original Web page for the lab, or cutting and pasting from the Lab Web page into your report are good and welcomed ideas.
 
 
 
* You may type or hand-write your report. If you have a lot of diagrams, hand-generating them might be faster than using a drawing package.
 
 
 
* Record and report observations truthfully. If you measure a signal to be of a value different from the value you think, or know it should have, report the value that you measure, not the value that you believe you should have measured. You should comment on the measurement and indicate why you think the value is incorrect.
 
 
 
* The Web documents for this class contain many graphic files showing different types of circuit and designs. Do not hesitate to use them to illustrate your own documents.
 
 
 
* A report should be an honest log of your work, not an idealized version of it.
 
 
 
* Use the KISS philosophy: "Keep it simple, Stupid!"
 
 
 
* When drawing schematics, make sure you try to follow these conventions:[[Image:CSC270_Schematics_Example.jpg| 300px | right]]
 
** Signals flow from left to right
 
** All gates are nicely drawn (by hand or with a CAD package), and each pin is labeled with its pin number on the chip.
 
** The Vcc and Ground pins are indicated.
 
** Input and output signals are clearly labeled
 
** The part number is written inside or next to the gates (08 for an AND gate, 32 for an OR gate, etc.)
 
 
 
* You may find Allie's Lab 8 report from a couple years ago an interesting model to look at: [http://maven.smith.edu/~thiebaut/classes/270/AllieLab8.pdf Lab example].  Note the very nice use of pictures taken during the lab to document the report.  Note that Allie is a very prolific writer, and her report might be on the longer side! :-)
 
 
 
* The report will count as a regular homework assignment.
 
 
 
 
<br />
 
<br />
  
Line 276: Line 177:
  
 
<br />
 
<br />
[[Category:CSC270]][[Category:Labs]]
+
[[Category:CSC231]][[Category:Labs]]

Latest revision as of 13:30, 19 November 2014

--D. Thiebaut (talk) 10:35, 19 November 2014 (EST)




Logic Design LAB

This lab is worth 100 points. You get the 100 points when you demonstrate that you can add 2 bits and get a correct sum and carry. You do not need to provide a lab report for this lab.

EXPERIMENT #1: INVESTIGATING THE KIT


Overview of the Kit


DigitalKit.jpg


The main tools for us today are the switches, the LEDs, the +5 and GND wiring plots, and the breadboard area. You will put Integrated Circuits (ICs) on the breadboard area.

Exploration


For this part, concentrate only on the flatter part of the Digital Kit, not the vertical circuit board that is upright, facing you. Please follow the steps below.

  1. Power OFF. Always turn OFF the power when you are wiring circuits. This will prevent shorts and extend the life of your circuits.
  2. Connect a wire between the Logic Indicator L4 and the Logic Switch A.
  3. Power ON
  4. Activate Switch A, and observe the LED (Light Emitting Diode) turn ON and OFF.
  5. Power OFF
  6. Switch the wire from A to A-Bar, turn the power back ON, and see how the LED reacts .


  7. Same experiment, but this time replace the Logic Switch by one of the Data Switches.


  8. Power OFF.
  9. Connect one of the Logic Indicators to the Clock signal. Connect a second wire from another Logic Indicator to the Clock-bar signal. Make sure the sliding switch is on the 1Hz mark.
  10. Power UP. What do you observe?
  11. Slide the switch to 1KHz. What happens? Why? Is there any difference in the brightness of the LED? Why?



EXPERIMENT #2: INTEGRATED CIRCUITS AND LOGIC GATES


Below are the simplified data sheets for the Integrated Circuits you will use today.

7404.png

Inverter: 74LS04

7408.png

AND gate: 74LS08

7432.png

OR gate: 74LS32

7486.png

Exclusive OR: 74LS86


Note: The XOR is not a universal gate, but its function is encountered enough times in the real world that manufacturers have built a circuit just for this function. The equation for a XOR b is ( a and not b ) or ( not a and b), which can be implemented using the simple AND, OR, and NOT.

Testing

  • Power OFF
  • Put a 74LS08 on the breadboard.


Rule 1
Always make sure the notch on the circuit is facing left. This way the circuit matches the diagram on the datasheets.


  • Connect its pin 14 to +5V. See Figure 1 below for illustration of this step.
  • Connect its pin 7 to GND.
Rule 2
Always make sure that the circuit is connected to +5V through its pin 14, and to GND via its pin 7.
  • Connect Pin 1 to a data switch.
  • Connect the Data Switch you just used to one of the Logic Indicators.
  • Connect Pin 2 to a data switch.
  • Connect the Data Switch you just used to another the Logic Indicators.
  • Connect Pin 3 to a third Logic Indicator.
  • Power ON
  • Activate the different data switches.
  • Verify that your circuit implements an AND boolean operator.


  • Leave the wires as they are, and remove the 74LS08 being careful not to disconnect any of the wires.
  • Replace the 74LS08 by the 74LS86.
  • Verify that the new circuit implements an XOR operator.


  • Leave the wires as they are, and remove the 74LS86 being careful not to disconnect any of the wires.
  • Replace the 74LS86 by the 74LS32.
  • Verify that the new circuit implements an OR operator.


  • We'll skip the 74LS04, since this circuit is not pin-to-pin compatible with the other 3 (look at the schematic above to verify that this is, indeed, not the case).



Figure 1: Wiring of an IC on the breadboard. Always identify pin 1 of the IC which is on the left (or below) the notch or circle embossed on the top of the chip.
Figure 1:Wiring of an IC on the breadboard. Always identify pin 1 of the IC which is on the left (or below) the notch or circle embossed on the top of the chip


2-Bit Adder


If you are ambitious and feel you have at least 30 minutes left ahead of you, select to implement the 2-bit adder with only AND, OR, and NOT operators. If you are interested in a simpler solution with fewer wires, implement the 2-bit adder with an AND and an XOR operator.


  • Generate the equations for the Carry and Sum bits as the sum of two bits B1 and B2.
  • Wire up the circuit.



3-Bit Adder


  • If you are really ambitious and have time, implement a 3-bit adder!


CSC270BreadboardArea.png





Useful Boolean Axioms


  • You may find these axioms useful in simplifying functions (taken from Wikipedia)
a OR (b OR c) = (a OR b) OR c a AND (b AND c) = (a AND b) AND c Associativity
a OR b = b OR a a AND b = b AND a Commutativity
a OR (a AND b) = a a AND (a OR b) = a Absorption
a OR (b AND c) = (a OR b) AND (a OR c)   a AND (b OR c) = (a AND b) OR (a AND c)   Distributivity
a OR NOT a = 1 a AND NOT a = 0 Complements