Download Lab 4: Clocked Sequential Circuits, Counters | ECE 331 and more Lab Reports Electrical and Electronics Engineering in PDF only on Docsity!
Lab 4: Clocked Sequential Circuits: Counters Summary: Use the 7476 dual JK master-slave flip-flop and the 7493 4-bit binary counter to construct binary ripple counters.
Learning Objectives:
- Reinforce clocked sequential circuit design theory
- Experience construction of ripple counters and feedback control
Resources and Supplies:
- IC Data Sheets
- 7493 Binary Counter Data Sheet
- Wire cutters
- ICās kit
- 331 protoboard
- Power supply
- Logic probe
- Safety glasses (required!) Guides from previous labs are also available on the class website.
Important Reminders:
- Make sure you understand the interconnections in the protoboard. Refer to the Protoboard Guide.
- Bring your SRB to lab. Each student should always bring his/her own SRB.
- Pre-lab assignments must be completed before coming to the lab.
Background: Binary ripple counter: In a ripple counter, clock signals are cascaded (ārippledā) through a chain of flip flops, from the Q output to the next clock input, as shown in Figure 1. The output of each FF will toggle at ½ the frequency of its input clock, forming a sequence of outputs that represent a binary counter. A ripple counter is implemented using toggle FF functionality, which can be implemented with a T-type FF or derived from a JK FF. To configure a JK FF to operate as a T FF, note that when J and K inputs are both high, the output toggles each clock cycle. For more information, see http://www.allaboutcircuits.com/vol_4/chpt_11/2.html.
Figure 1. 2-bit binary ripple counter (source: allaboutcircuits.com ).
Divide-by-n counter: A divide-by-n counter is a counter that counts from zero to n-1 and then starts again from zero. The nth^ count is a transient event and will not be observed (will occur so fast you wonāt see it). The DM7493 IC is a 4-bit binary counter that counts to a maximum of 15 (n=16). The key to making DM7493 chip count to a number other than 15 is to use its own output lines (Qi) to reset (clear) the counter so it will start again from zero. Combinational logic implemented in this feedback loop enables counting to any number less than 16.
Pre-lab Assignment:
- Read this entire lab assignment so you know what to expect in the lab.
- Complete the steps described in the Pre-lab sheet near the end of this document. Each student must complete his/her own pre-lab before coming to the lab and hand it in to the lab TA at the beginning of the lab.
Laboratory Assignment: This lab consists of two parts. A check-off sheet is included at the end of this lab document.
- Print the check off sheet. Where indicated, you must record your results on the check-off sheet. After you successfully finish each part of the lab, show the TA your results and ask him to sign the check-off sheet.
Part 1: Hexadecimal ripple counter using JK flip-flops. Using four JK master-slave flip-flops (two 7476 ICs) you will build a 4-bit ripple counter. Preparation:
- Locate and remove the 4-bit binary counter and any other ICs you will need (according to your wiring plan) from the ICās kit. Use the IC Data Sheets document to verify part numbers.
- Place the IC chips on the protoboard as you have placed previous ICs.
- Referring to the pin out in the IC Data Sheets for each chip and your pre-lab wiring diagram, wire the ICs to form a 4-bit counter. Make sure you have properly connected all r eset inputs of the 4-bit counter IC so that they will not interfere with operation of your circuit.
- Connect the ICs to power (5V) and ground. Double check the pin out on the data sheet to ensure you are connecting the correct pins to power.
- Connect the four output lines of the counter (the Q output of each FF) to the four least-significant-bit LEDs on the SRB. In this manner, the binary count sequence, 00002 to 1111 2 will be displayed on the LEDs and the hexadecimal equivalent (0-F) will be displayed on the right-most 7-segment display. Note that the output of the first FF (closest to the clock input) will be the LSB of your 4-bit counter output. Check the DB connector pin out if necessary.
- Connect momentary contact switch line from the SRB to the clock input of the ripple counter circuit. It is useful to easily see what value the clock is set to, so add a connection from this SRB output to an LED on the SRB. As shown in the Figure 1 timing diagram, you can expect LSB Q output to toggle each time the clock input goes high.
- Connect the circuit output (4-bit) to the SRB inputs (LEDs) as you did in Part 1.
- Connect the clock input of the counter to the momentary switch to trigger the circuit.
Inspection & IC Testing Precautions Follow the circuit inspection and testing precautions detailed in Labs 2 and 3. Please refer back to those documents if you have any concerns.
Testing: The 4-bit output of the counter should be connected to four LEDs through the DB connector You will now test the circuit using the momentary switch as clock input then the 1 Hz clock generator.
- Without connecting the power supply to your protoboard or SRB, turn it on to set the proper voltage (approximately 8V). Turn it off, connect it to your protoboard and SRB, and turn then on the power supply to power up your circuits.
- Use the logic probe to test the values at each of the power supply pins. Also test each of the circuit inputs and ensure the observed value agrees with the value set on the SRB switches.
- Press the momentary switch and record the value displayed. Record the sequence of counting after each press of the momentary switch. Record a comment of your observations ādid it count properly? did it restart when it reached 10?
- If the observed sequence does not agree with the expected counting sequence, check connections and check your reset circuit design. Consult the TA if you can not get your results to agree.
- Turn off the power supply.
- Disconnect the clock input from the SRB momentary switch and reconnect it to the 1 Hz (1 pulse-per-second) clock output of the SRB. Turn the power supply back on.
- Record the counting sequence. If the observed sequence does not agree with the correct counting sequence, try to fix your problems and then repeat experiments. Consult the TA if you can not get your results to agree.
- When you are satisfied that the circuit is operating correctly, ask the TA to check a demonstration of your functioning divide-by-10 counter circuit.
Do not proceed until the TA has checked off on your previous circuit.
- Turn off power supply. Modify the reset logic of the divide by 10 counter so it becomes a divide by 12 counter. Refer to your pre-lab wiring diagram. This should be a simple modification. Leave the clock input connected to the 1 Hz (1 pulse-per- second) clock output of the SRB.
- Turn on the power supply and inspect your circuit to ensure all of the signals appear to be at the proper value and that it appears to be functioning correctly. Record your observations.
- Record the counting sequence. If the observed sequence does not agree with the correct counting sequence try to fix your problems and then repeat experiments. Consult the TA if you can not get your results to agree.
- When you are satisfied that the circuit is operating correctly, ask the TA to check a demonstration of your functioning circuit. Ask the TA to check off Part 2 on your lab check-off sheet.
Make sure your name is on the check-off sheet and turn it in to the TA.
Final Tasks and Notes
- Turn off the power supply and anything else that you might have turned on.
- Remove all wires and ICs from the protoboard, returning them to their storage locations.
- Return the protoboard, ICās kit and all tools you used to the lab closet.
- Clean up your lab bench area, removing any trimming to the trash can and any parts/components back to their proper location.
Discussion Points As explained in the Lab Report Guide , you should address these discussion points in a designated section of your report.
- Consider what might happen if the counter designed in Part 1 were used in a system with a very high frequency clock. Using the 7476 IC data sheet, what do you think the maximum reliable input frequency of the counter would be?
- Several semiconductor companies manufacture digital logic ICs. The 7493 data sheet provided with this lab describes chips from two companies (National and Phillips). Comment on the differences and similarities of these two chips. For example, could you substitute one for the other in a circuit without rewiring? Could you find any advantage of one over the other?
- To implement the feedback reset logic for the divide-by-n counters, most students will use all 4 outputs and a few logic gates. For divide by 10 and divide by 12 (and several other values but not all), the reset logic can be implemented with only a single logic gate. Describe how this can be achieved.
- Notice that the 7493 has two reset inputs. Based on your results from #2 above, can you think of a way to implement divide by 10 (1010 2 ) and divide by 12 (1100 2 ) without any external logic? Explain.
- Use the Wire Diagram Template to create the wiring diagram of a divide by 10 counter using the DM7493. Include the logic gate ICs and connections needed to form the reset logic. Be sure to label the ICs in your diagram. Bring your wiring diagram to lab with you and show the TA when you turn in your pre-lab but keep the diagram to use during the lab. Turn it in as an attachment to your Lab 4 report.
- Following the procedure in steps 3 and 4 above, create a wiring diagram of a divide by 12 (1100 2 ) counter that counts from zero to 11 and reset on 12. Use any type and number of gates to create the reset logic. You are not required to show the reset circuit schematic here, but you can draw it below if you would like (you will need to know what it is to complete this exercise). Your wiring diagram should include the DM7493 and all logic gate ICs and connections needed to form the reset logic. Show this to the TA when you turn in your pre-lab, and turn it in as an attachment to your Lab 4 report.
If you have not written or drawn anything on this page, you do not need to turn it in with your pre-lab.
LAB 4 CHECK-OFF SHEET
Student Name: ___________________________ Lab. Section (time): __________
Complete this sheet as you complete the lab. Remember to have the TA check off each section of the assignment. This sheet must be included in your lab report.
Part 1: Hexadecimal ripple counter using JK flip-flops
Step 8. What did you observe?
Step 9. What did you observe?
Step 10. Record counting sequence
Does it agree with the correct counting sequence? _________
Step 14. Record counting sequence
Does it agree with the correct counting sequence? _________
Part 1: TA sign off
Part 1: Hexadecimal ripple counter using JK flip-flops Initial____________
Part 2: Divide-by-n counter using a 7493 4-bit binary counter IC
Step 9. Record counting sequence
What did you observe? ________________________________________________