CS250 Lab 2

Introduction to the Hardware Lab

Here is the grading form that will be used.

Goal

In this lab you will learn how to use the protoboard and you will build your first hardware experiment.

1. The Protoboard

The protoboard or breadboard  is a base made of a matrix of sockets used to build temporal electronic circuits. Here is the picture of the protoboard you will use in this lab.

Protoboard(breaboard)

In the protoboard the 2 top and 2 bottomn rows are used for the power. The columns in the middle are connected according to the following picture.
proto connection

2. Implementing the Power Supply

You wil need to build a power supply to use in your hardware projects, The projects you will build use 5 volts. Since the battery set has 4 batteries of 1.5V in series for a total of 6V, you will use a regulator to reduce the voltage to 5 V. This is the diagram of th power supply:

Power Supply

Here is a picture of the implementation in the breadboard before connecting the batteries.
Protoboard Power Supply

Here is a picture of the implementation after connecting the batteries. Notice that the battery pins are connected to A1 and A6. After you connect all the components you should be able to turn on the led by moving the switch. Also notice that the power supply is connected to the top two rows and bottom two rows used for the power. Usually the LEDs need to be connected to a resistor to limit the current and not to damage the LED. However, the green and red LEDs provided in the kit  include the resistance internally so they can be powered with 5V directly.

PowerSupplyWithBatteries

We recommend that you place the different components first before doing all the wiring. Placing the components in the places suggested in the picture will make it easier to debug and get help from the instructors.The kit includes wire of different colors. You will use the wire strippers provided in the lab to cut the wires and remove the plastic from the conductor. Leave about 1/4 inch of coductor in each side. You may buy your own wire stripper tool to work wth your kit at home.

Use the cutter at the base of the pliers to cut the wire. To strip the plastic from the conductor select the 22AWG knob in the tool and press the wire with the hole at the top of the tool. Rotate the tool around the wire to cut the plastic and then pull out toward the end of the wire. If you need to put too much force to pull the plastic out, try rotating the tool 360% to cut the plastic first.

Stripping wire

stripped wire

3. Implementing the XOR Function Using Basic Gates

You will implent the XOR function using simple NOT, AND, and OR gates. The truth table of the XOR function is the following:

x
y
x XOR y
0
0
0
0
1
1
1
0
1
1
1
0

Using the 1s in the truth table we can build the XOR as

            x XOR y = xy'+x'y

where x' means NOT x.

We can implement the XOR using NOT, AND and OR gates in the following way:
XOR Diagram
 
In Binary logic a true value or 1 is represented as 5V and a false value or 0 is represented as 0V. Notice that the push button when not pressed gives a +5 V or 1 through the 10K resistor, and when pressed they give 0V or ground. That is why the switches output are represented as x' and y' that are the negated versions of x and y.

Here is the implementation of the push buttons.

Switches and gates

Using the slide switch power off the circuit before continuing building the circuit.

After this, connect the NOT, AND, and OR gate chips as shown in the picture. It might be difficut to read the labels in each chip so read the labels carefully. Notice that the dent in each chip is placed in the right. The little bubble in the left-bottom corner indicates the pin number 1. The datasheets for the three chips are located in NOT(MM74HC04), OR(MM74HC32N), AND(MM74HC08N). In the datasheets you can find the pin locations for the different gates.

Here is the pin assignment for the three chips.

not pin assignment

or pin assignment
and pin assignment
Connect the power for each chip. Pin 7 is connected to ground (-) and Pin 14 is connected to +5V. It is standard to use black wire for (-) and red wire for (+).

Notice that the LED has two terminals, one larger than the other one. The shorter one goes to ground (-) and the larger one goes to the output of the gate.

Your final implementation of the XOR gate should look like this.

 x=0, y=0, x XOR y = 0.
Final XOR 00


x=0, y=1, x XOR y = 1.
XOR01

x=1, y=0, x XOR y = 1.
XOR10

x=1, y=1, x XOR y = 0.
XOR11

To Bring to your Next Lab

For next lab you will modify the exisitng circuit to implement the following truth table for XNOR:

x
y
x XNOR y
0
0
1
0
1
0
1
0
0
1
1
1

You will bring:
  1. Your protoboard implementing the XNOR circuit. The PSO instructor will test your circuit.
  2. A printed symbolic diagram like the one above for the XNOR circuit.