background image


Valid XHTML Web Page

Do you like our Site?
Help us to Share It

Bookmark to: Google Bookmark to: Yahoo Bookmark to: Digg Bookmark to: Del.icio.us Bookmark to: Technorati
Bookmark to: Facebook Bookmark to: Reddit Bookmark to: StumbleUpon Bookmark to: Slashdot Bookmark to: Newsvine
Bookmark to: Propeller Bookmark to: Furl Bookmark to: Blinklist Bookmark to: Simpy


Electronics Tutorial about SR NAND Gate Flip-Flops
 

SR Flip-Flop

Navigation
Page: 1 of 6

Sequential Logic Basics

Unlike Combinational Logic circuits that change state depending upon the actual signals being applied to their inputs at that time, Sequential Logic circuits have some form of inherent "Memory" built in to them and they are able to take into account their previous input state as well as those actually present, a sort of "before" and "after" is involved. They are generally termed as Two State or Bistable devices which can have their output set in either of two basic states, a logic level "1" or a logic level "0" and will remain "Latched" indefinitely in this current state or condition until some other input trigger pulse or signal is applied which will change its state once again.

Sequential Logic Circuit

Types of Sequential Logic Circuits


The word "Sequential" means that things happen in a "sequence", one after another and in Sequential Logic circuits, the actual clock signal determines when things will happen next. Simple sequential logic circuits can be constructed from standard Bistable circuits such as Flip-flops, Latches or Counters and which themselves can be made by simply connecting together NAND Gates and/or NOR Gates in a particular combinational way to produce the required sequential circuit.

Sequential Logic circuits can be divided into 3 main categories:

  • 1. Clock Driven - Synchronous Circuits that are Synchronised to a specific clock signal.
  • 2. Event Driven - Asynchronous Circuits that react or change state when an external event occurs.
  • 3. Pulse Driven - Which is a Combination of Synchronous and Asynchronous.

Classification of Sequential Logic

Types of Sequential Logic Circuits

As well as the two logic states mentioned above logic level "1" and logic level "0", a third element is introduced that separates Sequential Logic circuits from their Combinational Logic counterparts, namely TIME. Sequential logic circuits that return back to their original state once reset, i.e. circuits with loops or feedback paths are said to be "Cyclic" in nature.

SR Flip-Flop

An SR Flip-Flop can be considered as a basic one-bit memory device that has two inputs, one which will "SET" the device and another which will "RESET" the device back to its original state and an output Q that will be either at a logic level "1" or logic "0" depending upon this Set/Reset condition. A basic NAND Gate SR flip flop circuit provides feedback from its outputs to its inputs and is commonly used in memory circuits to store data bits. The term "Flip-flop" relates to the actual operation of the device, as it can be "Flipped" into one logic state or "Flopped" back into another.

The simplest way to make any basic one-bit Set/Reset SR flip-flop is to connect together a pair of cross-coupled 2-input NAND Gates to form a Set-Reset Bistable or a SR NAND Gate Latch, so that there is feedback from each output to one of the other NAND Gate inputs. This device consists of two inputs, one called the Reset, R and the other called the Set, S with two corresponding outputs Q and its inverse or complement Q as shown below.

The SR NAND Gate Latch

The SR Bistable Symbol The SR NAND Gate Latch

The Set State

Consider the circuit shown above. If the input R is at logic level "0" (R = 0) and input S is at logic level "1" (S = 1), the NAND Gate Y has at least one of its inputs at logic "0" therefore, its output Q must be at a logic level "1" (NAND Gate principles). Output Q is also fed back to input A and so both inputs to the NAND Gate X are at logic level "1", and therefore its output Q must be at logic level "0". Again NAND gate principals. If the Reset input R changes state, and now becomes logic "1" with S remaining HIGH at logic level "1", NAND Gate Y inputs are now R = "1" and B = "0" and since one of its inputs is still at logic level "0" the output at Q remains at logic level "1" and the circuit is said to be "Latched" or "Set" with Q = "1" and Q = "0".

Reset State

In this second stable state, Q is at logic level "0", Q = "0" its inverse output Q is at logic level "1", not Q = "1", and is given by R = "1" and S = "0". As gate X has one of its inputs at logic "0" its output Q must equal logic level "1" (again NAND gate principles). Output Q is fed back to input B, so both inputs to NAND gate Y are at logic "1", therefore, Q = "0". If the set input, S now changes state to logic "1" with R remaining at logic "1", output Q still remains LOW at logic level "0" and the circuit's "Reset" state has been latched.

Truth Table for this Set-Reset Function

StateSRQQ
Set1010
1110
Reset0101
1101
Invalid0011

It can be seen that when both inputs S = "1" and R = "1" the outputs Q and Q can be at either logic level "1" or "0", depending upon the state of inputs S or R BEFORE this input condition existed. However, input state R = "0" and S = "0" is an undesirable or invalid condition and must be avoided because this will give both outputs Q and Q to be at logic level "1" at the same time and we would normally want Q to be the inverse of Q. However, if the two inputs are now switched HIGH again after this condition to logic "1", both the outputs will go LOW resulting in the flip-flop becoming unstable and switch to an unknown data state based upon the unbalance. This unbalance can cause one of the outputs to switch faster than the other resulting in the flip-flop switching to one state or the other which may not be the required state and data corruption will exist. This unstable condition is known as its Meta-stable state.

Then, a bistable latch is activated or Set by a logic "1" applied to its S input and deactivated or Reset by a logic "1" applied to its R. The SR Latch is said to be in an "invalid" condition (Meta-stable) if both the Set and Reset inputs are activated simultaneously.

As well as using NAND Gates, it is also possible to construct simple 1-bit SR Flip-flops using two NOR Gates connected the same configuration. The circuit will work in a similar way to the NAND gate circuit above, except that the invalid condition exists when both its inputs are at logic level "1" and this is shown below.

The NOR Gate SR Flip-flop

The SR Bistable Symbol

Switch Debounce Circuits

One practical use of this type of Set-Reset circuit is as a latch used to help eliminate mechanical switch "Bounce". As its name implies, switch bounce occurs when the contacts of any mechanically operated Switch, Push-button or Keypad is operated and the internal switch contacts do not fully close cleanly, but bounce together first before closing (or opening) when the switch is pressed. This gives rise to a series of pulses as long as tens of milliseconds that an electronic system or circuit such as a digital counter may see as a series of logic pulses instead of one long single pulse and behave incorrectly, for example, it may register multiple counts instead of a single count. Then Set-Reset SR Flip-flops or Bistable Latch circuits can be used to eliminate this problem and this is shown below.

SR Bistable Switch Debounce Circuit

SR Bistable Switch Debounce Circuit

Depending upon the current state of the output, if the Set or Reset buttons are depressed the output will change over in the manner described above and any additional unwanted inputs (bounces) from the mechanical action of the switch will have no effect on the output. When the other button is pressed, the very first contact will cause the latch to change state, but any additional bounces will also have no effect. The SR flip-flop can then be RESET automatically after a short period of time, for example 0.5 seconds, so as to register any additional and intentional repeat inputs from the same switch contacts, for example multiple inputs from the RETURN key.

Commonly available IC's specifically made to overcome the problem of switch bounce are the MAX6816, single input, MAX6817, dual input and the MAX6818 octal input switch debouncer IC's. These chips contain the necessary flip-flop circuitry to provide clean interfacing of mechanical switches to digital systems.

Set-Reset Latches can also be used as Monostable (one-shot) pulse generators to generate a single output pulse, either High or Low, of some specified width or time period for timing or control purposes. The 74LS279 is a Quad SR Bistable Latch IC, which contains 4 individual NAND type bistable's within a single chip enabling switch debounce or monostable/astable clock circuits to be easily constructed.

Gated or Clocked SR Flip-Flop

It is sometimes desirable in sequential logic circuits to have a bistable SR flip-flop that only change state when certain conditions are met regardless of the condition of either the Set or the Reset inputs. By connecting a 2-input NAND gate in series with each input terminal of the SR Flip-flop a Gated SR Flip-flop can be created. This extra conditional input is called an "Enable" input and is given the prefix of "EN" as shown below.

Gated SR Bistable

When the Enable input "EN" is at logic level "0", the outputs of the two AND gates are also at logic level "0", (AND Gate principles) regardless of the condition of the two inputs S and R, latching the two outputs Q and Q into their last known state. When the enable input "EN" changes to logic level "1" the circuit responds as a normal SR bistable flip-flop with the two AND gates becoming transparent to the Set and Reset signals. This enable input can also be connected to a clock timing signal adding clock synchronisation to the flip-flop creating what is sometimes called a "Clocked SR Flip-flop".

So a Gated Bistable SR Flip-flop operates as a standard Bistable Latch but the outputs are only activated when a logic "1" is applied to its EN input and deactivated by a logic "0".


Goto Page:  1 2 3 4 5 6

 External Links about NAND Gate SR Flip-Flop  
Flip-Flop Design Notes - Electronic Design notes about the SR Flip-Flop.
 Corollary Theorems Ltd
NAND gate SR flip-flop - How to make a SR flip-flop from 4011 Quad NAND gate.
 All About Circuits
SR Flip-Flop - Lecture notes about the SR Flip-Flop using NOR gates.
 Sheffield University Physics Dept.
NAND-gate Latch - Tutorial about NAND Gate Latch.
 Hyperphysics
SR Flip-Flop Circuit - Basic tutorial about the SR Flip-Flop.
 Radio-Electronics.com

Link to us : 
Add this SR Flip-flop Tutorial to your Favourites

Advertisement


Page Designed and Written by Wayne Storr.   Last updated  ,
Copyright © 1998 − 2010, Electronics-Tutorials.ws, All Right Reserved.