CSE370 Laboratory Assignment 1

Constructing Simple Logic Circuits


Distributed: October 5 , 2004
Due: By the end of the lab session


Objectives

This first laboratory assignment will get you familiar with the prototyping board you will be using the entire quarter.  Your goal will be to realize the Boolean expression you derived for the “jack of diamonds” using simple Boolean logic gates included in your laboratory kit.  By the end of this lab you should know how to construct and verify the operation of a small circuit (3-6 logic gates) using switches and LEDs as I/O devices.


Laboratory Design Kits

The design kits contain everything that you need to construct and test medium size circuits.  We will collect a $100 security deposit check from each student which is returned uncashed at the end of the quarter when the kit is returned.  You will be expected to return the kit in good condition and with everything intact, including the chips.  Included in the DesignKit are:

Digilent XLA5 prototyping board (including a prototype area consisting of a solderless breadboard)
• Power supply
• Logic probe
• Bag of pre-cut, pre-stripped wires
• Wire stripper/cutter
• Needle-nose pliers
Some standard TTL logic chips (all DIP - dual-in-line pin packages - compatible with the breadboard)
• Chip extractor tool (the only way you will remove chips from the breadboard - for the safety of your fingers and the chip's pins)

Please make sure that all of the above are in your kit.  We may provide additional materials later in the quarter that you will need for the later labs and the lab project, such as a serial cable, an LCD display or a keypad.

Accidents do happen, so we will replace a certain number of chips whose pins may get bent.  Generally, the first time, most any damage will be forgiven.  However, incidents of gross negligence will not be met with such forgiveness.  In particular, you should pay careful attention to the location of your power wires and never allow a short between them and ground (GND- 0 volts, and VDD- 5 volts).  And please make sure to treat the prototyping board with care; in particular, be sure to not break off wires in the connectors.


XLA5 Prototyping Board

XLA5 Schematic Block Diagram

This is a block diagram for the entire XLA board.  Note that it highlights a large programmable logic chip on the board.  Your kit may or may not have this chip in place right now, but we will use it later in the quarter to provide an environment for your digital circuits.  In this class, you will not program this chip; that will happen in CSE 467.  For now, your focus will be on the upper right hand corner - the prototyping area.  You will also make use of buttons, switches, LEDs, and 7-segment displays as I/O devices except for Switch 8, Pushbutton 4, and LED 8, which are used for special functions.  For the final laboratory assignment, we may make use of other features on the board.


Breadboarding Techniques

The breadboard on the XLA board is the large white plastic area in the center of the board and is comprised of 63 rows (numbered 1-63) and 10 columns (lettered a-j) of holes.  On every row, holes in columns a, b, c, d, and e are connected together underneath the white plastic.  So are the holes in columns f, g, h, i, and j.  There are no connections across rows so that all the holes in row 1 are in no way connected to any of the holes in row 2 and so on.  Therefore you can think of the prototyping area as providing 126 (63 rows split in half by the trough) 5-way connectors for wires.  You'll make connections between these 126 regions using the pre-stripped wires in the bag in your kit.  These should be inserted as perpendicular as possible to the breadboard and should slide in and out with just a little force.  If you find that there is a lot of resistance in either direction, then please call over the TA or one of the lab staff.

Do not try to force anything larger than the pre-cut/stripped wires that we've provided into the holes, because this could damage the protoboard (at great cost).  Later in the quarter, you may need more wire.  It will be provided for you at that time.  When you strip the insulation from wires, make sure you don’t nick or cut the wire. Wires that break off in the prototyping board can ruin it, and you will be held responsible.

Before doing any work on the protoboard such as wiring and inserting/removing chips, be sure the power is OFF.  That is, unplug the power connector while you are constructing the circuit.  After you have finished wiring up your design and before you turn on the power, double check the power and ground connections.

Wiring Guidelines

• Arrange the IC chips on the protoboard so that only short wire connections are needed.  Put tightly connected chips closer together.
• Try to avoid a jungle of wires.  Long looping wires that go way into the air are easy to pull out (a hard bug to find later when the circuit doesn't work as intended).
• Try to maintain a low wiring profile so that you can reach the pins of the chips and so the chips can be replaced if necessary.  The best connections are those that lie flat on the board.

Using the Logic Probe

The logic probe provides a very convenient way to check the value of any signal in your circuit.  The probe has two lights, HI and LO, which indicate the value of the signal.  The logic probe responds to the input voltage in two ways depending on whether CMOS or TTL is selected.  We will use the TTL setting which lights the LO light for voltages <0.8v. and lights the HI light for voltages >2.3v.  If neither light is lit, then the signal is floating (i.e. not being driven by any active output) or has some value between 0.8 and 2.3v.


Tasks

  1. Use your logic probe to determine in which position the switches provide a 0 or 1.  Instructions for logic probe usage follow this diagram of your board and its connectors.

    Note that items circled in red, including Switch 8, Pushbutton 4, and LED 8, have special functions, and should not be used in this lab.


The large black bar just below the white breadboard area is connected to many of the devices on the XLA board.  Connect a wire from the VDD pin in this black bar to a 5-hole block on the breadboard, and connect another wire from GND to a different 5-hole block.  Place another wire in each of the new VDD and GND blocks on the board, and leave the other end of the wires dangling. Make sure they are far apart and don't ever touch, because this will short the power supply and could cause some smoke or bad odor as parts start to burn (should this happen, pull out the power cord immediately).   Clip the logic probe's two leads to VDD and GND. The red clip must be connected to VDD and the black to GND.  This is an important color convention to follow.  You have now successfully prepared your logic probe for use.

For now, we will simply use the logic probe to determine which switch positions correspond to digital high and low signals. Connect a wire from one of the switches in the black connector bar to a 5-hole block on the breadboard. Remember, SW8 is already in use, so do not use this switch.   You can now connect power to the board. Now, use the logic probe to "probe" the signal output by your switch; just (gently) press the tip of the probe in the same 5-hole block as the wire from your switch.  You should see either the probe's red or green light activate.  Flip the switch and note that the light should change as well.  Note which switch position corresponds to "high."

  1. Connect a switch to an LED.
    Pull out the board's power connection before changing anything -- safety first. We won't repeat this again, but you should always remove power before making any wiring changes and only reconnect it after you've double-checked that you've wired things correctly. 
    You can connect the switch and LED directly by just placing a wire between SW1 and LD1 on the black connector.  Alternatively, you could use wires to create connection points in the breadboard area.  Reconnect power and verify that the LED follows the switch.

  2. Place an inverter (NOT gate) between the switch and LED.
    Now, we'll place our first logic circuit onto the board.  Insert a '04 inverter package into an empty region straddling the trough on the breadboard.  Each pin of the chip is now connected to a 5-hole connection block on the breadboard.  Connect wires from the GND and VDD pins of the '04 to the ground and power connection blocks you set up for part 1.  Make sure to get the right pins: GND is pin 7, and VDD is pin 14 on the '04.  Use the chip maps to ensure you are doing the right thing and to choose a particular inverter of the 6 on this chip.  Connect the input of the inverter to SW1 and its output to LD1.  Now the LED should light up when the switch is in the opposite position of part 3.  Connect the output of your inverter into a second inverter's input and connect LD1 to this second inverter's output.  We are now back to where we were before.  As one would expect, two inverters logically cancel.

  3. Connect a two-input NOR gate to two switches and one LED. 
    Move the switches to all four possible position combinations and verify that the NOR gates works as you expected.

  4. Realize a circuit to detect the "jack of diamonds" using the encoding shown in CLD-II, Chapter 1, problems 3 and 4.

A) Encoding a deck of cards:

Observe that the cards come in groups of 13 (suit).  Therefore each card has 2 values that distinguish it: suit (Hearts,Clubs,Diamonds,Spades) and value (Ace,2,...,King). Since the suit can be one of four values, we need 2 bits to encode the suit (0, 1, 2, 3 assigned to clubs, diamonds, hearts, spades, respectively).  The value ranges from 1 to 13 (1=ace, 2, 3, ... , 10, 11=jack, 12=queen, 13=king).  Values of 0, 14, and 15 are unused.  Note that this encoding requires 6 bits:

V3 V2 V1 V0 S1 S0

In general, note that the higher-numbered subscripts denote higher-order (more significant) bits. By convention, bits progress, left to right, from most significant to least significant.

B) Using the encoding scheme above, design a circuit which recognizes the jack of diamonds.

The diamond suit is numbered 1 and the jack is the card with value 11 . Its encoding with this scheme is 1011 concatenated with 01 to yield 101101 or:

V3 and V2' and V1 and V0 and S1' and S0

 You will need to choose the appropriate gates to implement this logic, and you will have to do it in pieces (clearly, no single gate can implement the function directly).  You will use 6 switches and 1 LED for this part.  For the sake of your sanity and that of your TA, use SW1 through SW4 for the card value and SW5 through SW6 for the suit. 

Advice:

Show this last circuit to a TA, and they will "check you off" for this laboratory assignment. Additionally, they may ask you to show them your work and explain your circuit in detail, so be prepared. All future labs will follow this format.


Comments to: cse370-webmaster@cs.washington.edu