Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

12.7: A Brief Introduction to Switching Theory and Logic Design

( \newcommand{\kernel}{\mathrm{null}\,}\)

The electronics involved in these switches take into account whether we are negating a switch or not. For electromagnetic switches, a magnet is used to control whether the switch is open or closed. The magnets themselves may be controlled by simple ON/OFF switches. There are two types of electromagnetic switches. One is normally open (OFF) when the magnet is not activated, but activating the magnet will close the circuit and the switch is then ON. A separate type of switch corresponds with a negated switch. For that type, the switch is closed when the magnet is not activated, and when the magnet is activated, the switch opens. We won't be overly concerned with the details of these switches or the electronics corresponding to logical gates. We will simply assume they are available to plug into a circuit. For simplicity, we use the inversion symbol on a variable that labels a switch to indicate that it is a switch of the second type, as in Figure 12.7.3.

Note 12.7.1

Standby power generators that many people have in their homes use a transfer switch to connect the generator to the home power system. This switch is open (OFF) if there is power coming from the normal municipal power supply. It stays OFF because a magnet is keeping it open. When power is lost, the magnet is no longer activated, and the switch closes and is ON. So the transfer switch is a normally ON switch.

clipboard_e65a454c5e9c983a75104ce36292eaec6.pngFigure 12.7.2: Representation of a normally OFF switch controlled by variable x1
clipboard_e991600d5fa7fe52a0da0bfb78a8a5416.pngFigure 12.7.3: Representation of a normally ON switch controlled by variable x1

The standard notation used for Boolean algebra operations in switching theory and logic design is + for join, instead of ; and for meet, instead of . Complementation is the same in both notational systems, denoted with an overline.

The expression x1x2 represents the situation in which a series of two switches appears in sequence as in Figure 12.7.4. In order for current to flow through the circuit, both switches must be ON; that is, they must both have the value 1. Similarly, a pair of parallel switches, as in Figure 12.7.5, is described algebraically by x1+x2. Here, current flows through this part of the circuit as long as at least on of the switches is ON.

clipboard_eb8be893059beaaf9a8f9897e8c4d285e.pngFigure 12.7.4: Two switches in AND configuration realizing x1x2
clipboard_e86811b5aa0993c2cb054031c99d7214b.pngFigure 12.7.5: Two switches in OR configuration realizing x1+x2

All laws and concepts developed previously for Boolean algebras hold. The only change is purely notational. We make the change in this section solely to introduce the reader to another frequently used system of notation.

Many of the laws of Boolean algebra can be visualized thought switching theory. For example, the distributive law of meet over join is expressed as

x1(x2+x3)=x1x2+x1x3.

The switching circuit analogue of the above statement is that the circuits in the two images below are equivalent. In circuit (b), the presence of two x1's might represent two electromagnetic switches controlled by the same magnet.

clipboard_eadd79a5f17cdac745924ea9e2046f6be.pngFigure 12.7.6: (a)
clipboard_ea7ced92f244cc3213f382c7cd3a4ebbe.pngFigure 12.7.7: (b)

The circuits in a computer are now composed of large quantities of gates, which serve the same purpose as switches, but can be miniaturized to a great degree. For example, the OR gate, usually drawn as in Figure 12.7.8 implements the logical OR function. This happens electronically, but is equivalent to Figure 12.7.5. The AND gate, which is equivalent to two sequential switches is shown in Figure 12.7.8.

clipboard_e3947ae98932b81f8a208cc8baa458fce.pngFigure 12.7.8: An OR gate
clipboard_e1146ffd91f55f939cd2a096c553124a2.pngFigure 12.7.9: An AND gate

The complementation process is represented in a gate diagram by an inverter, as pictured in Figure 12.7.10.

clipboard_ef4c413342130b23762e9309e104c4636.pngFigure 12.7.10: Inverter, or NOT gate

When drawing more complex circuits, multiple AND's or OR's are sometimes depicted using a more general gate drawing. For example if we want to depict an OR gate with three inputs that is ON as long as at least one input is ON, we would draw it as in Figure 12.7.11, although this would really be two binary gates, as in Figure 12.7.12. Both diagrams are realizing the boolean expression x1+x2+x3. Strictly speaking, the gates in Figure 12.7.12 represent (x1+x2)+x3, but the associative law for join tells us that the grouping doesn't matter.

clipboard_e9f04af807d1162ac31cbc46572a78de5.pngFigure 12.7.11: Simple version of a ternary OR gate
clipboard_e604c1850bb4b96dc046640a3fc4ffd30.pngFigure 12.7.12: A ternary OR gate created with binary OR gates

In Figure 12.7.13, we show a few other commonly used gates, XOR, NAND, and NOR, which correspond to the boolean exressions x1x2, ¯x1x2, and ¯x1+x2, respectively.

clipboard_e103a037e6a177dfb9a981178352021ff.pngFigure 12.7.13: Other common gates

Let's start with a logic circuit and see how the laws of boolean algebra can help us simplify it.

Example 12.7.1: Simplification of a Circuit

Consider the circuit in Figure 12.7.14. As usual, we assume that three inputs enter on the left and the output exits on the right.

clipboard_ea34e928af5ef4528c6edb4f01d2e9e07.pngFigure 12.7.14: Initial gate diagram

If we trace the inputs through the gates we see that this circuit realizes the boolean function

f(x1,x2,x3)=x1¯x2((x1+x2)+(x1+x3)).

We simplify the boolean expression that defines f, simplifying the circuit in so doing. You should be able to identify the laws of Boolean algebra that are used in each of the steps. See Exercise 12.7.1.

x1¯x2((x1+x2)+(x1+x3))=x1¯x2(x1+x2+x3)=x1¯x2x1+x1¯x2x2+x1¯x2x3=x1¯x2+0x1+x3x1¯x2=x1¯x2+x3x1¯x2=x1¯x2(1+x3)=x1¯x2

Therefore, f(x1,x2,x3)=x1¯x2, which can be realized with the much simpler circuit in Figure 12.7.15, without using the input x3.

clipboard_e8bb2444f68a2f237bed476716f8e18be.pngFigure 12.7.15: Simplified gate diagram

Next, we start with a table of desired outputs based on three bits of input and design an efficient circuit to realize this output.

Example 12.7.2

Consider the following table of desired outputs for the three input bits x1,x2,x3.

Table 12.7.1: Desired output table

x1 x2 x3 f(x1,x2,x3)
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 0

The first step is to write the Minterm Normal Form, Definition 13.6.3, of f. Since we are working with the two value Boolean algebra, B2, the constants in each minterm are either 0 or 1, and we simply list the minterms that have a 1. These correspond with the rows of the table above that have an output of 1. We will then attempt to simplify the expression as much as possible.

f(x1,x2,x3)=(¯x1¯x2x3)+(x1¯x2¯x3)+(x1¯x2x3)=¯x2((¯x1x3)+(x1¯x3)+(x1x3))=¯x2((¯x1x3)+x1(¯x3+x3))=¯x2((¯x1x3)+x1)

Therefore we can realize our table with the boolean function f(x1,x2,x3)=¯x2((¯x1x3)+x1). A circuit diagram for this function is Figure 12.7.16. But is this the simplest circuit that realizes the table? See Exercise 12.7.3.

clipboard_e0956ec24a3d6e558840ea6f34ed66715.pngFigure 12.7.16: A realization of the table of desired outputs.

13.7.1: Exercises

Exercise 12.7.1

List the laws of boolean algebra that justify the steps in the simplification of the boolean function f(x1,x2,x3) in Example 12.7.1. Some steps use more than one law.

Answer
  1. Associative, commutative, and idempotent laws.
  2. Distributive law.
  3. Idempotent and complement laws.
  4. Null and identity laws
  5. Distributive law.
  6. Null and identity laws.

Exercise 12.7.2

Write the following Boolean expression in the notation of logic design.

(x1¯x2)(x1x2)(¯x1x2).

Answer

(x1¯x2)+(x1x2)+(¯x1x2).

Exercise 12.7.3

Find a further simplification of the boolean function in Example 12.7.2, and draw the corresponding gate diagram for the circuit that it realizes.

Answer

A simpler boolean expression for the function is ¯x2(x1+x3).

clipboard_ef0040540718705cba2eae273dc9e7dad.pngFigure 12.7.17: An even simpler circuit

Exercise 12.7.4

Consider the switching circuit in Figure 12.7.18.

clipboard_e9a89840fad6e18dc5cbfea346987cea6.pngFigure 12.7.18: Can this circuit be simplified?
  1. Draw the corresponding gate diagram for this circuit.
  2. Construct a table of outputs for each of the eight inputs to this circuit.
  3. Determine the minterm normal of the Boolean function based on the table.
  4. Simplify the circuit as much as possible.

Exercise 12.7.5

Consider the circuit in Figure 12.7.19.

clipboard_e08381e8c7a21b5dbce7d0b8f37816fe9.pngFigure 12.7.19: Can this circuit be simplified?
  1. Trace the inputs though this circuit and determine the Boolean function that it realizes.
  2. Construct a table of outputs for each of the eight inputs to this circuit.
  3. Find the minterm normal form of f.
  4. Draw the circuit based on the minterm normal form.
  5. Simplify the circuit algebraically and draw the resulting circuit.

Exercise 12.7.6

Consider the Boolean function f(x1,x2,x3,x4)=x1+(x2(¯x1+x4)+x3(¯x2+¯x4)).

  1. Simplify f algebraically.
  2. Draw the gate diagram based on the simplified version of f.

Exercise 12.7.7

Draw a logic circuit using only AND, OR and NOT gates that realizes an XOR gate.

Exercise 12.7.8

Draw a logic circuit using only AND, OR and NOT gates that realizes the Boolean function on three variables that returns 1 if the majority of inputs are 1 and 0 otherwise.


This page titled 12.7: A Brief Introduction to Switching Theory and Logic Design is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Al Doerr & Ken Levasseur via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?