8 Flip-Flops. NOTE: The PRELAB for this lab has Altera MAXPLUS simulation requirements. See the Prelab sheets for more information.

Similar documents
Lesson 12 Sequential Circuits: Flip-Flops

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

Memory Elements. Combinational logic cannot remember

Module 3: Floyd, Digital Fundamental

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

CHAPTER 11: Flip Flops

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

Chapter 9 Latches, Flip-Flops, and Timers

Counters and Decoders

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

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

Lecture-3 MEMORY: Development of Memory:

Master/Slave Flip Flops

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

Asynchronous Counters. Asynchronous Counters

Counters & Shift Registers Chapter 8 of R.P Jain

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

BINARY CODED DECIMAL: B.C.D.

ECE380 Digital Logic

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Chapter 8. Sequential Circuits for Registers and Counters

Sequential Logic Design Principles.Latches and Flip-Flops

Lecture 8: Synchronous Digital Systems

Contents COUNTER. Unit III- Counters

EXPERIMENT 8. Flip-Flops and Sequential Circuits

DEPARTMENT OF INFORMATION TECHNLOGY

Sequential Logic: Clocks, Registers, etc.

Engr354: Digital Logic Circuits

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.

CHAPTER 11 LATCHES AND FLIP-FLOPS

Flip-Flops and Sequential Circuit Design. ECE 152A Winter 2012

Flip-Flops and Sequential Circuit Design

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

CS311 Lecture: Sequential Circuits

Combinational Logic Design Process

The components. E3: Digital electronics. Goals:

Theory of Logic Circuits. Laboratory manual. Exercise 3

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

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

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

ASYNCHRONOUS COUNTERS

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

PURDUE UNIVERSITY NORTH CENTRAL

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

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

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

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

ENGI 241 Experiment 5 Basic Logic Gates

Flip-Flops, Registers, Counters, and a Simple Processor

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

7. Latches and Flip-Flops

Digital Logic Design Sequential circuits

Modeling Latches and Flip-flops

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

Upon completion of unit 1.1, students will be able to

Chapter 2 Logic Gates and Introduction to Computer Architecture

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

Digital Controller for Pedestrian Crossing and Traffic Lights

DATA SHEETS DE COMPONENTES DA FAMÍLIA LÓGICA TTL GATES AND INVERTERS POSITIVES NAND GATES AND INVERTERS DESCRIÇÃO

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

DM74LS112A Dual Negative-Edge-Triggered Master-Slave J-K Flip-Flop with Preset, Clear, and Complementary Outputs

Modeling Registers and Counters

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

Digital Logic Elements, Clock, and Memory Elements

Lab 1: Study of Gates & Flip-flops

Digital Electronics Detailed Outline

Copyright Peter R. Rony All rights reserved.

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

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

Digital circuits make up all computers and computer systems. The operation of digital circuits is based on

Digital Fundamentals

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Operating Manual Ver.1.1

Chapter 5. Sequential Logic

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute 5. LECTURE: REGISTERS AND RELATED

Fig1-1 2-bit asynchronous counter

Set-Reset (SR) Latch

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

The enable pin needs to be high for data to be fed to the outputs Q and Q bar.

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute. 2nd (Spring) term 2012/2013

List of Experiment. 8. To study and verify the BCD to Seven Segments DECODER.(IC-7447).

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

Layout of Multiple Cells

Design: a mod-8 Counter

CSE140: Components and Design Techniques for Digital Systems

DATA SHEET. HEF40193B MSI 4-bit up/down binary counter. For a complete data sheet, please also download: INTEGRATED CIRCUITS

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

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

DM7474 Dual Positive-Edge-Triggered D-Type Flip-Flops with Preset, Clear and Complementary Outputs

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

RUTGERS UNIVERSITY Department of Electrical and Computer Engineering 14:332:233 DIGITAL LOGIC DESIGN LABORATORY

Asynchronous counters, except for the first block, work independently from a system clock.

Multiplexers Two Types + Verilog

[ 4 ] Logic Symbols and Truth Table

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

Fundamentals of Digital Electronics

Obsolete Product(s) - Obsolete Product(s)

Lab 1: Introduction to Xilinx ISE Tutorial

Transcription:

8 Logic elements that process memory - circuits that retain their output even though their inputs change - are introduced. These single-bit logic elements, called flip-flops or latches, are available in various types. Those examined are: D flip-flops JK flip-flops SR latches Flip-flops or latches such as these can be used to form registers capable of holding or manipulating multiple bits of data. A serial-in, parallel-out register is studied. NOTE: The PRELAB for this lab has Altera MAXPLUS simulation requirements. See the Prelab sheets for more information. 1

I. D Flip-Flop. The 7474 has two D-type flip-flops on the same chip. This section will use only one of these two flip-flops. A. Asynchronous Preset and Clear (fill out Table I.A on lab data sheet) 1. Connect power and ground to a 7474. Connect (pin 5) to DI-1 and ' (pin 6) to DI-2. is the output of the flip-flop and ' is the complement of the output. 2. Connect DS-1 to PR (pin 4) and DS-2 to CLR (pin 1). Set both data switches high. 3. The preset and clear inputs are active low. To see how this works, toggle DS-1 (change it from high to low to high) with DS-2 remaining high. This presets the flip-flop. should be a 1 and ' should be a 0. 4. Toggle DS-2 with DS-1 remaining high. This clears the flip-flop. should be a 0 and ' should be a 1. 5. The clear and preset inputs are usually used during a system initialization and must remain high for normal flip-flop operation. Practice presetting and clearing the flip-flop a few more times. B. Normal Operation Using the D and Clock Inputs (fill out Table I.B on lab data sheet) 1. Connect DS-3 to the D input (pin 2) and DS-4 to the clock input (pin 3) of the flip-flop. Set both DS-3 and DS-4 low. 2. Use DS-1 to preset the flip-flop. Make sure is a 1, also that DS-1 and DS- 2 are high after presetting. 3. The 7474 is a positive edge-triggered device which means that data is only transferred from the D input to the output when the clock makes a low to high transition. With the D input remaining low, change the clock from low to high. Notice that the state of has changed from 1 to 0. ' has also changed. 4. Change the D input to a 1 and change the clock from a 1 to a 0. Notice that the state of did not change to the input present at the D input since the proper clock transition was not provided. Change the clock back to a 1 and notice that changes to a 1. 5. Practice making a 1 and a 0 by changing the state of the D input and toggling the clock. C. D Flip-Flop Truth Table Inputs (fill out Table I.C on lab data sheet) 1. One way of presenting the truth table for a D-type flip-flop is given in your TTL Data Book. Another way is presented below. 2

2. The state of (1 to 0) before the positive clock edge occurs is called the present state. The state of after the clock edge is called the next state. The present state can be denoted by and the next state by +. A positive edge at an input is denoted by an arrow in the upward direction. Complete Table 1 below for the D flip-flop. 3. Table 1 is only valid if the preset and clear inputs are held high. Construct a new table for the D flip-flop with two columns added, one for preset and one for clear. Have the instructor check this truth table. 4. Inputs which are left unconnected are said to be floating. A floating input normally floats high in the TTL logic family. This allows the preset and clear inputs of the D flip-flop to be left unconnected for normal operation in most cases. However, in some instances, floating inputs may not float high. If the preset and clear inputs are left unconnected and they do not float high, then the flip-flop will not operate properly. Since there is no way to be sure which way an input will float, the preset and clear inputs should always be connected to a logic high. This can easily be done by using a data switch. D CLOCK + 0 0 0 1 1 0 1 1 II. JK Flip-Flop Table 1 D Flip-Flop Truth Table. Like the 7474, the 74109 has two flip-flops on the same chip. The difference is that the 74109 has two JK flip-flops. Use only one of these flip-flops in this part of the experiment. A. Asynchronous Preset and Clear 1. Connect power and ground to the 74109. Notice that these connections are different from other chips. Connect and ' to data indicators. Connect DS-1 and DS-2 to the preset and clear inputs. Perform the same operations with the preset and clear inputs of the JK flip-flop as was done with the D flip- flop. B. Normal operation using the J, K, and Clock Inputs 1. The JK flip-flop is a positive edge-triggered device which means that the outputs, and ' will only be affected by the J and K inputs when a low to high transition is produced at the clock input. Note that for the 74019 the J input is high true, the K input is low true (note the bar over the K input in the 74109 data sheet). Use a 7404 inverter to invert the switch input to the 3

K input so that both J and K are high true inputs. You may have a 7476 in your parts kit instead of a 74019 - a 7476 also has two JK flip-flops, but both J and K are high true inputs so you would not need the inverter with a 7476. 2. The JK flip-flop operation is as follows (assuming that both J,K are high true - 0 = L, 1 = H): a. J=0, K=0 : No Change. will not change state (neither will ') when a negative edge is supplied to the clock. b. J=0, K=1 : Go to 0. will become a 0 (' goes to 1) when a negative edge is supplied to the clock. c. J=1, K=0 : Go to 1. will become a 1 (' goes to 0) when a negative edge is supplied to the clock. d. J=1, K=1 : Complement. gets the complement of its previous state (as does ') when a negative edge is supplied to the clock. C. JK Flip-Flop Truth Table III. SR Flip-Flop 1. Consult the TTL Data Book for one version of the JK flip-flop truth table. 2. Construct a truth table similar to the one which was made for the D flip-flop (fill out Table II on lab data sheet). Include columns for J, K, the clock,, preset, clear, and +. Have the instructor check your truth table.. A. The SR flip-flop operation is as follows (there is no clock): 1. S=0, R=0 : No Change. will not change state (neither will ') 2. S=0, R=1 : Reset. gets reset (goes to 0). will be a 1. 3. S=1, R=0 : Set. gets set (goes to 1). ' will be a 0. 4. S=1, R=1 : Not allowed. B. NOR Implementation 1. Connect the circuit shown in Figure 1. Use DS-1 for S, DS-2 for R, DI-1 for, and DI-2 for '. 4

S ' R Figure 1 2. Set S to 0 and R to 1. This resets the flip-flop which means that is a 0 and ' is a 1. This will always be the case when S=0 and R=1 regardless of the previous state of. 3. Go from S=0 and R=1 to S=0 and R=0. stays at 0 because SR=00 is the no change input combination and the previous state of was a 0. 4. Set S to 1 and R to 0. This input combination sets the flip-flop (=1, i=0) regardless of the previous state of. 5. Go from SR=10 to SR=00. This time stays at 1 which confirms that does not change state if S and R are 00. 6. Set S to a 1 and R to a 1. This input combination is disallowed since and ' are both 0 and are not complements of each other. This input combination should always be avoided. 7. Do steps 2 through 5 a few more times to get the feel of the operation of the SR flip-flop. Include changing S and R from 01 to 10 and from 10 to 01. C. NAND Implementation 1. Connect the circuit shown in Figure 2. Use DS-1 for S, DS-2 for R, and DI- 1 for, and DI-2 for '. Notice that this implementation is different from the previous one in that S feeds into the gate whose output is and R feeds into the gate whose output is '. S R ' Figure 2 2. Repeat steps 2 through 5 of the previous section to verify that this implementation of the SR flip-flop is equivalent to the NOR implementation. 3. Set S and R to 11 and notice that and ' are once again not complements of each other, but this time they are both equal to 1. This is the only 5

difference in the two implementations, but causes no problem since SR=11 is a disallowed input combination in both cases. D. SR Flip-flop with Enable 1. Connect the circuit of Figure 3. Use DS-1 for S, DS-2 for R, DS-3 for Enable, DI-1 for and DI-2 for '. S Enable R Figure 3 2. Enable=1 enables the S and R inputs. To see what this means, set enable high and verify that the circuit works exactly like the circuit of Figure 2. 3. Enable=0 disables the inputs. Show this by setting enable low and changing the S and R inputs. Notice that the outputs will not change regardless of what changes occur at S and R. E. SR Flip-flop Truth Table 1. Make out a truth table for the SR flip-flop with the enable. Include columns for S, R, Enable, and +. 2. Consult the TTL Date Book for the truth table of 74LS279 which is a quadruple SR Latch. IV. Serial-in, Parallel-out, Shift Register. ' A. A serial-in, parallel-out, shift register has one data input line and multiple data output lines. Such a shift register with four outputs is shown in Figure 4. Connect this circuit. 6

DI-1 DI-2 DI-3 DI-4 DS-1 DS-2 D PRE D PRE D PRE D PRE CLK CLK CLK CLK CLR CLR CLR CLR DS-3 DS-4 Figure 4 V. Report B. Use DS-1 and DS-4 to clear all four flip-flops. C. DS-2 is the data input line. Set DS-2 high. DS-3 is used to provide clock pulses. Toggle the clock several times to see the results. Change DS-2 to a 0 and toggle the clock several more times. Continue to toggle the clock, but change the logic level of DS-2 after each clock pulse to further understand the operation of this type of shift register. Have the instructor verify the operation of your shift register.. Include only the following sections of this experiment in the laboratory report: A. Section I. C.3 B. Section II.B D. Section II.C.2 E. Section III.B 7

PRE LAB DATA SHEET TA CHECKOFF ANSWER THE FOLLOWING UESTIONS : 1. Give an example of a level sensitive storage device (a latch), and an edge sensitive storage device (a flip-flop). Explain the operation of each (draw timing diagrams). 2. What do Preset, Set and Clear do to a flip-flop? These are called Asynchronous inputs. How are they different from a Synchronous input? 3. How are the NOR implementation and the NAND implementations of an SR latch functionally different? 4. Locate the datasheets for the 74LS74, 74LS76 (or 74LS109, whichever one is in your parts kit), and 74LS279 devices and have them with you in lab. 5. ALTERA MAXPLUS REUIREMENTS: The ZIP archive with this lab contains an incomplete schematic called fig4.gdf. Complete this schematic so that it corresponds to Figure 4 (see Part IV). Simulate this circuit using the provided fig4.scf waveform file and verify it produces the results that you expect. You should have a screenshot of your schematic + simulation at the beginning of lab or demo the design for the TA using a portable PC at the beginning of the prelab. ALTERA SIMULATION CHECKOFF (TA Signature): 8

LAB DATA SHEET TA CHECKOFF I. D FLIP-FLOP A. B. PRE CLR / PRE CLR D CLK / 1 1 1 1 0 0 0 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 0 C. PRE 0 1 0 1 1 1 1 1 CLR 1 0 0 1 1 1 1 1 CLK x x x 0 D x x x 1 1 0 0 x 1 0 1 1 0 1 0 + 0 0 II. J-K FLIP-FLOP (assuming both JK are high true) PRE 0 1 0 1 1 1 1 1 1 1 1 CLR 0 0 1 1 1 1 1 1 1 1 1 CLK x x x J x x x 0 0 1 1 0 0 1 1 K x x x 0 0 1 1 1 1 0 0 0 1 0 1 0 1 0 1 + III. S-R FLIP-FLOP NOR NAND SR with Enable S R Enable 0 0 1 0 1 1 1 0 1 1 1 1 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 0 1 1 1 1 1 9

IV. SERIAL IN, PARALLEL OUT SHIFT REGISTER INPUT OUTPUT PRE D CLK CLR DI1 DI2 DI3 DI4 0 x x 0 0 x x 1 1 x x 0 1 x x 1 In your lab report, discuss the following: 1. How does the Enable affect your SR flip-flop? (1) 2. What is a serial-in, parallel-out shift register? Explain how the data is shifted using a timing diagram as described below. Make sure you use ENOUGH clock cycles to show the nature of the circuit. (5) 3. How do you clear all the flip-flops in the shift register? (1) PRE CLR D CLK 1 2 3 4 10