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: http://java.com/en/download/help/enable_browser.xml and https://www.java.com/en/download/mac_download.jsp

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.

Sincerely,

The Teahlab Team

THE OR GATE
by Isai Damier (Let's connect on twitter @isaidamier )

The OR gate is an electronic circuit that performs inclusive disjunction. The output of the OR Boolean operator is false only when all the inputs are false. Otherwise, the output is true.

TRUTH TABLE
Input Output Comment
A B Out
0 0 0 Low
0 1 1 High
1 0 1 High
1 1 1 High
Through a short and simple analysis you can determine what a statement that uses the word OR is truly saying. We illustrate with the following statement: Water OR milk can quench a thirst.

For a bit of a back story, let’s say you get home very thirsty and your roommate tells you that you should drink some water or some milk from the fridge to satisfy your thirst. So of course before you even get to the fridge you may start thinking of the possibilities of actually finding water or milk in the fridge. Table 1 below shows the cases you imagine.

PossibilitiesThere is WATER in the fridgeThere is MILK in the fridgeCOMMENT
Case 1 False False The fridge has neither
Case 2 False True The fridge only has milk
Case 3 True False The fridge only has water
Case 4 True True The fridge has both

Table 1: possible input conditions


So from your listing we can see that there are four possibilities. The four is due to the fact that you have two options (water or milk) and each option can be in two possible states (existing or non-existent inside the fridge). Two raised to two is four: 22 = 4.

Once we have created a list, the next step is to evaluate the original statement in light of the possibilities. In other words, of the four possible cases, we need to find the ones that will quench your thirst and the ones that will not. For example, case one will not quench your first because the fridge has neither water nor milk. Table 2 below shows our complete evaluation.

There is WATER in the fridgeThere is MILK in the fridgePossibilitiesCOMMENT
False False False Not good. You are still thirsty
False True True You are happy to find MILK
True False True You are happy to find WATER
True True True You are happy to find both

Table 2: Truth Table of complete evaluation


It is important to observe that in the case where you find both milk and water the OR statement is still true. Most people are not used to such usage of the word OR. If your parent tells you to buy a laptop computer or a desktop computer for college, they may not be happy if you actually buy both. Logically, however, both is as good as either in satisfying the OR statement.

It is typical in engineering to use 1 instead of TRUE and 0 instead of FALSE. Therefore we rewrite the data from Table 2 in Table 3 accordingly.

There is WATER in the fridgeThere is MILK in the fridgePossibilitiesCOMMENT
0 0 0 Not good. You are still thirsty
0 1 1 You are happy to find MILK
1 0 1 You are happy to find WATER
1 1 1 You are happy to find both

Table 3: Truth Table of complete evaluation


For greater detail on the logic significance of the word OR, read the Boolean Algebra article.

Physical Implementation

In order to apply the principles of Boolean algebra to create real machines that can think and make decisions, we have had to find ways to physically implement the logic operators AND, OR, NOT, etc. To that end, modern day engineering uses transistor networks called logic gates. Hence, a logic gate is actually a group of transistors so arranged as to behave as a Boolean operator.

From a circuit complexity perspective, the most basic logic gate is the NOT gate (aka the Inverter). The NOT gate is made of two transistors, as shown in Figure 1. The next most basic logic gate is the NOR gate, which is effectively two Inverters as shown in Figure 2. We only need four transistors to build a NOR gate. Finally, to create the OR gate, microchip manufacturers connect a NOT gate at the end of a NOR gate, as in Figure 3. Hence, the OR gate is made of six transistors.

Figure 1: Interactive transistor circuit of the NOT logic operator



Figure 2: Interactive transistor circuit of the NOR logic operator



Figure 3: Interactive transistor circuit of the OR logic operator

Transistors

The use of transistors to build logic gates is quite modern. Before transistors we used other devices, such as vacuum tubes (aka thermionic valves). And very soon we may use DNA, or some other abundant material. There are many types of transistors. Our circuits in figures 1, 2 and 3, for example, use complementary metal–oxide semiconductor (CMOS) technology. Our choice of CMOS is arbitrarily based on the fact that CMOS is by far the dominant technology in use today. The dominance is due to how well CMOS performs in all the important categories: fabrication cost, packing density, loading capacity (i.e. fan–out), operational speed (i.e. propagation delay), noise margin, and power dissipation (i.e. green technology).

There is of course more to transistors than can be presented here; especially since transistors are used for more than just digital systems. And so we refer you to any good micro-electronics textbook.

Alternate Design

Below we show three additional typical constructions of the OR gate. Each of the constructions presents specific conveniences to designers. If you are very new to digital systems design, you may not understand the importance of the figures below. Still, we include them in this article for the people who may need them.


Interactive OR gate implemented with two NOR gates digital logic circuit with boolean algebra equation and truth table
Figure 4: OR gate implemented with two NOR gates


Interactive OR gate implemented with three NAND gates digital logic circuit with boolean algebra equation and truth table
Figure 5: OR gate implemented with three NAND gates


Interactive OR gate implemented with a 2X1 Mux digital logic circuit with boolean algebra equation and truth table
Figure 6: OR gate implemented with a 2X1 Mux