Вы находитесь на странице: 1из 10

ENG 1450 Introduction to Electrical and computer Engineering

Lab 10
Optical Loading of a Shift Register, and Packet Identification

Name:

_______________________________

Student Number:

_______________________________

Lab Section:

_______________________________

Instructor:

_______________________________

Date:

_______________________________

Build Quality (F / W / O) _________

_________________________
TA signature

Did students clean-up after the lab?

_________________________
TA signature

ENG 1450 - Lab 10


November 24, 2013-v1

Page 1

Background & Time Saving Advice:


Todays lab has two parts:
Part A: You will build a circuit to load data into an 8-bit shift register using an optical input.
Part B: The 8-bit data on the shift register has two parts. A 4-bit address packet and a 4-bit
data packet. You will build two combinational logic circuits to analyze the data.
****

You may want to divide your group into 2, with each sub-group building one of the 2
parts. You have 2 projects boards available to enable you to do this.

Part A:

Shift Register with Optical Data Input

You will use an 8-bit shift register today as a memory storage element. You will transmit the
data to the shift register optically. This concept is similar to a fibre optic communication system.
The shift register you will use to day is the 74HC164 serial in - parallel out shift register. The
term serial in means it has 1 input wire to load the data. The term parallel out means it has 8
output lines (one for each bit in the register), allowing you to easily see the value of each of the 8
bits. The pin-out for the 74HC164 shift register is shown in Figure 1.

Figure 1: Pin-out schematic for the 8-bit 74HC164 serial in - parallel out shift register chip.
Make the following connections to wire the shift register. ** Neat wiring is very important. **

For power connect 5 V to pin 14 and 0 V to pin 7.

Connect pin 2 and pin 9 to 5 V.

Pins 3 - 6 and 10 - 13 are the 8 memory bits of the register, designated QA to QH .

Pin 1 is the data input (A input) and is used to input data to the shift register.

Pin 8 is the clock (CLK). It is used to synchronize data movement in the shift register,
and between the registers various memory bits QA to QH .

ENG 1450 - Lab 10


November 24, 2013-v1

Page 2

The shift register operates as follows:

The data input enters at pin 1 (A input): 0 V for binary 0, and 5 V for binary 1.

When the clock is pressed (i.e. CLK goes from 0 V to 5 V) the following happens:
o The value of A (pin 1) is transferred to QA .
o The value of QA is transferred to QB .
o The value of QB is transferred to QC .
o The value of QC is transferred to QD .
o The value of QD is transferred to QE .
o The value of QE is transferred to QF .
o The value of QF is transferred to QG .
o The value of QG is transferred to QH .

Wiring the Clock:


Use a push button for the clock circuit. Wire the clock button as shown in Figure 2. Connect the
output VCLK to the CLK input (pin 8) of the shift register.

Figure 2: Clock button wiring.


1. Verify that the clock button is working ok. VCLK should be 5 V when pressed, and 0 V when
not pressed.
Button pressed:
Button not pressed:

ENG 1450 - Lab 10


VCLK = ______________ V
VCLK = ______________ V

November 24, 2013-v1

Page 3

Viewing the Memory Bits QA to QH


You will use LEDs to view the value of the 8 memory bits QA to QH , which are given by pins 3 6 and 10 - 13 of the shift register. You will use an 8 LED package to do this (this is faster to
wire up than 8 individual LEDs).

See figure 3. Identify pin 1 from the triangular notch on one of the corners of the 8 LED
package. All pins on this side are the current inputs to the LEDs. The pins on the other
side of the package are the LED current outputs. Connect them to a current limiting
resistor R, then to ground. R should be such that the current is limited to around 25 mA.
A value of R between 200 - 500 should be ok.

Figure 3: Wring the 8 LED package.


2. Verify that you have wired things ok. Apply 5 V separately to each of pins 1 to 8 of the 8
LED package, and you should see the respective LED light up.
Do all the lights work ok ? (Yes / No) ______________
If everything is ok, connect pins 1 - 8 of the 8 LED package to the shift register outputs for
memory bits QA to QH .
** Neat wiring is very important. **

ENG 1450 - Lab 10


November 24, 2013-v1

Page 4

Operating the Shift Register:


Test that your shift register is working ok.

Set the input A to be either binary 0 or 1, by connecting pin A to either 0 V or 5 V.

Press the clock button to load the data into QA of the shift register. LED#1 should be on
or off, as appropriate, depending on if the input A is binary 0 or 1.

Change the input A to another binary value.

Press the clock button again to load the data into QA . The data already in QA should shift
to QB . LEDs 1 and 2 should light as expected.

Play around with this for a while until you become familiar with how the shift register
works.

Note: If you want to clear the shift register, set the input A to 0, and press the clock 8 times.
**** Show the TA that your shift register works before you proceed any further. ****
Optical Data Transmission System:
You will need to put your optical light system in a dark box, so that the lights in the room dont
interfere with the optical data transmission, as shown in Figure 4.

Build your dark box out of cardboard.

For the pulsing light source, use a 12 V light bulb controlled by a switch.

Use a photoresistor as a light sensor. Implement the photoresistor in the shown voltage
divider circuit. Select a resistor R1 (in series with the photoresistor) such that when the
light is off Vout is a low voltage (close to 0 V), and when the light is on Vout is a high
voltage (close to 5 V). If you make R1 around 50 k probably it should work ok.

Figure 4: Optical data transmission set-up.


ENG 1450 - Lab 10

November 24, 2013-v1

Page 5

3. After you construct your dark box and light system, measure Vout when the light is on and off
to verify that everything is working ok.
Light off:

Vout = ______________ V

Light on:

Vout = ______________ V

Connecting to the Shift Register:


Connect Vout of the light sensor to the A input of your shift register. Test that your optical data
transmission system is working.

Set the input A to be either binary 0 or 1 using your light input circuit (i.e. light on / off).

Press the clock button to load the data into QA of the shift register. LED#1 should be on
or off, as appropriate, depending on if the input A is binary 0 or 1.

Change the input A to another binary value by turning the light on / off as needed.

Press the clock button again to load the data into QA . The data already in QA should shift
to QB . LEDs 1 and 2 should light as expected.

Continue loading data into the shift register to verify that everything is working ok.

4. Show the TA that your optically loaded shift register works.


_________________________
TA signature

ENG 1450 - Lab 10


November 24, 2013-v1

Page 6

Part B:

Logic Circuit to Identify Data and Address Packets

The 8 data pins in the 8-bit shift register are designated QA to QH , as shown in Figure 1. Let us
assume this data has 2 parts:

The first 4 bits (QA to QD) are for a 4-bit address packet. The address packet can be used
to identify which person/system on a network information is to be sent to, or was
received from.

The second 4 bits (QE to QH) are for a 4-bit data packet.

In todays lab, we will assume this addressing system is being used in a car, and so the 16
separate addresses identify which sensor in the car is sending data. These are shown in table 1.
We want to identify when the Battery voltage reaches a Too low level. Therefore, we need
to identify address packet 1001.
Table 2 is the battery voltage data table. We want to identify the data packet 1100, which
occurs when the battery voltage is Too low. Therefore, you need to build two logic circuits.
One to recognize the binary value 1001 and the other to recognize the binary value 1100.
Table #1: Address packets identifying sensors
Address Packet (QA to QD)

Sensor

0000

Left front wheel speed

0001

Right front wheel speed

0010

Left rear wheel speed

0011

Right rear wheel speed

0100

Oxygen sensor

0101

Inlet pressure

0110

Exhaust pressure

0111

Engine RPM

1000

Throttle position

1001

Battery voltage

1010

Oil pressure

1011

Oil temperature

1100

Fuel level

1101

Brake fluid pressure


Transmission
temperature
Transmission RPM

1110
1111

ENG 1450 - Lab 10


November 24, 2013-v1

Page 7

Table #2: Battery voltage data table.


Data Packet (QE to QH)

Battery Voltage

0000

unused

0001

14 V

0010

13.5 V

0011

13 V

0100

12.5 V

0101

12 V

0110

11.5 V

0111

11 V

1000

10.5 V

1001

10 V

1010

9.5 V

1011

9V

1100

Too low

1101

unused

1110

unused

1111

unused

Figure 5 shows the pin-outs for AND and NOT logic gate chips which you will use.

Figure 5: Pin-outs of the 7408 quad AND gate chip, and the 7404 hex NOT gate chip.

ENG 1450 - Lab 10


November 24, 2013-v1

Page 8

Figure 6 shows the logic gate circuit you will need to identify the binary value 1001. For the
other circuit, you will have to design it yourself. Each circuit should have a red colour LED at
the output, which should light up when the logic circuit shows a True value.

Figure 6: Logic circuit used to identify the binary value 1001.

5. Build the circuit of figure 6 to identify when the Battery voltage is addressed, the binary
value 1001. Test your circuit with the following voltages directly connected for inputs QA
to QD to test your circuit.

QA = 5 V, QB = 0 V, QC = 0 V, QD = 5 V.
Does your circuit light up for binary value 1001 ? (Yes / No) ______________

6. Build the circuit to identify the data is Too low, binary value 1100. Test your circuit
with the following voltages directly connected for inputs QE to QH to test your circuit.

QE = 5 V, QF = 5 V, QG = 0 V, QH = 0 V.
Does your circuit light up for binary value 1100 ? (Yes / No) ______________

7. Show the TA that these circuits work.


_________________________
TA signature

ENG 1450 - Lab 10


November 24, 2013-v1

Page 9

Connecting to the Shift Register:


When your group has finished part A, you can connect the outputs QA to QH of the shift register
to the inputs of the two logic circuits you have constructed.
Note: Keep the 8 LED package still connected to QA to QH of the shift register so you can see
what is happening.
Load the 8-bit data into the shift register using your optical input circuit, and verify that your
combinational logic circuits can identify when the Battery voltage (binary 1001) is Too low
(binary 1100).
8. Show the TA everything is working.
_________________________
TA signature

ENG 1450 - Lab 10


November 24, 2013-v1

Page 10

Вам также может понравиться