Download presentation
Presentation is loading. Please wait.
Published byClaud Richard Modified over 9 years ago
1
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
2
2 What is Propositional logic? Propositional logic is a mathematical model that allows us to reason about the truth or falsehood of logical expressions. Propositional logic is used in the design of computer circuits. Propositional logic is made up of propositions. A proposition is any statement that evaluates to one of the truth values TRUE or FALSE.
3
3 Propositional Variables A proposition variable is a variable that stands for some proposition. For example, p c < d NOT p NOT (c < d) means “is equivalent to” or “has the same Boolean value as”. In this class I will use the terms propositional and Boolean interchangeably.
4
4 Logical Expressions Logical expressions are made up of –Boolean variables –Boolean constants –Boolean operators There is no strict naming convention for Boolean variables. There are only two Boolean constants, TRUE and FALSE. There are many Boolean operators, the most frequently used being NOT, AND, and OR.
5
5 Truth Tables Boolean functions are commonly displayed using truth tables. The truth tables for the NOT, AND, and OR operators are as follows. A NOT A A B A AND B A B A OR B 0 1 0 0 0 0 0 0 1 00 1 0 0 1 1 1 0 0 1 0 1 1 1 1 1 1 1
6
6 Truth Tables Other Boolean operators include XOR (exclusive or), NAND (not-and), and NOR (not-or). NAND and NOR transistors are well represented in circuit design due to their simplicity. A B A XOR B A B A NAND B A B A NOR B 0 0 0 0 0 1 0 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1 1 0 0 1 1 0 1 1 0 1 1 0
7
7 Transistor Implementation of Elementary Logic Gates
8
8 Precedence of Logical Operators The order of precedence is.. 1. NOT (highest) 2. NAND 3. NOR 4. AND 5. OR 6. (lowest)
9
9 Shorthand Notations for Boolean Operators NOT A A A NAND B AB A NOR B A+B A AND B AB A OR B A+B Common misconceptions: AB AB A+B A+B
10
10 Evaluating Complex Boolean Expressions with Truth Tables Truth tables can be used to verify the equality of inequality of two or more Boolean expressions. The size of a truth table grows exponentially relative to the number of variables in the Boolean expression. –The number of entries (rows) in a truth table is 2 n where n represents the number of variables in the expression. Truth tables are one of the principle tools used in digital circuit design.
11
11 Evaluating Complex Boolean Expressions with Truth Tables AB + CA A(B + C) A B C AB C CA AB+CA B+C A(B+C) 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 1 0 0 0 0 1 0 1 0 0 0 1 1 1 1 1 1 0 1 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1
12
12 Boolean Identities Boolean identities are rules used to simplify Boolean expressions.
13
13 Proof of DeMorgan’s Law X + Y = XY
14
14 More Useful Boolean Identities
15
15 Circuit Design Problem Design a combinational circuit that determines if a binary value in the range of 0 to 7 (000b to 111b) is prime. P(A,B,C) 1 if the value ABC is prime and 0 if ABC is not prime. Circuit P A B C High-level block diagram
16
16 Circuit Design Problem Steps to developing the “Prime” circuit: 1. Construct the truth table. 2. Express the value of the truth table as a Boolean expression in sum of the min terms format. 3. Using Boolean identities, simplify the Boolean expression. 4. Draw the circuit from the simplified Boolean expression.
17
17 Circuit Design Problem 1. Draw the truth table A, B, and C are the inputs to the circuit; P is the output. A, B, and C collectively represent a single three digit unsigned binary number. A is the most significant digit and C is the least significant digit. If the digit is prime the output, P, is high (1); if the digit is not prime the output, P, is low (0).
18
18 Circuit Design Problem 2. Express the value of the truth table in sum of the min terms format. Notice that each term in the expression corresponds to the values for A, B, and C when P is high
19
19 Circuit Design Problem 3. Using Boolean identities, simplify the Boolean expression. Simplest form
20
20 Circuit Design Problem 4. Draw the circuit from the simplified Boolean expression. Circuit P A B C
21
21 Digital Logic Gates
22
22 Digital Logic Gates
23
23 Implementation of Boolean Functions with Gates Both of these circuits are logically equivalent. However, version (b) saves on performance, space, and cost.
24
24 Karnaugh Maps Karnaugh maps (a.k.a. k-maps) provide an alternative technique for simplifying Boolean expressions. K-maps are most commonly used for Boolean expressions containing 2, 3, or 4 variables. Steps to using a k-map in a digital design 1. Construct the truth table. 2. Transfer the value (output) of the truth table to an appropriate size k-map. 3. Group the appropriate elements of the k-map. 4. Convert the groupings to the resulting simplified Boolean expression.
25
25 Karnaugh Map Grouping Rules Each grouping must be a power of 2: 1, 2, 4, 8, 16, etc. Each grouping must be in the shape of a square or a rectangle - no diagonals are allowed. Groupings may overlap. Each grouping should be as large as possible so as to minimize the total number of groupings. Each grouping should have at least one element that is not a part of another grouping.
26
26 Karnaugh Map Example Using a Karnaugh map to generate a simplified Boolean expression for the prime number problem.
27
27 Three-Variable K-Map Interpretation Each box in the k-map corresponds to a row in the truth table. Row 1 is m 0, row 2 is m 1, etc. The boxes do not follow a strict sequential numbering. The labeled brackets in illustration (b) show where the corresponding variable has a value of 1.
28
28 Karnaugh Map Interpretation The grouping of 4 is completely inside the area of the k-map where C 1. This gives us the term C. The grouping of 2 is completely inside the area of the k-map where B 1, and completely outside the area where A 1. This gives us the term AB.
29
29 Two-Variable Karnaugh Maps m i represents a min-term –m 0 = 00 –m 1 = 01 –m 2 = 10 –m 3 = 11
30
30 Four-Variable Karnaugh Maps
31
31 “Don’t Care” Conditions Occasionally there will be combinations of inputs that will never occur for one reason or another. For those combinations we can label the outputs as don’t-cares by putting an ‘X’ in the corresponding output field. An ‘X’ may be treated either as a 0 or a 1 in k-map simplification.
32
32 Propagation Delay for an Inverter Gate
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.