Presentation is loading. Please wait.

Presentation is loading. Please wait.

Boolean or, Switching Algebra. Switching Algebra The two-valued Boolean algebra is also called “Switching algebra” by engineers and computer scientists.

Similar presentations


Presentation on theme: "Boolean or, Switching Algebra. Switching Algebra The two-valued Boolean algebra is also called “Switching algebra” by engineers and computer scientists."— Presentation transcript:

1 Boolean or, Switching Algebra

2 Switching Algebra The two-valued Boolean algebra is also called “Switching algebra” by engineers and computer scientists.

3 Switching algebra “switching algebra” –deals with boolean values -- 0, 1 Positive-logic convention –analog voltages LOW, HIGH --> 0, 1 Negative logic -- seldom used Signal values denoted by variables (X, Y, FRED, etc.)

4 Boolean operators Complement:X (opposite of X) AND:X  Y OR:X + Y Axiomatic definition: A1-A5, A1-A5 binary operators, described functionally by truth table.

5 More definitions Literal: a variable or its complement X, X, FRED, CS_L Expression: literals combined by AND, OR, parentheses, complementation X+Y P  Q  R A + B  C ((FRED  Z) + CS_L  A  B  C + Q5)  RESET Equation: Variable = expression P = ((FRED  Z) + CS_L  A  B  C + Q5)  RESET

6 Logic symbols

7 Theorems

8 Complement notations ~ x x’  x x x’ prime notation is the easiest to type.

9 Operator precedence 1.Parentheses 2.NOT 3.AND 4.OR

10 DeMorgan’s theorem An n-input AND gate whose output is complemented is equivalent to an n-input OR gate whose inputs are complemented. (x. y)’ = x’ + y’

11 DeMorgan Symbol Equivalence

12 Likewise for OR

13 DeMorgan Symbols

14 Boolean function A Boolean function is an expression formed with binary variables, the binary operators OR and AND, and unary operator NOT, parentheses, and an equal sign. For a given value of the variables, the function can be either 0 or 1. F = x. Y. z’

15 Simplify a Boolean function F = x.(x’ + y) = x.x’ + x.y = 0 + x.y = x.y F = x.y + x’.z + y.zconsensus, T11 = x.y + x’.z + y.z.(x + x’) = x.y + x’.z + y.z.x + y.z.x’ = x.y.(1 + z) + x’.z.(1 + y) = x.y + x’.z

16 Truth table The most basic representation of a logic function is the truth table. This representation simply lists the output of the circuit for every possible input combination. Normally, the input combinations are arranged in rows in ascending order, and the corresponding outputs are written in a column next to the rows. The truth table for an n -variable logic function has 2 n rows. Obviously truth tables are practical for logic functions with small n. John Wakerly mentioned that for students it is about 10 and for everyone else it is about 4.

17 Truth table The information contained in a truth table can also be conveyed algebraically.

18 Truth table vs. minterms & maxterms

19 Minterm and Maxterm Each minterm is obtained from an AND term of the n variables, with each variable being primed if the corresponding bit of the binary number is a 0 and unprimed if a 1. Each maxterm is obtained from an OR term of the n variables, with each variable being unprimed if the corresponding bit of the binary number is a 0 and primed if a 1.

20 Boolean function from truth table A Boolean function may be expressed algebraically from a given truth table by forming a minterm for each combination of the variables that produces a 1 in the function, and then taking the OR of all those terms. Any Boolean function can be expressed as a canonical sum (sum of minterms). Any Boolean function can be expressed as a canonical product (product of maxterms).

21 Boolean function as a sum of minterms: Any Boolean function can be expressed as a canonical sum. The canonical sum of a logic function is a sum of the minterms corresponding to truth-table rows for which the function produces a 1 output. 10011011 i = 01234567 F =  x,y,z (0,3,4,6,7) = X’.Y’.Z’ + X’.Y.Z + X.Y’.Z’ + X.Y.Z’ + X.Y.Z

22 Boolean function as a pruduct of maxterms: Any Boolean function can be expressed as a canonical pruduct. The canonical pruduct of a logic function is a pruduct of the maxterms corresponding to truth-table rows for which the function produces a 0 output. 10011011 i = 01234567 F =  x,y,z (1,2,5) = (X+Y+Z’). (X+Y’+Z). (X’+Y+Z’)

23 F =  x,y,z (0,3,4,6,7) =  x,y,z (1,2,5) 10011011 i = 01234567 F’ =  x,y,z (1,2,5) F’ = X’.Y’.Z + X’.Y.Z’ + X.Y’.Z (F’)’ = (X’.Y’.Z + X’.Y.Z’ + X.Y’.Z)’ F = (X+Y+Z’). (X+Y’+Z). (X’+Y+Z’) F =  x,y,z (1,2,5)

24 Combinational-Circuit Analysis We analyze a combinational logic circuit by obtaining a formal description of its logic function. Once we have a description of the logic function: we can determine the behaviour of the circuit for various input combinations. We can manipulate the algebraic description to suggest different circuit structure. We can convert to sum-of-products expression for PLDs. We can use to analyze a larger system that includes it.

25 Combinational analysis There are a number of ways to obtain a formal description of the circuit’s function.

26 Obtaining truth table Produce output from different input combinations ( 2 n ).

27 Signal expressions Multiply out: F = ((X + Y’). Z) + (X’. Y. Z’) = (X. Z) + (Y’. Z) + (X’. Y. Z’)

28 New circuit, same function

29 Another example

30 Circuit Descriptions and Designs What is the starting point for designing combinational logic circuit? Usually, we are given a word description of a problem occasionally, the description is a list of input combinations (ON, OFF), the verbal equivalent of a truth table or the canonical sum or product.

31 Combinational-Circuit Analysis Combinational circuits -- outputs depend only on current inputs (not on history). Kinds of combinational analysis: –exhaustive (truth table) –algebraic (expressions) –simulation / test bench Write functional description using schematic editor Write functional description in HDL Define test conditions / test vecors, including corner cases Compare circuit output with functional description (or known- good realization) Repeat for “random” test vectors

32 Example, 4-bit prime number detector Given a 4-bit input combination N = N 3 N 2 N 1 N 0, this function produces a 1 output for N = 1, 2, 3, 5, 7, 11, 13 and 0 otherwise. A logic function described in this way can be designed directly from the canonical sum or product expression. 0111 0101 0001 0100 i = 0123 4567 89AB CDEF F =  N 3 N 2 N 1 N 0 (1, 2, 3, 5, 7, 11, 13) = N’ 3 N’ 2 N’ 1 N 0 + N’ 3 N’ 2 N 1 N’ 0 + N’ 3 N’ 2 N 1 N 0 + …

33 Design from truth table Truth table --> canonical sum (sum of minterms) Example: prime-number detector –4-bit input, N 3 N 2 N 1 N 0 row N 3 N 2 N 1 N 0 F 0 0 0 0 0 0 1 0 0 0 1 1 2 0 0 1 0 1 3 0 0 1 1 1 4 0 1 0 0 0 5 0 1 0 1 1 6 0 1 1 0 0 7 0 1 1 1 1 8 1 0 0 0 0 9 1 0 0 1 0 10 1 0 1 0 0 11 0 0 1 1 1 12 1 1 0 0 0 13 1 1 0 1 1 14 1 1 1 0 0 15 1 1 1 1 0 F =   (1,2,3,5,7,11,13)

34 Minterm list --> canonical sum

35 Algebraic simplification Theorem T8, Reduce number of gates and gate inputs

36 Reduced circuit

37 Combinational-Circuit Design Sometimes you can write an equation or equations directly using “logic” (the kind in your brain). Example (alarm circuit): Corresponding circuit:

38 Circuit Descriptions and Designs The alarm output is 1 if the PANIC input is 1, or if the ENABLE input is 1, the EXITING input is 0, and the house is not secure; the house is secure if the WINDOW, DOOR, and GARAGE inputs are all 1. ALARM = PANIC + ENABLE. EXITING’. SECURE’ SECURE = WINDOW. DOOR. GARAGE ALARM = PANIC + ENABLE. EXITING’. (WINDOW. DOOR. GARAGE)’

39 Alarm Circuit

40 Modified Alarm Function “Multiply out”: ALARM = PANIC + ENABLE. EXITING’. (WINDOW. DOOR. GARAGE)’ ALARM = PANIC + ENABLE. EXITING’. (WINDOW’ + DOOR’ + GARAGE’) ALARM = PANIC + ENABLE. EXITING’. WINDOW’ + ENABLE. EXITING’. DOOR’ + ENABLE. EXITING’. GARAGE’

41 Alarm-circuit transformation Sum-of-products form –Useful for programmable logic devices (PLDs)

42 circuit transformation The design methods that we have described so far use AND, OR, and NOT gates. We might like to use NAND and NOR gates, too because - they are faster than ANDs and ORs in most technologies. But we develop a logic expression from normal logic (ANDs and ORs) and then we translate it into other forms using NAND and NOR gates. –An AND-OR (sum-of-products) circuit may be converted to a NAND-NAND circuit, and –a OR-AND (product-of- sums) circuit may be converted to a NOR-NOR circuit.

43 Sum-of-products form AND-OR NAND-NAND

44 Product-of-sums form OR-AND NOR-NOR P-of-S preferred in CMOS, TTL (NAND-NAND)


Download ppt "Boolean or, Switching Algebra. Switching Algebra The two-valued Boolean algebra is also called “Switching algebra” by engineers and computer scientists."

Similar presentations


Ads by Google