R-S Flip Flop

Mar. 30, 2023, edited on Mar. 31, 2023

A flip-flop is a base element of a sequential circuit that can restore one bit of information for a certain amount of time, depending on its specific structure.

Components

An R-S flip flop (also as known as a Set-Reset Latch) is a component made up of two NAND gates with feedback:

We can easily write down its Boolean Expression according its structure: $\begin{cases} P = \overline{R_DQ} \\ Q = \overline{S_DP} \end{cases}$

The R-S flip flop has two inputs, $R_D$ and $S_D$, and two outputs, $P$ and $Q$, we can list its truth table by calculating the Boolean expression:

$R_D$$S_D$$P$$Q$
0011
0110
1001
11$\overline{Q}$$\overline{P}$

When $R_D + S_D \neq 0$ (as seen in the bottom tree lines of the table), we can obtain $P = \overline{Q}$ from the Boolean expression and truth table. If we let $P$ be $\overline{Q}$, we can create this truth table without listing output $P$:

$R_D$$S_D$$Q$Comment
001Invalid
010Reset
101Set
11$Q$Remain

Here’s an explanation of the inputs:

Now we can list functions of an R-S flipflop according to the above truth table:

Now we can obtain that an R-S flip flop is a basic memory element in digital circuits, as it can retain its output value.

Methods to describe flipflop

Truth Table / State Transition Table

When the input signal changed, a flip-flop can transform between stable status.

Now we can describe the R-S flip-flop using the following table:

$R_D$$S_D$$Q^n$$Q^{n+1}$
000$\times$
001$\times$
0100
0110
1001
1011
1100
1111

The inputs are $R_D$, $S_D$ and the current state $Q^n$, and the output is the next status $Q^{n+1}$, so we can use a 3-inputs Karnaugh Map to visualize the output logic:

Status Equation

Marking the appropriate cells on the Karnaough Map:

We can obtain the Status Equation: $ \begin{cases} Q^{n+1} &= \overline{S_D} + R_DQ^n & \\ R_D + S_D &= 1 &(Constraint) \end{cases} $

Let $x$ represents the inputs and $Q^n$ represents the current state. $Q^{n+1}$ is the next state:

State Transition Diagram

This graph is drawing according to its truth table:

$R_D$$S_D$$Q^n$ $\rightarrow$ $Q^{n+1}$
010 $\rightarrow$ 0
011 $\rightarrow$ 0
100 $\rightarrow$ 1
101 $\rightarrow$ 1
110 $\rightarrow$ 0
111 $\rightarrow$ 1

Waveform Graphs

Why does the input of 00 will cause unstable status when inputs jump to 11? The reason is that we don’t now the accurate delay time of the logical gates. Let’s recall the structure of an R-S flip flop:

The delay time of $R$ and $S$ is uncertain, delay time of $R$ may greater than $S$ or vice versa. Let’s observe the waveform when inputs JUMP from 00 to 11 while considering delay time:

When $DELAY(R_D) \le DELAY(S_D)$, output $Q$ is 1. When $DELAY(R_D) \ge DELAY(S_D)$, output $Q$ is 0. That’s why the input of 00 is invalid for an R-S flip-flop, because it causes a different output when input jumps to 11.