CS2813 Lab 9 Weird Counters

W
Shared by: dffhrtcv3
Categories
Tags
-
Stats
views:
1
posted:
12/18/2011
language:
English
pages:
3
Document Sample
scope of work template
							                 CS2813 Lab 9: Weird Counters


                                November 13, 2009

Preparation Before the Lab: Review the section on BCD to 7-segment
decoders in Tokheim, and review the Tokheim section on serial-in, parallel-out
(SIPO) shift registers. (See also class slide 93.)
   The 74LS47 has an unusual kind of output, called an “open-collector out-
put”. This means that it is able to produce a very strong L, but cannot produce
a H. If a light (eg LED) is connected between the output and +5V, when the
output is L, current flows through the LED and it shines.
   Look up the following chips: 74LS164, 74LS86, 74LS47.

Background on LFSRs: (See also the Wikipedia entry http://en.wikipedia.
org/wiki/Linear_feedback_shift_register)
   A device called a “linear feedback shift register” (LFSR) arises when you
take a Serial-In-Parallel-Out (SIPO) shift register, and arrange for its serial
input to be the XOR of some of its parallel outputs. These devices can be
viewed as a kind of counter with a weird count sequence. (In fact, they’re so
weird that they are sometimes used as random-number generators.)
   In our case, we will build a 7-bit LFSR. The Serial-In value with be the
XNOR (note the change: perhaps technically we won’t really have a LFSR) of
the two bits that are “about to fall off the end of the shift register.” In other
words, if you number the FFs A through G, with A receiving the Serial-In value,
then Serial-In = QF ⊕ QG .
   Why a 7-bit LFSR? After all, the 74LS164 is an 8-bit shift register. . . Well,
you only have 7 LEDs on which to watch the count sequence.
   Recall that XNOR(a,b) = XOR(1, XOR(a,b)).

Background on 7-segment LED Displays (See also http://en.wikipedia.
org/wiki/7-segment_display)
    As in Tokheim, a 7-segment decoder takes a BCD value and produces the
outputs to drive a 7-segment display. The 7-segment displays for the lab are
“common-anode”, which means that all 7 lights (called ’a’ through ’g’ in the
data sheet for the 74LS47) share a common connection, through which you
supply +5V through a 270Ω resistor. The “other end” of each light has its own
pin. If that pin is pulled down to 0V, current will flow and the light gets bright.
The purpose of the 270Ω resistor is to limit the amount of current that can flow,
so that the lights don’t burn out. Note that the outputs of the 74LS47 are open
collector, and thus they are very good at (when activated) pulling down to 0V.
    Unfortunately, if several lights have their “other ends” pulled down at the
same time, they have to share this limited amount of current. Thus, when most
of the segments are “on” (eg, displaying a 0), each light is rather dim1 .
  1 There is a better way, where we use a separate resistor for each “other end” and tie the

common anode directly to +5V. The lab does not own enough resistors to do this, though!


                                             1
   The seven-segment display’s pins are numbered differently than the lab chips.
The decimal point is closest to pin 6 and furthest from pin 1. Pins are numbered
clockwise starting from pin 1.
   The following table shows what each pin is connected to.
 Pin Number What it controls
            1 g
            2 f
            3 the common anode
            4 a
            5 b
            6 decimal point, ignore
            7 c
            8 internally tied to pin 3
            9 d
           10 e

Lab Activities:
  1. Do the usual things with power and ground for the two chips.
  2. Connect the first 7 outputs of the 74LS164 to LEDs.
  3. Connect the protoboard’s clock to the clock input of the 74LS164.
  4. Do something appropriate with the CLR input to the 74LS164.
  5. Use the XOR to implement an inverter, and make a “Johnson counter”
     by connecting QG to the serial input(s) of the 74LS164.
  6. Count the number of states before the Johnson counter repeats itself.
     Record the result and get it initialled.
  7. Build the circuit to compute the XNOR of QF and QG ; connect it so that
     QF ⊕ QG is fed serially into the 74LS164.
  8. Ensure that the device appears to be cycling through many different pat-
     terns. Record (in a table) the first six patterns, starting with 0000000.
  9. Starting from 0000000, count the number of clock cycles that elapse before
     the pattern 0000000 occurs again. Record this. Get your observations
     initialled.
 10. Crank up the clock speed and enjoy the light show. . .
 11. Connect QE , QF , and QG so that the three-digit binary number is dis-
     played (in decimal) on the LED display. For instance, if QE = 1 and the
     others are 0, a ’4’ will be displayed. (The 74LS47 wants a 4-bit BCD code
     and you want to feed it 3 bits, with a leading 0. So connect D to ground.)
     Ie, connect three wires from the 74LS164 to the 74LS47. Connect a
     through g from the 74LS47 to the 7-segment display, and connect either
     pin 3 or pin 8 of the display to +5V via the 270Ω resistor.
 12. Question: Did you do anything with the RBI, LT, or BI inputs? Explain
     why what you did is correct (better than “it works!”).
 13. Write down the first 20 digits you see after a reset. Make sure to record
     duplicates. Get the results initialled.
 14. Question: how can you be certain that your circuit will never begin (and
     continue) printing the digits of π?
   For the writeup, fill in the “standard lab forms” (as in Lab 1) and include
extra pages for diagrams, etc., as required.

						
Other docs by dffhrtcv3
PowerPoint Presentation - chrissnijders.com
Views: 2  |  Downloads: 0
PowerPoint Presentation - Child and Me
Views: 8  |  Downloads: 0
PowerPoint Presentation - Arab States
Views: 3  |  Downloads: 0
PowerPoint Presentation - CDM Pakistan
Views: 1  |  Downloads: 0
PowerPoint Presentation - Asianet.fi
Views: 1  |  Downloads: 0
PowerPoint Presentation - ANU
Views: 1  |  Downloads: 0
PowerPoint Presentation - Anglo Irish Bank
Views: 2  |  Downloads: 0
PowerPoint Presentation - Aimhigher
Views: 1  |  Downloads: 0