Java Circuit Simulation Workaround ▾

Due to recent changes by Oracle, java applets have become difficult to run in the browser. To mitigate the troubles, Oracle has provided the following websites to help users troubleshoot: and

Even after following the above instructions, loading applets may still show warning concerning “unsigned application” and “unknown publisher”. For Teahlab in particular, these warnings are due to the fact that we have opted not to pay a third party such as Verisign to sign our applets. Any warning that comes up when you try to run our applets should emphasize that our applets will always run with “limited access”, which is Oracle’s way of letting you know that teahlab doesn’t do anything on your computer except running the circuits you see: in other words, our applets are safe to run.


The Teahlab Team

by Isai Damier

The interactive Basic RS Nor Latch digital logic circuit, with Boolean function and truth table.

Feedback Sequential Circuit Introduction

Digital logic systems have been divided into two main categories: combinational circuits, and feedback sequential circuits. A combinational circuit is a circuit whose output can be determined from its inputs. Examples from this group are Half-Adders, Decoders, Multiplexers, and the basic gates. If I tell you the inputs of an AND gate, for instance, you can readily tell me the output. Feedback sequential circuits, on the other hand, are a bit fancier than that. The output of a feedback sequential circuit depends not only on the inputs but also on the given state (or condition) of the circuit. Before we continue, however, let’s take a short break here for a story.

Input Output
S R Q not-Q
0 0 Latch Latch
0 1 0 1
1 0 1 0
1 1 Invalid Invalid

While playing with your friends on campus, you stood on the edge of a four foot bench and from there jumped to the ground. At the exact same time, my very emotional friend Francois stood on the edge of a forty story building and from there jumped to the ground.

Now let’s compare and contrast the two incidents. Both you and Francois jumped to the ground from the edge of a ______. Clearly, you both took the exact same action: You both selected the same inputs: You both jumped to the ground. Hence, if Francois and you end up in different states, it must be because you two started from different states. Indeed, if you recall from physics or thermodynamics, because of Francois’s starting location (and for no other reason), he had more potential energy than you — potential energy being a state energy as opposed to being a process energy.

As you can see from our short story, the importance of starting condition (or given state) to the operation of a system is not exclusive to digital logic systems. In fact, so many machines exhibit this sequential behavior that we have a name for them: finite state machines. A finite state machine is any machine that stores a finite (not infinite) amount of information about its previous state and uses that information to determine its next state. Perhaps Francois was not aware of his given state. Otherwise, he would not have jumped. But finite state machines remember where they are, and that memory determines what they will do next. Indeed, because feedback sequential circuits are able to store past information, they are used in memory devices such as the general computer and fancy stereo systems.

Function and Application

The most basic useful feedback sequential circuit is the Set-Reset Latch with NOR gates. The Set-Reset Latch, as you might guess from the name, is a finite state machine with two states: a Set state and a Reset state. If you have ever used the cruise control¹ feature of your car, you have essentially made use of a Set-Reset latch. When you select a setting/speed, you set the control circuit; when you cancel your selection, you reset the circuit. It’s that simple — at least from the driver’s perspective.

From the designer’s perspective, on the other hand, a little bit more work has to be done to make sure the circuit operates safely. To begin with, since the circuit has two inputs — Set and Reset — there are four possible input conditions to the control system, as depicted in the table below, table 1.

Reset Set Output
0 0
0 1
1 0
1 1

Table 1

But clearly, if we use the cruise control example just a little bit more, you and I both know that at any given time a car is either on cruise control or it is not on cruise control — it’s never on neither or on both at the same simultaneous time. As a result, a designer usually don’t allow the funny conditions where set and reset are both equal (RS = 00 and RS = 11) to affect the safety feature of the system where the circuit is used — in this case the cruise control system.


We analyze circuits to verify certain details about their operation. For combinational circuits, this means deriving a truth table or a Boolean function or both, depending on what your professor is in the mood for. For feedback sequential circuits, however, the list can be a bit longer. Case in point, our analysis of the set-reset latch needs to answer three questions:

  1. How many different states can the circuit be in?
  2. What input conditions will cause/excite the circuit to move/transition from state to state?
  3. What Boolean function (aka characteristic equation) defines the circuit?

–1. Cruise control systems are actually complex electromechanical circuits. However, the illustration is conceptionally intuitive.

The Boolean Function

Whenever someone asks you to analyze an object, they will give you the object; otherwise, you couldn’t verify anything. I can’t verify that your pizza is too small to share if you won’t show it to me. Hence, your professor will give you the circuit you need to analyze. As such, that is since we already have the circuit, the easiest thing to do is get the Boolean function.

To get the Boolean function, we are going to adopt a nice little technique that will allow us to treat all multivibrators — including this SR Latch — like a combinational circuit. Our technique is illustrated in figure 1 below, where we break the feedback loops into individual outputs and inputs. We use lower case q to represent the given condition (or given state) of the circuit while the upper case Q refers to the output you will get based on how you select R and S.

SR Nor Latch image

Figure 1

From figure 1 we can readily get two equations:

Q = (R + not-q)’

not-Q = (S + q)’.

if you are taking an exam and you are running out of time, the two expressions will suffice to show your professor that you get it. Nonetheless, it is customary to present the characteristic equation of any latch or flipflop as a solution of Q in terms of q. so let’s follow the tradition:

Q = (R + not-q)’
Q = (R + not-Q)’ after substituting for not-q = not-Q
Q = (R + (S + q)’)’ after substituting for not-Q = (S + q)’
Q = R’ • (S + q) after simplifying the double negatives
Q = R’ • S + R’ • q after expanding

Voila! The solution of Q in as a function of q!

That was question three on the list. Now we can answer question two: what are the possible transitions.

The State Transition Table

A state transition table is a table that shows how a circuit moves between states. From the characteristic equation we see that we have one state variable, q, and two input variables, R and S. Therefore, since each variable in Boolean logic can have two possible values, we can say with certitude that the set-reset latch has two possible states (q = 0; q = 1) and four possible input conditions (RS = 00; RS = 01; RS = 10; RS = 11). On that account, we can now create a table that shows the relationship between the two states and the four input conditions. Accordingly we label the rows of the table by states and the columns by input conditions. And we call the table a state transition table. Table 2 below shows what I am talking about.

Given state
Input Condition
RS=00 RS=01 RS=10 RS=11

Table 2

So far our table is empty. We will fill the table by evaluating Q for each combination of given state and input condition. For example, the value of Q when q = 0 and RS = 00 is
Q = R’ • (S + q)
= 0’ • (0 + 0)
= 1 • (0 + 0)
= 1 • (0)
= 0.

Accordingly we put 0 in the cell where q =0 intersects with RS = 00, as shown in Table 3.

Given state
Input Condition
RS=00 RS=01 RS=10 RS=11
0 0

Table 3

Without showing all the evaluations, I fill the state transition table for you in Table 4. Feel free to check that my calculations are correct.

Given state
Input Condition
RS=00 RS=01 RS=10 RS=11
0 0 1 0 0
1 1 1 0 0

Table 4

Table 4 effectively answers question two, which asked about the relationship between the input conditions and the states of the circuit. Because tables are not always intuitive, however, an easy to understand diagram, called a state diagram, is usually submitted as part of an analysis. The diagram, figure 2, has the same information as the transition table. But as you can see, the state diagram is the simplest method to show how a circuit behaves — after all it is a picture.

Set ResetNor latch State Diagram

Figure 2