CHAPTER 11: Flip Flops

Similar documents
Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Decimal Number (base 10) Binary Number (base 2)

1. Learn about the 555 timer integrated circuit and applications 2. Apply the 555 timer to build an infrared (IR) transmitter and receiver

Counters and Decoders

EXPERIMENT 8. Flip-Flops and Sequential Circuits

The components. E3: Digital electronics. Goals:

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

Module 3: Floyd, Digital Fundamental

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

Lesson 12 Sequential Circuits: Flip-Flops

Table 1 Comparison of DC, Uni-Polar and Bi-polar Stepper Motors

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

So far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs.

Wiki Lab Book. This week is practice for wiki usage during the project.

Lecture 8: Synchronous Digital Systems

3-Digit Counter and Display

Lab 11 Digital Dice. Figure Digital Dice Circuit on NI ELVIS II Workstation

Digital Controller for Pedestrian Crossing and Traffic Lights

Digital Logic Elements, Clock, and Memory Elements

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

CS311 Lecture: Sequential Circuits

Accurate Measurement of the Mains Electricity Frequency

2 : BISTABLES. In this Chapter, you will find out about bistables which are the fundamental building blocks of electronic counting circuits.

PURDUE UNIVERSITY NORTH CENTRAL

ASYNCHRONOUS COUNTERS

Sequential Logic: Clocks, Registers, etc.

ECEN 1400, Introduction to Analog and Digital Electronics

Contents COUNTER. Unit III- Counters

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

A Digital Timer Implementation using 7 Segment Displays

GLOLAB Two Wire Stepper Motor Positioner

Physics 120 Lab 6: Field Effect Transistors - Ohmic region

The 104 Duke_ACC Machine

Asynchronous Counters. Asynchronous Counters

ENGI 241 Experiment 5 Basic Logic Gates

MIDECO 64-outputs MIDI note decoder USER MANUAL. Roman Sowa 2012

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Electronic Circuits Spring 2007

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

ARRL Morse Code Oscillator, How It Works By: Mark Spencer, WA8SME

A Lesson on Digital Clocks, One Shots and Counters

SEQUENTIAL CIRCUITS. Block diagram. Flip Flop. S-R Flip Flop. Block Diagram. Circuit Diagram

Pulse Width Modulation (PWM) LED Dimmer Circuit. Using a 555 Timer Chip

BUILD YOUR OWN RC SWITCH (Issue 3)

RLC Series Resonance

EXPERIMENT NUMBER 5 BASIC OSCILLOSCOPE OPERATIONS

LAB4: Audio Synthesizer

Build A Video Switcher. Reprinted with permission from Electronics Now Magazine September 1997 issue

Interfacing Analog to Digital Data Converters

A Lesson on Digital Clocks, One Shots and Counters

Sequential Logic Design Principles.Latches and Flip-Flops

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

ETEC Digital Controls PIC Lab 10 Pulse Width Modulation

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

Laboratory 4: Feedback and Compensation

Electrical Resonance

Cornerstone Electronics Technology and Robotics I Week 15 Voltage Comparators Tutorial

Low Cost Pure Sine Wave Solar Inverter Circuit

PLL frequency synthesizer

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Fig1-1 2-bit asynchronous counter

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

Step Response of RC Circuits

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Electronic WorkBench tutorial

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

Microprocessor & Assembly Language

7. Latches and Flip-Flops

NOTE: The Flatpak version has the same pinouts (Connection Diagram) as the Dual In-Line Package.

DEPARTMENT OF INFORMATION TECHNLOGY

Chapter 2 Logic Gates and Introduction to Computer Architecture

The Programming Interface

Digital Sampling Oscilloscope

Glolab Talking Phone Dial Monitor

Theory of Operation. Figure 1 illustrates a fan motor circuit used in an automobile application. The TPIC kω AREF.

Adding Heart to Your Technology

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

ECE124 Digital Circuits and Systems Page 1

Operational Amplifier - IC 741

(Refer Slide Time: 00:01:16 min)

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

= V peak 2 = 0.707V peak

Chapter 9 Latches, Flip-Flops, and Timers

Memory Elements. Combinational logic cannot remember

Operating Manual Ver.1.1

[F/T] [5] [KHz] [AMP] [3] [V] 4 ) To set DC offset to -2.5V press the following keys [OFS] [+/-] [2] [.] [5] [V]

Experiment #11: LRC Circuit (Power Amplifier, Voltage Sensor)

A-145 LFO. 1. Introduction. doepfer System A LFO A-145

1.1 The 7493 consists of 4 flip-flops with J-K inputs unconnected. In a TTL chip, unconnected inputs

Lab 5 Operational Amplifiers

Your Multimeter. The Arduino Uno 10/1/2012. Using Your Arduino, Breadboard and Multimeter. EAS 199A Fall Work in teams of two!

GLOLAB Universal Telephone Hold

Jianjian Song LogicWorks 4 Tutorials (5/15/03) Page 1 of 14

css Custom Silicon Solutions, Inc.

BINARY CODED DECIMAL: B.C.D.

Theory of Logic Circuits. Laboratory manual. Exercise 3

Transcription:

CHAPTER 11: Flip Flops In this chapter, you will be building the part of the circuit that controls the command sequencing. The required circuit must operate the counter and the memory chip. When the teach pendant connector is not plugged in, the counter will advance with each clock pulse, incrementing the instruction address provided to the memory chip with each clock cycle. Also, the read/write input to the memory chip must be set to a logic 1 for read, so the instructions can be transferred to the output lines for execution by the robot. When the teach pendant is plugged in, things are different. The counter must wait for an instruction to be written into the memory chip before it increments the address. Instructions for actions are programmed into the robot s memory by holding down appropriate command buttons on the teach pendant, and then pressing ENTER. The enter key is what tells the memory chip to write an instruction into the memory location indicated by the counter s current output (the address). Also, after an instruction set is written, the counter must increment the memory address by one, so that the memory chip will write the next instruction into the next address. The robot is design to be programmed (taught) sequentially via the teach pendant. It is not possible to load instructions in any random order. When the ENTER key is pressed, the read/write pin on the memory IC, which is normally at a logic 1 for read, will receive a short pulse to 0, so a write into memory will occur. 101

Background To fully understand how the timing control circuit works, we need to introduce another electronic device called a Flip Flop. There are several different kinds of flip flops, but only one kind is needed in your robot. All flip flops are storage devices for digital signals. Flip flops have outputs and inputs. In addition, they have a special input called a clock input. The output is updated every time the appropriate clock input is received. What the output is updated to is dependent upon the data input. The output holds onto its value (or state) between clock signals, even if the data input changes. One of the distinctions between logic such as NANDs and NORs and flip flops is that a flip flop cannot be characterized only in terms of its current inputs. One also needs to know what the input was at the time the previous clock edge occurred. The only time the data input matters is when the clock signals the output to update. The flip flop we will be using is called a D flip flop, and is shown schematically in Fig. 11.1. The data input goes to the D terminal. The clock input goes to the triangle. The output comes from Q or Q. This flip flop is positive edge triggered, which means that the output is updated every time the clock input changes from a logic 0 to a logic 1. The value of the Q output becomes whatever the value of the D input is at the time of the clock s rising edge. Q always has the opposite logic value of Q, and is provided as a convenience for building circuits. There are two more inputs; set (S) and reset (R). When either is at logic 1, regardless of the state of the clock, they override the D input and they make Q a 1 or 0, respectively. For the robot, both S and R will be grounded, and will thus have no impact on flip flop operation. The circuit you will be building in this chapter can be divided into three parts: enter key detector, counter clock driver, and memory chip driver. The output of the enter key detector is an input to the second and third parts. The counter clock driver allows the robot s clock signal to increment the counter when the teach pendant is not connected, and it allows the enter key to increment the counter when the teach pendant is connected. The memory chip driver does two things: it turns on the output data enable pin of the memory chip, and it sends a write pulse to the memory chip. The output of the enter key detector circuit is a 1 when the teach pendant is not plugged in. If it is plugged in, the output will be a 102 Chapter 11: Flip Flops

6 (8) 5 (9) D S Q 1 (13) 3 (11) CLK R _ Q 2 (12) 4 (10) Figure 11.1 The D Flip Flop zero, unless you push ENTER, in which case the output will be a 1 for one clock period, allowing the counter to increment once. It will then return to zero, where it waits for the next ENTER command. The enter key detector is shown in Fig. 11.2. The clock signal comes from the robot master clock. If the teach pendant is not plugged in, then point C stays at 0V, the right NAND has a zero input, and the output of the circuit at A is a logical 1 (5V). If the teach pendant is plugged in, then point C is pulled up to 5V, and the output of the right NAND, A, is the logical opposite of the output of left NAND. This means that A is a 1 only if both inputs to the left NAND are a 1. This only happens when a 1 has come out of the first flip flop, but has not entered the second flip flop yet. As a result, the output of the circuit is a 1 for exactly one clock period after the ENTER button is pressed. A 1 does not appear at the output of left NAND again until the ENTER button is released and pressed again. The counter clock is driven by E in Fig. 11.2. This uses the output, A, from the enter key detector, and the robot s clock in order to control the counter. Whenever the teach pendant is unplugged, A is high so the robot clock is fed through the NAND gate to E. This means that the output of the NAND gate is the opposite of the clock signal at any point in time. As we saw previously, the RC circuit with R7 and C7 will simply delay the rising and falling edges of the Digital Laboratory Exercises 103

+5V ENTER Teach pendant B R10 15K 100K R9 3 5 7 D C Q 1 9 +5V D C 14 Clock input _ Q 11 12 2 4 6 8 10 1 5 6 3 12 13 R7 1.8KΩ 4 C7 6800pF Output E Output A 11 C Clock input R5 15K Figure 11.2 Enter Key Detector. clock. When the counter receives a falling edge (its clock input transitions from high to low) then it adds one to the count. Note, the small time delay caused by R7 and C7 is important when the teach plug is attached because the memory is addressed by the counter, and the address cannot change as the data is being loaded into the memory. When the teach pendant is plugged in, point A remains at zero except for 1 clock cycle after the ENTER button is pushed. Therefore, the output of the NAND gate, pin 4, is a 1 regardless of the clock. So, the counter doesn t change. When the ENTER Key is pushed, point A becomes a 1 for one clock period, and one clock pulse goes through to the counter, incrementing it once, making it ready for the next time an enter is pushed. As we shall see in the third part of this lab, the delay allows the instruction to be written into memory before the address, as indicated by the counter, is incremented. The third part of the circuit, the memory chip driver, is shown in Fig. 11.3. Once again, point A is used as the input. There are two outputs. One output goes to the output data enable pin of the memory chip which acts as an output enable causing the memory chip to transfer its internal stored bits to the output pins. The other output goes to the read/write pin. When the teach pendant is not plugged in, point A is a 1, so B is a 0. This causes the memory 104 Chapter 11: Flip Flops

chip to place data on the outputs (output enable is active low which means that the output is enabled if the voltage on that input is low and disabled if it is high). When the teach pendant is plugged in, and before an ENTER is pressed, point A goes low, B goes high, data ready turns off, but the output, F, remains high (telling the memory to read). When ENTER is pressed, a series of events illustrated in Fig. 11.3 causes a zero pulse to come out of F. The lower half of Fig. 11.3 is called a timing diagram, where the voltage at each point is plotted against the same time axis. In this way, you can get a big picture as to what is happening. Laboratory Exercises 1. Test both of the flip flops in the 4013. Wire the two clock inputs together, the D inputs together, the set inputs together, and the reset inputs together. Simulate the data input by wiring the D input (Pin 5 or 9) to either ground or +5V. That is, to make a logic 0, connect the pin to ground. To make a logic 1, connect the pin to 5V. Connect the set and reset pins to ground. Connect the power and ground pins to +5V and 0V respectively. Construct four LED indicator circuits as shown in Fig. 11.4. Note, you may use 1K resistors in place of the 330Ω resistors shown in the figure. Connect one to the Q output of the flip flop you are testing and one to the Q output, connect the third one to the D input, and the last one to the clock input. Adjust your function generator to provide a 0V to 5V square wave at a frequency of 1.0Hz (one pulse every second). Connect the function generator ground to circuit ground and the function generator signal to the clock inputs of the D flip flop (Pin 3 and 11). By moving the wire between +5V and ground, set the D input high or low. Check that the Q output responds. 2. Build the circuit of Fig. 11.2 on your protoboard. Note, only pins 2 and 13 of the 4013 should remain unused. Simulate the teach pendant by connecting two wires, one from each of the round bubbles on Fig. 11.2 to either +5V or open (disconnected). Once again, use the function generator as set up in step 1 for the clock Digital Laboratory Exercises 105

input. Attach an LED and resistor as shown in Fig. 11.4 to output A in Fig. 11.2. Check the A output first with both wires open. 3. Connect point C (R5 and pin 13) to +5V, to simulate the teach pendant being plugged into the robot. Leave the wire connected to R10 open, which simulates the case where the ENTER key is not activated. 4. Now connect the wire on R10 to +5V to simulate pressing the ENTER key. 5. Open the wire simulating the ENTER key. 6. Verify that point E is an inverted version of the clock when the teach pendant is disconnected (Point C open) and that it stops following the clock when the pendant is connected (Point C wired to +5V). Note, because of the low frequency of the function generator, you will not be able to see the slight delay on the scope. Don t worry, it is there. 7. Construct the circuit shown in Fig. 11.3. Connect the function generator, with its frequency raised to 55Hz, to the A input on Fig. 11.3. 8. Look at the input (A) and the output (F) of Fig. 11.3 simultaneously by using both channels of your scope. Determine the time delay between the low-to-high transition of point A, and the start of the output pulse. Also, determine from the oscilloscope the duration of the output pulse. 9. Install these components on the robot PC board. Note that the NAND chip used for the restart circuit has two of the NAND gates you need to build the timing circuits. To test the timing circuit, we must install the teach pendant connector onto the robot. Follow the keypad assembly instructions in the Graymark robot assembly manual. You may wish to assemble the keypad before you come to class. Then set the +20V part of your power supply to +9V and attach it to the +9V pin of the robot PC board next to R9. Attach the power supply common to one of the GND pins of the robot PC board. Check that the output of your voltage regulator is still +5V when SW1 is on. Note, you can observe the output of the counter clock driver by sticking a resistor into pin 10 of the 16 pin socket and grabbing that resistor with a scope probe. Similarly, look at pins 18 and 20 on 106 Chapter 11: Flip Flops

the 22 pin socket with the resistor to observe the action of the memory driver circuit. Check all 3 points with the teach pendant disconnected, and connected, and connected with the enter key depressed. These circuits should perform just as they did on the protoboard. The pulse at pin 20 of the memory chip is quite short and only occurs when the enter key is pressed. Although you may not be able to see it on the scope, you can still verify that a pulse occurred because the scope will trigger and a trace will be drawn. To use this feature of the scope requires switching the trigger mode from auto to norm. If you are uncertain about this refer back to the description of the scope in the Motor Driver Lab. If there is a problem, identify and fix it, and then explain what went wrong. If you cannot solve the problem ask your TA for help. Digital Laboratory Exercises 107

8 220K 6800pF 1 5 A 10 B C 3 E A B B R1 D 9 2 6 6800pF C5 51K C4 R6 4 F To Output Data Point A Voltage level B C D E F Figure 11.3 Timing Control Diagram Output R=330 Ω LED Figure 11.4 Using an LED to construct a digital signal indicator. 108 Chapter 11: Flip Flops

+5V 1 2 3 Q1 _ Q1 Clk1 4013 2 D Flip Flop Q2 _ Q2 13 12 14 4 Reset1 Clk2 11 5 D1 Reset2 10 6 Set1 D2 9 Set2 7 8 Figure 11.5 Pinout for the CMOS 4013 D flip flop. Digital Laboratory Exercises 109

110 Chapter 11: Flip Flops