Difference between revisions of "CSC270 Lab 2 2016"

From dftwiki3
Jump to: navigation, search
(Part 2)
(Experiment #1)
 
(13 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
<br />
 
<br />
  
=LAB #2=
+
=Nand Gates=
 +
 +
* Implement the 2-bit adder with NAND gates only.  The figures below show the schematics of a NAND gate (and of a NOR gate, for completeness).
  
 +
{|
 +
|width="50%"|
 +
[[Image:CS270Nand.png |200px]]
 +
<br>
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;74LS00 NAND
 +
|
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  
==Decoder Circuit: the Do-It-Yourself version==
+
|width="50%"|
 +
[[Image:CS270Nor.png | 200px]]
 +
<br>
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;74LS02 NOR
 +
|}
 +
 
 +
<br />
 +
'''Hints:''' You may use the A, A', B, and B' '''logic switches''' if that can help you simplify your circuit.  Less is more!
 +
 
 +
=Decoder Circuit: the Do-It-Yourself version=
  
===Part 1===
+
==Part 1==
 +
<br />
 
Complete the circuit shown in Figure 1 by adding the part numbers of the circuits.  Add this number inside the logic symbol, and also add the pin numbers on the inputs and outputs of the gates.  Also, do not forget that each circuit requires power and ground.
 
Complete the circuit shown in Figure 1 by adding the part numbers of the circuits.  Add this number inside the logic symbol, and also add the pin numbers on the inputs and outputs of the gates.  Also, do not forget that each circuit requires power and ground.
  
Line 38: Line 57:
  
 
<br />
 
<br />
===Part 2===
+
 
 +
==Part 2==
 
<br />
 
<br />
 
Now connect L1, L2, L3 and L4 to the '''input''' of the inverters rather than their output, and record the variation of L4, L3, L2 and L1 as a function of SW2 and SW1.
 
Now connect L1, L2, L3 and L4 to the '''input''' of the inverters rather than their output, and record the variation of L4, L3, L2 and L1 as a function of SW2 and SW1.
Line 58: Line 78:
 
<br />
 
<br />
  
==The 74LS42 Decoder==
+
=The 74LS42 Datasheet=
 
+
<br />
 +
The 74LS42 is an ''integrated'' decoder.  Decoders are so common in computers, that putting one in a chip made sense for the chip manufacturers.
 +
<br />
 +
<tanbox>Be careful, this circuit has 16 pins, and not 14, as we have been using so far!</tanbox>
 +
<br />
 
<center>
 
<center>
[[Image:CSC270_7442.gif]] <br />
+
[[Image:74ls42a.png|400px]]
Figure 2: The 7442, as wired on the HeathKit digital trainer.
+
<br />
 +
[[Image:74ls42b.png|400px]]
 +
<br />
 +
[[Image:74ls42c.png|400px]]
 +
<br />
 
</center>
 
</center>
  
Block 6 on the circuit board attached to your kit contains a circuit centered on a 7442 (or 74LS42). The logic diagram of the circuit is shown in Figure 2. It has four inputs connected to the test points labeled TP602, TP603, TP604, and TP605. Connect these test points to the data switches. You may want to add a "post-it" note above the data switches to indicate which inputs of the 74LS42 (A, B, C or D) you are activating with the switches. The ten outputs of the 7442 are connected to 10 LEDs, labeled L604 to L613.
+
=Experiment #1=
  
To apply power to the 7442, close DIP-switches 7 and 8 in Block 6 (closing a switch means bringing it in the position where the little knob is aligned with the number "1" painted on the switch). (Note: A Dip switch is a "Dual In Line" switch, that is a series of miniature switches that have the same footprint as a regular integrated circuit.)
+
Study the 74LS42 data-sheet.  Observe it carefully and figure out what kind of decoder it is:
  
Turn the Kit power back ON. Activate the data switches and record the variation of the output LEDs in a table
+
;Question 1:
 +
: Is it a 3-to-8 decoder?  A 4-to-16 decoder?  If not, then what?
  
{| border="1" cellpadding="13"
+
;Question 2:
|  D 
+
:Are the outputs active high or active low?
| C 
 
| B 
 
| A 
 
| L13 
 
| L12 
 
| L11 
 
| L10 
 
| L9 
 
| L8 
 
| L7 
 
| L6 
 
| L5 
 
| L4
 
|-
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
|-
 
| &nbsp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sp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
|}
 
  
==Challenge of the Day, #1==
+
;Question 3:
 +
:Using the schematics as your guide, design a 2-bit adder using this decoder, and as few other integrated circuits as possible.  The fewer chips on your breadboard the better!
  
Use a 74LS42 to implement a 3-to-8 decoder with enable and active-low outputs.
+
<br />
  
==Challenge of the Day, #2 ==
+
<br />
 
+
<br />
Use a 74LS42 to implement a majority voter of 3 input signals.  You can only use one extra chip, in addition to the 74LS42!
+
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
[[Category:CSC270]][[Category:Labs]]

Latest revision as of 21:47, 3 February 2016

--D. Thiebaut (talk) 20:15, 3 February 2016 (EST)




Nand Gates

  • Implement the 2-bit adder with NAND gates only. The figures below show the schematics of a NAND gate (and of a NOR gate, for completeness).

CS270Nand.png
      74LS00 NAND

          

CS270Nor.png
       74LS02 NOR


Hints: You may use the A, A', B, and B' logic switches if that can help you simplify your circuit. Less is more!

Decoder Circuit: the Do-It-Yourself version

Part 1


Complete the circuit shown in Figure 1 by adding the part numbers of the circuits. Add this number inside the logic symbol, and also add the pin numbers on the inputs and outputs of the gates. Also, do not forget that each circuit requires power and ground.

CSC270 Decoder1.gif
Figure 1. Decoder implemented with Inverters and NANDs.

  • When you are done, implement the circuit on the breadboard section of your kit.
  • Make sure you have turned off the power before you start wiring.
  • Also, make sure that you connect the outputs of the inverters to the four logic indicators (LEDs). Verify your connections before you turn the power back on. Activate the two inputs and record the outputs in a truth table which you'll include in your report.


 SW1 	SW2 	L4 	L3 	L2 	L1
 0 	0 	  	  	  	 
 0 	1 	  	  	  	 
 1 	0 	  	  	  	 
 1 	1


Because the inactive outputs are all set to zero, and the active one is set to 1, we refer to this type of circuit as a circuit with "active high" outputs.


Part 2


Now connect L1, L2, L3 and L4 to the input of the inverters rather than their output, and record the variation of L4, L3, L2 and L1 as a function of SW2 and SW1.


 SW1 	SW2 	L4 	L3 	L2 	L1
 0 	0 	  	  	  	 
 0 	1 	  	  	  	 
 1 	0 	  	  	  	 
 1 	1


You now have the opposite behavior, where the inactive outputs are all 1 except for one that is set to 0. We refer to this type of circuit as a circuit with active-low outputs.

Most decoders work as the last circuit you just tested, rather than the one you first experimented with, although the first circuit had a more "intuitive" behavior.

The 74LS42 Datasheet


The 74LS42 is an integrated decoder. Decoders are so common in computers, that putting one in a chip made sense for the chip manufacturers.

Be careful, this circuit has 16 pins, and not 14, as we have been using so far!


74ls42a.png
74ls42b.png
74ls42c.png

Experiment #1

Study the 74LS42 data-sheet. Observe it carefully and figure out what kind of decoder it is:

Question 1
Is it a 3-to-8 decoder? A 4-to-16 decoder? If not, then what?
Question 2
Are the outputs active high or active low?
Question 3
Using the schematics as your guide, design a 2-bit adder using this decoder, and as few other integrated circuits as possible. The fewer chips on your breadboard the better!