Docsity

Boolean Algebras and Combinatorial Circuits, Lecture notes of Algebra

Toggle sidebar
bg1
CHAPTER 9
Boolean Algebras
9.1. Combinatorial Circuits
9.1.1. Introduction. At their lowest level digital computers han-
dle only binary signals, represented with the symbols 0 and 1. The
most elementary circuits that combine those signals are called gates.
Figure 9.1 shows three gates: OR, AND and NOT.
x1
x2
x1
x2
x x
x1
x2
x2
OR GATE
NOT GATE
AND GATE
x1 +
Figure 9.1. Gates.
Their outputs can be expressed as a function of their inputs by the
following logic tables:
x1x2x1+x2
1 1 1
1 0 1
0 1 1
0 0 0
OR GATE
122
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Boolean Algebras and Combinatorial Circuits and more Lecture notes Algebra in PDF only on Docsity!

CHAPTER 9

Boolean Algebras

9.1. Combinatorial Circuits

9.1.1. Introduction. At their lowest level digital computers han- dle only binary signals, represented with the symbols 0 and 1. The most elementary circuits that combine those signals are called gates. Figure 9.1 shows three gates: OR, AND and NOT.

x x

x x

x x

x

x

x

OR GATE

NOT GATE

AND GATE

x1 +

Figure 9.1. Gates.

Their outputs can be expressed as a function of their inputs by the following logic tables:

x 1 x 2 x 1 + x 2 1 1 1 1 0 1 0 1 1 0 0 0 OR GATE

122

9.1. COMBINATORIAL CIRCUITS 123

x 1 x 2 x 1 · x 2 1 1 1 1 0 0 0 1 0 0 0 0 AND GATE

x x 1 0 0 1 NOT GATE

These are examples of combinatorial circuits. A combinatorial cir- cuit is a circuit whose output is uniquely defined by its inputs. They do not have memory, previous inputs do not affect their outputs. Some combinations of gates can be used to make more complicated combi- natorial circuits. For instance figure 9.2 is combinatorial circuit with the logic table shown below, representing the values of the Boolean expression y = (x 1 + x 2 ) · x 3.

x x2 y x

Figure 9.2. A combinatorial circuit.

x 1 x 2 x 3 y = (x 1 + x 2 ) · x 3 1 1 1 0 1 1 0 1 1 0 1 0 1 0 0 1 0 1 1 0 0 1 0 1 0 0 1 1 0 0 0 1

However the circuit in figure 9.3 is not a combinatorial circuit. If x 1 = 1 and x 2 = 0 then y can be 0 or 1. Assume that at a given time y = 0. If we input a signal x 2 = 1, the output becomes y = 1, and

9.1. COMBINATORIAL CIRCUITS 125

x y x + y x · y 1 1 0 0 1 0 0 0 0 1 0 0 0 0 1 1

9.1.3. Abstract Boolean Algebras. Here we deal with general Boolean algebras; combinatorial circuits are an example, but there are others.

A Boolean algebra B = (S, ∨, ∧, , 0 , 1) is a set S containing two distinguished elements 0 and 1, two binary operators ∨ and ∧ on S, and a unary operator on S, satisfying the following properties (x, y, z are elements of S):

  1. Associative (x ∨ y) ∨ z = x ∨ (y ∨ z) (x ∧ y) ∨ z = x ∧ (y ∧ z)
  2. Commutative x ∨ y = y ∨ x x ∧ y = y ∧ x
  3. Distributive x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧ z) x ∨ (y ∧ z) = (x ∨ y) ∧ (x ∨ z)
  4. Identity x ∨ 0 = x x ∧ 1 = x
  5. Complement x ∨ x = 1 x ∧ x = 0

Example: (Z 2 , +, ·, , 0 , 1) is a Boolean algebra.

Example: If U is a universal set and P(U )= the power set of S (col- lection of subsets of S) then (P(U ), ∪, ∩, , ∅, U ). is a Boolean algebra.

9.1. COMBINATORIAL CIRCUITS 126

9.1.4. Other Properties of Boolean Algebras. The properties mentioned above define a Boolean algebra, but Boolean algebras also have other properties:

  1. Idempotent x ∨ x = x x ∧ x = x
  2. Bound x ∨ 1 = 1 x ∧ 0 = 0
  3. Absorption x ∨ xy = x x ∧ (x ∨ y) = x
  4. Involution x = x
  5. 0 and 1 0 = 1 1 = 0
  6. De Morgan’s x ∨ y = x ∧ y x ∧ y = x ∨ y

For instance the first idempotent law can be proved like this: x = x ∨ 0 = x ∨ x ∧ x = (x ∨ x) ∧ (x ∨ x) = (x ∨ x) ∧ 1 = x ∨ x.

9.2. BOOLEAN FUNCTIONS, APPLICATIONS 128

x

x

x1 x

Figure 9.4. Exclusive-Or.

Given any Boolean function f : Zn 2 → Z 2 that is not identically one, it can be represented

f (x 1 ,... , xn) = M 1 · M 2 · · · · · Mk ,

where M 1 , M 2 ,... , Mk are all the maxterms Mi = y 1 + y 2 + · · · + yn such that f (a 1 , a 2 ,... , an) = 0, where yj = xj if aj = 0 and yj = xj if aj = 1. That representation is called conjunctive normal form of the Boolean function f.

Example: The conjunctive normal form of the exclusive-or is x 1 ⊕ x 2 = (x 1 + x 2 ) · (x 1 + x 2 ).

9.2.4. Functionally Complete Sets of Gates. We have seen how to design combinatorial circuits using AND, OR and NOT gates. Here we will see how to do the same with other kinds of gates. In the following gates will be considered as functions from Zn 2 into Z 2 intended to serve as building blocks of arbitrary boolean functions.

A set of gates {g 1 , g 2 ,... , gk} is said to be functionally complete if for any integer n and any function f : Zn 2 → Z 2 it is possible to construct a combinatorial circuit that computes f using only the gates g 1 , g 2 ,... , gk. Example: The result about the existence of a disjunctive normal form for any Boolean function proves that the set of gates {AND, OR, NOT} is functionally complete. Next we show other sets of gates that are also functionally complete.

  1. The set of gates {AND, NOT} is functionally complete. Proof: Since we already know that {AND, OR, NOT} is functionally complete, all we need to do is to show that we can compute x + y using only AND and NOT gates. In fact: x + y = x · y , hence the combinatorial circuit of figure 9.5 computes x + y.

9.2. BOOLEAN FUNCTIONS, APPLICATIONS 129

x1 x x

x

Figure 9.5. OR with AND and NOT.

  1. The set of gates {OR, NOT} is functionally complete. The proof is similar: x · y = x + y , hence the combinatorial circuit of figure 9.6 computes x + y.

x x1 x x

Figure 9.6. AND with OR and NOT.

  1. The gate NAND, denoted ↑ and defined as

x 1 ↑ x 2 =

0 if x 1 = 1 and x 2 = 1 1 otherwise, is functionally complete.

x

x1 x

x

Figure 9.7. NAND gate.

Proof: Note that x ↑ y = x · y. Hence x = x · x = x ↑ x, so the NOT gate can be implemented with a NAND gate. Also the OR gate can be implemented with NAND gates: x+y = x · y = (x ↑ x) ↑ (y ↑ y). Since the set {OR, NOT} is functionally complete and each of its elements can be implemented with NAND gates, the NAND gate is functionally complete.

9.2.5. Minimization of Combinatorial Circuits. Here we ad- dress the problems of finding a combinatorial circuit that computes a given Boolean function with the minimum number of gates. The idea

9.2. BOOLEAN FUNCTIONS, APPLICATIONS 131

z

y

x

f(x,y,z).

Figure 9.9. A circuit that computes f (x, y, z) = xyz + xyz + xyz.

But we can do better if we simplify the expression in the following way:

f (x, y, z) =

xy ︷ ︸︸ ︷ xyz + xyz +xyz = xy + xyz = x(y + yz) = x(y + y)(y + z) = x(y + z) ,

which corresponds to the circuit of figure 9.10.

f(x,y,z) y.

x

z

Figure 9.10. A simpler circuit that computes f (x, y, z) = xyz + xyz + xyz.

9.2.6. Multi-Output Combinatorial Circuits. Example: Half- Adder. A half-adder is a combinatorial circuit with two inputs x and y and two outputs s and c, where s represents the sum of x and y and c is the carry bit. Its table is as follows:

x y s c 1 1 0 1 1 0 1 0 0 1 1 0 0 0 0 0

So the sum is s = x ⊕ y (exclusive-or) and the carry bit is c = x · y. Figure 9.11 shows a half-adder circuit.

9.2. BOOLEAN FUNCTIONS, APPLICATIONS 132

y s

c

x

Figure 9.11. Half-adder circuit.