Docsity

Boolean Algebra and Digital Logic: Development, Basic Operators, and Truth Tables - Prof. , Study notes of Computer Architecture and Organization

Toggle sidebar
bg1
Boolean Algebra & Digital Logic
Boolean algebra was developed by the Englishman George Boole, who published the
basic principles in the 1854 treatise An Investigation of the Laws of Thought on Which to
Found the Mathematical Theories of Logic and Probabilities.
The applicability to computing machines was discovered by three Americans
Claude Shannon Symbolic Analysis of Relay and Switching Circuits, 1938.
George Stibitz An employee of Bell Labs, he developed a binary adder
using mechanical relays in 1937, the model “K 1” adder
because he built it at home on his kitchen table.
John Atanasoff He was probably the first to use purely electronic relays
(vacuum tubes) to build a binary adder.
Boolean algebra is a two–valued algebra based on the constant values denoted as either
FALSE, TRUE
0, 1
The use of this algebra for computation is based on the fact that binary arithmetic
is based on two values, always called “0” and “1”.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Boolean Algebra and Digital Logic: Development, Basic Operators, and Truth Tables - Prof. and more Study notes Computer Architecture and Organization in PDF only on Docsity!

Boolean Algebra & Digital Logic

Boolean algebra was developed by the Englishman George Boole, who published the basic principles in the 1854 treatise An Investigation of the Laws of Thought on Which to Found the Mathematical Theories of Logic and Probabilities. The applicability to computing machines was discovered by three Americans Claude Shannon Symbolic Analysis of Relay and Switching Circuits , 1938. George Stibitz An employee of Bell Labs, he developed a binary adder using mechanical relays in 1937, the model “K 1” adder because he built it at home on his kitchen table. John Atanasoff He was probably the first to use purely electronic relays (vacuum tubes) to build a binary adder. Boolean algebra is a two–valued algebra based on the constant values denoted as either FALSE, TRUE 0, 1 The use of this algebra for computation is based on the fact that binary arithmetic is based on two values, always called “0” and “1”.

Basic Boolean Operators

Boolean algebra is defined in terms of two constants (defined above), which we call “0” and “1”. Other courses will call these values “F” and “T”. Boolean algebra is defined in terms of three basic operators, to which we shall add a useful fourth operator. The three operators are NOT, AND, & OR. Each of these three basic operators is implemented by a basic electronic device called a “logic gate”. We present the gates along with the definition. NOT This function takes one input and produces one output. The gate is shown below. The circle at the right end of the triangle is important. Algebraically, this function is denoted f(X) = X’ or f(X) = X The evaluation of the function is simple: 0 = 1 and 1 = 0.

Basic Boolean Operators (Part 3)

Logic AND This is a function of two Boolean variables. We denote the logical AND of two Boolean variables X and Y by “X  Y”. Some logic books will use “X  Y”. The evaluation of the logical AND function is shown by a truth table X Y X  Y 0 0 0 0 1 0 1 0 0 1 1 1

Another Boolean Operator

While not a basic Boolean operator, the exclusive OR is very handy. Logic XOR This is a function of two Boolean variables. We denote the logical XOR of two Boolean variables X and Y by “X  Y”. Most logic books seem to ignore this function. The evaluation of the logical XOR function is shown by a truth table X Y X  Y 0 0 0 0 1 1 1 0 1 1 1 0 From this last table, we see immediately that X  0 = X and X  1 = X

Sample Truth Table A B C F1(A, B, C) 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 This truth table for 3 variables has 2 3 = 8 rows, plus a label row. This truth table forms a complete definition of the function. We shall later give it another name, but can base all our discussions on this table.

Another Sample Truth Table

A B C F2(A, B, C)

Labeling Rows in a Truth Table

The row numbers are just labels. They are not really a part of the truth table, but aid in our discussions and conversions to Boolean expressions. The row numbers are the decimal equivalents of the variable values viewed as binary numbers. The first row is always “row 0”. 0 = 04 + 02 + 0 1 1 = 04 + 02 + 1 1 2 = 04 + 12 + 0 1 3 = 04 + 12 + 1 1 4 = 14 + 02 + 0 1 5 = 14 + 02 + 1 1 6 = 14 + 12 + 0 1 7 = 14 + 12 + 1 1 Row Number

X Y Z F(X, Y, Z)

The  and  Notations

These can be viewed as shorthand notation for expressing truth tables.

 notation: Give the row numbers in which the function has value 1.

 notation: Give the row numbers in which the function has value 0.

Example: The Exclusive OR (XOR) function Row Number X Y X  Y 0 0 0 0 1 0 1 1 2 1 0 1 3 1 1 0

X  Y =  ( 1, 2 ) X  Y =  ( 0, 3 )

Exercise: Convert F(X, Y, Z) =  ( 0, 2, 4, 6 ) to the  notation.

Answer: The function has three variables, so the truth table has 2 3 = 8 rows, numbered 0 through 7. If rows 0, 2, 4, and 6 have ones, then the rows

containing zeroes must be 1, 3, 5, and 7. F(X, Y, Z) =  ( 1, 3, 5, 7 ).

Examples: F1 and F

Evaluation of Boolean Expressions

The relative precedence of the operators is:

  1. NOT do this first
  2. AND
  3. OR do this last As in the usual algebra, parentheses take precedence. AB + CD, often written as AB + CD, is read as (AB) + (CD)

A  B  C  D is read as ^ ^ A ^ ^ B ^ ^ C ^ D . The latter is really messy.

AB + CD = 10 + 11 = 0 + 1 = 1
A(B + C)D = 1(0 + 1)1 = 1  1  1 = 1
A  B  C  D = 1  0  1  1 = 0  0 + 1  0 = 0 + 0 = 0
A  B = 1  0 = 0 = 1
A  B = 1  0 = 0  1 = 0

Question: Where to Put the 0’s and 1’s

We now ask how to fill a truth table by evaluating a Boolean expression. Example: F(X, Y, Z) = X^  YYZXYZ Step 1: There are three Boolean variables, so the truth table will have 8 rows. Let’s evaluate this function for all eight possible values of X, Y, Z. Row 0 X = 0 Y = 0 Z = 0 F(X, Y, Z) = 00 + 00 + 0 1 0 = 0 + 0 + 0 = 0 Row 1 X = 0 Y = 0 Z = 1 F(X, Y, Z) = 00 + 01 + 0 1 1 = 0 + 0 + 0 = 0 Row 2 X = 0 Y = 1 Z = 0 F(X, Y, Z) = 01 + 10 + 0 0 0 = 0 + 0 + 0 = 0 Row 3 X = 0 Y = 1 Z = 1 F(X, Y, Z) = 01 + 11 + 0 0 1 = 0 + 1 + 0 = 1 Row 4 X = 1 Y = 0 Z = 0 F(X, Y, Z) = 10 + 00 + 1 1 0 = 0 + 0 + 0 = 0 Row 5 X = 1 Y = 0 Z = 1 F(X, Y, Z) = 10 + 01 + 1 1 1 = 0 + 0 + 1 = 1 Row 6 X = 1 Y = 1 Z = 0 F(X, Y, Z) = 11 + 10 + 1 0 0 = 1 + 0 + 0 = 1 Row 7 X = 1 Y = 1 Z = 1 F(X, Y, Z) = 11 + 11 + 1 0 1 = 1 + 1 + 0 = 1

This function can be written as F(X, Y, Z) = (3, 5, 6, 7) where the 1’s are

= (0, 1, 2, 4) where the 0’s are

The Basic Unusual Boolean Theorem

Here are two sets of theorems in Boolean algebra. For all X 0 X = 0 OK For all X 1 X = X OK For all X 0 + X = X OK For all X 1 + X = 1 What? Consider the following truth tables W X W + X 0 0 0 0 1 1 1 0 1 1 1 1 From this, we derive the truth table proving the last two theorems. X 0 + X 1 + X 0 0 1 1 1 1

The Principle of Duality

If a statement in Boolean algebra is true, so is its dual. To take the dual of an expression do the following: change all logical AND to logical OR and all logical OR to logical AND change all 0 to 1 and 1 to 0. Postulate Dual 0 X = 0 1 + X = 1 1 X = X 0 + X = X 0 + X = X 1 X = X 1 + X = 1 0 X = 0 An Unexpected Pair: Two distributive laws, each the dual of the other. For all Boolean values of Boolean variables A, B, C: A(B + C) = AB + AC For all Boolean values of Boolean variables A, B, C: A + BC = (A + B)(A + C) If A = 1, the statement becomes 1 + BC = (1 + B)(1 + C), or 1 = 11. If A = 0, the statement becomes 0 + BC = (0 + B)(0 + C), or BC = BC.