Propositional Calculus. Math Foundations of Computer Science
|
|
- Brendan Cannon
- 6 years ago
- Views:
Transcription
1 Propositional Calculus Math Foundations of Computer Science
2 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they can use it to codify logical statements and to reason about these statements. To illustrate how a computer can be used to carry out formal proofs and to provide a framework for logical deduction. 2
3 Propositional Calculus Topics Motivation Boolean functions and expressions Rules of Boolean Algebra Logic Minimization Tautologies and automatic verification of tautologies Satisfiability Propositional calculus in ACL2 Application to Circuit Design
4 Readings Chapter 2 Propositional Logic, in Reasoning About Programs, P. Manolios Chapters 12 and 13 from Aho and Ullman Optional Electronic text on Logic and Proofs Sign up at oli.cmu.edu (online learning initiative) Part of the course and logic tutors are available for free, the full course has a fee of $40 (Course key drexelandp)
5 Word Problem Tom likes Jane if and only if Jane likes Tom. Jane likes Bill. Therefore, Tom does not like Jane. Let p denote Tom likes Jane Let q denote Jane likes Tom Let r denote Jane likes Bill ((p q) r) p encodes the above claim The claim is not valid as the assignment p = true, q = true, and r = true evaluates to false
6 Programming Example Boolean expressions arise in conditional statements. It is possible to abstract the relations with boolean variables (propositions that are either true or false). Using this abstraction one can reason and simplify conditional statements. if ((a < b) ((a >= b) && (c == d)) then { } else { } Let p denote the relation (a<b) and q denote the relation (c == d). The above expression is then equal to p!p && q 6
7 Programming Example (cont) The previous expression is equivalent (two expressions are equivalent if they are true for the same values of the variables occurring in the expressions) to a simpler expression (p!p && q) p q We can see this since if p is true both expressions are true, and if p is false, then!p is true and (!p && q) is true exactly when q is true. 7
8 Limitations of Propositional Calculus Propositions hide the information in the predicates they abstract. Sometimes properties of the hidden information is required to make further deductions. E.G. for integers a,b, and c, (a < b) && (b < c) implies that a < c; however, this can not be deduced without using the order properties of the integers. The predicate calculus allows the use of predicates to encode this additional information. E.G. we can introduce a parameterized predicate lt(a,b) to encode the predicate a < b. Properties such as lt(a,b) && lt(b,c) lt(a,c) can be asserted. This type of notation and deduction is called predicate calculus and will be discussed later. 8
9 Boolean Functions A Boolean variable has two possible values (true/false) (1/0). A Boolean function has a number of Boolean input variables and has a Boolean valued output. x 0 x 1 f s x 0 x 1 f A Boolean function can be described using a truth table. There are 2 2n Boolean function of n variables. s Multiplexor function
10 Boolean Expressions An expression built up from variables, and, or, and not. x y x y x y x y x x and or not 10
11 Boolean Expressions BExpr := Constant: T F [t nil] Variable [symbol] Negation: BExpr [(not BExpr)] And: BExpr BExpr [(and BExpr BExpr) Or: BExpr Bexpr [(or BExpr BExpr)] 11
12 Expression Trees Boolean expressions can be represented by a binary tree Internal nodes are operators Leaf nodes are operands Consider p (1 q): p 1 q
13 Evaluation (defun bool-eval (expr env) (cond )) ( (is-constant expr) expr ) ( (is-variable expr) (lookup expr env) ) ( (is-not expr) (not (bool-eval (op expr) env)) ) ( (is-or expr) (or (bool-eval (op1 expr) env) (bool-eval (op2 expr) env)) ) ( (is-and expr) (and (bool-eval (op1 expr) env) (bool-eval (op2 expr) env)) )
14 Short Circuit Evaluation (defun sc-eval (expr env) (cond ( (is-constant expr) expr ) ( (is-variable expr) (lookup expr env) ) ( (is-not expr) (not (sc-eval (op expr) env)) ) ( (is-or expr) (if (sc-eval (op1 expr) env) t (sc-eval (op2 expr) env) ) ) ( (is-and expr) (if (sc-eval (op1 expr) env) (sc-eval (op2 expr) env) nil ) ) ))
15 If-then-else The ternary boolean function ite(p,q,r) can be used to represent,, and p ite(p,0,1) p q ite(p,1,q) p q ite(p,q,0) p q r ite(p,q,r)
16 Conversion to ite Expression Any Boolean expression can be converted to an equivalent expression using ite (bool-eval expr env) (ite-eval (bool2ite expr) env) ite p p ite ite q q 0 1
17 bool2ite (defun bool2ite (expr) (cond ( (is-constant expr) expr ) ( (is-variable expr) expr ) ( (is-not expr) (list 'ite (bool2ite (op1 expr)) nil t) ) ( (is-or expr) (list 'ite (bool2ite (op1 expr)) t (bool2ite (op2 expr))) ) ( (is-and expr) (list 'ite (bool2ite (op1 expr)) (bool2ite (op2 expr)) nil) ) ) )
18 Ite-eval (defun ite-eval (expr env) (cond ( (is-constant expr) expr ) ( (is-variable expr) (lookup expr env) ) ( (is-ite expr) (if (ite-eval (op1 expr) env) (ite-eval (op2 expr) env) (ite-eval (op3 expr) env)) ) ) )
19 Equivalence of Conversion Want to prove that (bool-eval expr env) = (ite-eval (bool2ite expr) env) Lemma ite 1. p ite(p,0,1) 2. p q ite(p,1,q) 3. p q ite(p,q,0) p q ite(p,0,1) p ite(p,1,q) p q ite(p,q,0) p q
20 Equivalence of Conversion (bool-eval expr env) = (ite-eval (bool2ite expr) env) Proof by induction on expr using Lemma ite [Base case] constant or variable. In this case (bool2ite expr) = expr and bool-eval and iteeval return the same thing
21 Equivalence of Conversion [Not] Assume (bool-eval expr1 env) = (ite-eval (bool2ite expr1)) (ite-eval (bool2ite (not expr1)) env) = (ite-eval (ite (bool2ite expr1) nil t) env) [by def of bool2ite] = (not (ite-eval (bool2ite expr1) env)) [by Lemma ite part 1] = (not (bool-eval expr1 env)) [by IH] = (bool-eval (not expr1) env) [by def of bool-eval]
22 Equivalence of Conversion [Or] Assume (bool-eval expr1 env) = (ite-eval (bool2ite expr1)) and (bool-eval expr2 env) = (iteeval (bool2ite expr2)) (ite-eval (bool2ite (or expr1 expr2)) env) = (ite-eval (ite (bool2ite expr1) t (bool2ite expr2)) env) [by def of bool2ite] = (or (ite-eval (bool2ite expr1) env) (ite-eval (bool2ite expr2) env)) [by Lemma ite part 2] = (or (bool-eval expr1 env) (bool-eval expr2 env)) [by IH] = (bool-eval (or expr1 expr2) env) [by def of bool-eval]
23 Equivalence of Conversion [And] Assume (bool-eval expr1 env) = (ite-eval (bool2ite expr1)) and (bool-eval expr2 env) = (iteeval (bool2ite expr2)) (ite-eval (bool2ite (and expr1 expr2)) env) = (ite-eval (ite (bool2ite expr1) (bool2ite expr2) nil) env) [by def of bool2ite] = (and (ite-eval (bool2ite expr1) env) (ite-eval (bool2ite expr2) env)) [by Lemma ite part 3] = (and (bool-eval expr1 env) (bool-eval expr2 env)) [by IH] = (bool-eval (and expr1 expr2) env) [by def of booleval]
24 Exercise Implement a recursive function to convert ite expressions to boolean expressions (ite2bool iexpr) Use and define the following helper functions (is-ite expr) Check for (ite ) (is-itenot iexpr) Check for (ite iexpr nil t) (is-iteor iexpr) Check for (ite iexpr t iexpr) (is-iteand iexpr) Check for (ite iexpr iexpr nil)
25 Solution (defun is-itenot (iexpr) (and (equal (op2 iexpr) nil) (equal (op3 iexpr) t))) (defun is-iteor (iexpr) (equal (op2 iexpr) t)) (defun is-iteand (iexpr) (equal (op3 iexpr) nil))
26 Solution (defun ite2bool (iexpr) (cond ( (is-constant iexpr) iexpr ) ( (is-variable iexpr) iexpr ) ( (is-ite iexpr) (cond ( (is-itenot iexpr) (list 'not (ite2bool (op1 iexpr))) ) ( (is-iteor iexpr) (list 'or (ite2bool (op1 iexpr)) (ite2bool (op3 iexpr))) ) ( (is-iteand iexpr) (list 'and (ite2bool (op1 iexpr)) (ite2bool (op2 iexpr))) ) ))))
27 Solution Remark Note that there is one overlap in Not (ite p nil t) Or (ite p t q) And (ite p q nil) (ite p t nil) = (and p t) = (or p nil) = p This implies (ite2bool (bool2ite (and p t)) = (or p t) not equal to the initial expression However, (ite2bool (bool2ite expr)) expr, i.e. (booleval expr) = (ite2bool (bool2ite expr))
28 Correctness of ite2bool Use induction to prove (equiv (ite2bool (bool2ite expr)) expr) Base case: expr is a constant or variable (not expr) (or expr1 expr2) (and expr1 expr2)
29 Solution Show (equiv (ite2bool (bool2ite expr)) expr) Base case: if expr is a constant or variable then (ite2bool (bool2ite expr)) = (ite2bool expr) = expr [by def] [Not] Assume (equiv (ite2bool (bool2ite expr)) expr) (ite2bool (bool2ite (not expr))) = (ite2bool (list ite (bool2ite expr) nil t))) [by def b2ite] = (not (ite2bool (bool2ite expr))) [by def ite2bool and Lemma ite ] (not expr) [by IH]
30 Solution [Or] Assume (equiv (ite2bool (bool2ite expr1)) expr1) and (equiv (ite2bool (bool2ite expr2) expr2) (ite2bool (bool2ite (or expr1 expr2))) = (ite2bool (list ite (bool2ite expr1) t (bool2ite expr2))) [by def of bool2ite] = (or (ite2bool (bool2ite expr1)) (ite2bool (bool2ite expr2))) [by def of ite2bool and Lemma ite] (or expr1 expr2) [by IH]
31 Solution [And] Assume (equiv (ite2bool (bool2ite expr1)) expr1) and (equiv (ite2bool (bool2ite expr2) expr2) (ite2bool (bool2ite (and expr1 expr2))) = (ite2bool (list ite (bool2ite expr1) (bool2ite expr2) nil)) [by def of bool2ite] (and (ite2bool (bool2ite expr1)) (ite2bool (bool2ite expr2))) [by def of ite2bool and Lemma ite] (and expr1 expr2) [by IH]
32 Boolean Algebra The Boolean operators and are analogous to addition and multiplication with true and false playing the roles of 1 and 0. Complement is used for negation. This provides a compact notation and suggests appropriate algebraic simplification Similar properties hold such as the associative, commutative, and distributive identities.
33 Boolean Expressions A Boolean expression is a Boolean function Any Boolean function can be written as a Boolean expression s x 0 x 1 f Disjunctive normal form (sums of products) For each row in the truth table where the output is true, write a product such that the corresponding input is the only input combination that is true Not unique E.G. (multiplexor function)
34 Boolean Algebra Boolean expressions can be simplified using rules of Boolean algebra Identity law: A + 0 = A and A 1 = A. Zero and One laws: A + 1 = 1 and A 0 = 0 Inverse laws: Idempotent laws: A + A = A = A A Commutative laws: A + B = B + A and A B = B A. Associative laws: A + (B + C) = (A + B) + C and A (B C) = (A B) C. Distributive laws: A (B + C) = (A B) + (A C) and A + (B C) = (A + B) (A + C) DeMorgan s laws: The reason for simplifying is to obtain shorter expressions, which we will see leads to simpler logic circuits.
35 Simplification of Boolean Expressions Simplifying multiplexor expression using Boolean algebra Verify that the boolean function corresponding to this expression as the same truth table as the original function. 35
36 Simplifying Expression Trees Constant folding p p p 1 1 q
37 Assignment Implement and test (bool-simp expr) (bool-simp expr) returns a simplified boolean expression using the following simplifications 1. evaluate all constant subexpressions 2. (not (not expr)) -> expr 3. (and t expr) -> expr 4. (and expr t) -> expr 5. (and nil expr) -> nil 6. (and expr nil) -> nil 7. (or t expr) -> t 8. (or expr t) -> t 9. (or nil expr) -> expr 10. (or expr nil) -> expr
38 Assignment Simplification (2) is done through the helper routine not-simp. Simplifications (3)-(6) are done through the helper routine and-simp. Simplifications (7)-(10) are done through the helper routine or-simp. bool-simp traverses the boolean expression and recursively simplifies all operands to not, or and and and calls the appropriate helper routineto perform operator specific simplifiations and constant evaluation.
39 Assignment Prove the following lemmas 1. (bool-eval '(not expr) env) = (bool-eval (notsimp expr) env) 2. (bool-eval '(and expr1 expr2) env) = (bool-eval (and-simp expr1 expr2) env) 3. (bool-eval '(or expr1 expr2) env) = (bool-eval (or-simp expr1 expr2) env) 4. (bool-eval expr env) = (bool-eval (bool-simp expr) env)
40 Assignment Prove using induction on expr that (bool-eval expr env) = (bool-eval (bool-simp expr) env) Prove by induction that (bool-simp expr) Has no double negations Is either a constant or an expression with no constants Write an is-simplified function to test whether the output of (bool-simp expr) satisfies this property
41 Additional Notation Several additional Boolean functions of two variables have special meaning and are given special notation. By our previous results we know that all boolean functions can be expressed with not, and, and or; so the additional notation is simply a convenience. x y x y implication x y x y equivalence 41
42 Tautologies A tautology is a boolean expression that is always true, independent of the values of the variables occurring in the expression. The properties of Boolean Algebra are examples of tautologies. Tautologies can be verified using truth tables. The truth table below shows that x y x y x y x y x y
43 Exercise Derive the tautology x y x y from the sum of products expression obtained from the truth table for x y. You will need to use properties of Boolean algebra to simplify the sum of products expression to obtain the desired equivalence. 43
44 Tautology Checker A program can be written to check to see if a Boolean expression is a tautology. Simply generate all possible truth assignments for the variables occurring in the expression and evaluate the expression with its variables set to each of these assignments. If the evaluated expressions are always true, then the given Boolean expression is a tautology. A similar program can be written to check if any two Boolean expressions E1 and E2 are equivalent, i.e. if E1 E2. Such a program has been provided. 44
45 Satisfiability A formula is satisfiable if there is an assignment to the variables that make the formula true A formula is unsatisfiable if all assignments to variables eval to false A formula is falsifiable if there is an assignment to the variables that make the formula false A formula is valid if all assignments to variables eval to true (a valid formula is a theorem or tautology)
46 Satisfiability Checking to see if a formula f is satisfiable can be done by searching a truth table for a true entry Exponential in the number of variables Does not appear to be a polynomial time algorithm (satisfiability is NP-complete) There are efficient satisfiability checkers that work well on many practical problems Checking whether f is satisfiable can be done by checking if f is a tautology An assignment that evaluates to false provides a counter example to validity
47 Propositional Logic in ACL2 In beginner mode and above ACL2S B!>QUERY (thm (implies (and (booleanp p) (booleanp q)) (iff (implies p q) (or (not p) q)))) << Starting proof tree logging >> Q.E.D. Summary Form: ( THM...) Rules: NIL Time: 0.00 seconds (prove: 0.00, print: 0.00, proof tree: 0.00, other: 0.00) Proof succeeded.
48 Propositional Logic in ACL2 ACL2 >QUERY (thm (implies (and (booleanp p) (booleanp q)) (iff (xor p q) (or p q)))) **Summary of testing** We tested 500 examples across 1 subgoals, of which 1 (1 unique) satisfied the hypotheses, and found 1 counterexamples and 0 witnesses. We falsified the conjecture. Here are counterexamples: [found in : "Goal''"] (IMPLIES (AND (BOOLEANP P) (BOOLEANP Q) P) (NOT Q)) -- (P T) and (Q T)
49 Karnaugh Map A Karnaugh map is a two dimensional version of a truth table. It can be used to simplify Boolean expressions expressed as sums of products. This example shows the Karnaugh table for the truth table defining implication. There is a 1 in each box corresponding to each value of p and q where x y is true and a 0 where it is false. y=0 y=1 x=0 1 1 x=
50 Logic Minimization We want a sum of products that is true for all of the boxes with 1 s (a cover). One such cover is obtained using a product for each individual box. A simpler expression can be obtained using the literals!x and y which cover the first row and the second column respectively. This shows that x y x y This can be generalized to more the one variable (Sec. 12.5) 50
51 Logic Circuits A single line labeled x is a logic circuit. One end is the input and the other is the output. If A and B are logic circuits so are: and gate A B or gate A B inverter (not) A 51
52 Logic Circuits Given a boolean expression it is easy to write down the corresponding logic circuit Here is the circuit for the original multiplexor expression x 0 x 1 s 52
53 Logic Circuits Here is the circuit for the simplified multiplexor expression x 0 x 1 s 53
54 Nand Nand negation of the conjunction operation: x y x y A nand gate is an inverted and gate: 54
55 Nand is functionally complete All boolean functions can be implemented using nand gates (and, or and not can be implemented using nand) not: and: or:
56 Decoder A decoder is a logic circuit that has n inputs (think of this as a binary number) and 2 n outputs. The output corresponding to the binary input is set to 1 and all other outputs are set to 0. d 0 b 0 d 1 b 1 d 2 d 3 56
57 Encoder An encoder is the opposite of a decoder. It is a logic circuit that has 2 n inputs and n outputs. The output equal to the input line (in binary) that is set to 1 is set to 1. d 0 d 1 b 0 d 2 d 3 b 1 57
58 Multiplexor A multiplexor is a switch which routes n inputs to one output. The input is selected using a decoder. d 0 d 1 d 2 d 3 s 1 s 0 58
59 XOR One or the other, but not both Notation for circuits: x y x y x y
60 Exercise Derive a truth table for the output bits (Sum and CarryOut) of a full adder. Using the truth table derive a sum of products expression for Sum and CarryOut. Draw a circuit for these expressions. Using properties of Boolean algebra and Karnaugh Maps to simplify your expressions. Draw the CarryIn simplified circuits. a b Sum CarryOut 60
61 Solution Derive a truth table for the output bits (Sum and CarryOut) of a full adder. a b CarryIn Sum CarryOut s = a b c i + a bc i + ab c i + aac i c o = bc i + ac i + aa + aac i 61
62 Solution Simplification c o = bc i + ac i + aa + aac i c o = bc i + ac i + aa(1 + c i ) c o = bc i + ac i + aaa c o = bc i + ac i + aa s = a b c i + a bc i + ab c i + aac i s = (a b + ab )c i + (aa + a b )c i s = (a b)c i + (a b)c i s = (a b c ) i 62
63 CarryIn a Sum Full Adder CarryIn b CarryOut Sum = parity(a,b,carryin) a b c + a b c a b c CarryOut = majority(a,b,carryin) b CarryIn + a CarryIn + a b + a b CarryIn b CarryIn + a CarryIn + a b a b CarryIn CarryOut a b CarryIn Sum CarryOut a b Sum 63
Propositional Calculus. Math Foundations of Computer Science
Propositional Calculus Math Foundations of Computer Science Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they can use it to
More informationPropositional Calculus. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus
More informationPropositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson
Propositional Calculus: Boolean Functions and Expressions CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus Objective: To provide students with the concepts and
More informationPropositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson
Propositional Calculus: Boolean Algebra and Simplification CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Propositional Calculus Topics Motivation: Simplifying Conditional Expressions
More informationSAT Solver. CS 680 Formal Methods Jeremy Johnson
SAT Solver CS 680 Formal Methods Jeremy Johnson Disjunctive Normal Form A Boolean expression is a Boolean function Any Boolean function can be written as a Boolean expression s x 0 x 1 f Disjunctive normal
More informationCombinational Circuits Digital Logic (Materials taken primarily from:
Combinational Circuits Digital Logic (Materials taken primarily from: http://www.facstaff.bucknell.edu/mastascu/elessonshtml/eeindex.html http://www.cs.princeton.edu/~cos126 ) Digital Systems What is a
More information[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics
400 lecture note #4 [Ch 6] Set Theory 1. Basic Concepts and Definitions 1) Basics Element: ; A is a set consisting of elements x which is in a/another set S such that P(x) is true. Empty set: notated {
More informationComputer Organization and Levels of Abstraction
Computer Organization and Levels of Abstraction Announcements Today: PS 7 Lab 8: Sound Lab tonight bring machines and headphones! PA 7 Tomorrow: Lab 9 Friday: PS8 Today (Short) Floating point review Boolean
More informationLECTURE 4. Logic Design
LECTURE 4 Logic Design LOGIC DESIGN The language of the machine is binary that is, sequences of 1 s and 0 s. But why? At the hardware level, computers are streams of signals. These signals only have two
More informationProving Properties of Recursive Functions and Data Structures. CS 270 Math Foundations of CS Jeremy Johnson
Proving Properties of Recursive Functions and Data Structures CS 270 Math Foundations of CS Jeremy Johnson 1 Objective To implement and verify recursive functions for processing recursive data structures.
More informationInduction Schemes. Math Foundations of Computer Science
Induction Schemes Math Foundations of Computer Science Topics Induction Example Induction scheme over the naturals Termination Reduction to equational reasoning ACL2 proof General Induction Schemes Induction
More informationIT 201 Digital System Design Module II Notes
IT 201 Digital System Design Module II Notes BOOLEAN OPERATIONS AND EXPRESSIONS Variable, complement, and literal are terms used in Boolean algebra. A variable is a symbol used to represent a logical quantity.
More informationComputer Organization and Levels of Abstraction
Computer Organization and Levels of Abstraction Announcements PS8 Due today PS9 Due July 22 Sound Lab tonight bring machines and headphones! Binary Search Today Review of binary floating point notation
More informationSummary of Course Coverage
CS-227, Discrete Structures I Spring 2006 Semester Summary of Course Coverage 1) Propositional Calculus a) Negation (logical NOT) b) Conjunction (logical AND) c) Disjunction (logical inclusive-or) d) Inequalities
More informationSYNERGY INSTITUTE OF ENGINEERING & TECHNOLOGY,DHENKANAL LECTURE NOTES ON DIGITAL ELECTRONICS CIRCUIT(SUBJECT CODE:PCEC4202)
Lecture No:5 Boolean Expressions and Definitions Boolean Algebra Boolean Algebra is used to analyze and simplify the digital (logic) circuits. It uses only the binary numbers i.e. 0 and 1. It is also called
More information6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )
6. Combinational Circuits George Boole (85 864) Claude Shannon (96 2) Signals and Wires Digital signals Binary (or logical ) values: or, on or off, high or low voltage Wires. Propagate digital signals
More informationQUESTION BANK FOR TEST
CSCI 2121 Computer Organization and Assembly Language PRACTICE QUESTION BANK FOR TEST 1 Note: This represents a sample set. Please study all the topics from the lecture notes. Question 1. Multiple Choice
More information2. BOOLEAN ALGEBRA 2.1 INTRODUCTION
2. BOOLEAN ALGEBRA 2.1 INTRODUCTION In the previous chapter, we introduced binary numbers and binary arithmetic. As you saw in binary arithmetic and in the handling of floating-point numbers, there is
More informationTo prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):
CS 70 Discrete Mathematics for CS Fall 2003 Wagner Lecture 7 This lecture returns to the topic of propositional logic. Whereas in Lecture 1 we studied this topic as a way of understanding proper reasoning
More informationAssignment (3-6) Boolean Algebra and Logic Simplification - General Questions
Assignment (3-6) Boolean Algebra and Logic Simplification - General Questions 1. Convert the following SOP expression to an equivalent POS expression. 2. Determine the values of A, B, C, and D that make
More informationExperiment 4 Boolean Functions Implementation
Experiment 4 Boolean Functions Implementation Introduction: Generally you will find that the basic logic functions AND, OR, NAND, NOR, and NOT are not sufficient to implement complex digital logic functions.
More information4. Write a sum-of-products representation of the following circuit. Y = (A + B + C) (A + B + C)
COP 273, Winter 26 Exercises 2 - combinational logic Questions. How many boolean functions can be defined on n input variables? 2. Consider the function: Y = (A B) (A C) B (a) Draw a combinational logic
More informationChapter 2. Boolean Expressions:
Chapter 2 Boolean Expressions: A Boolean expression or a function is an expression which consists of binary variables joined by the Boolean connectives AND and OR along with NOT operation. Any Boolean
More informationReview. EECS Components and Design Techniques for Digital Systems. Lec 05 Boolean Logic 9/4-04. Seq. Circuit Behavior. Outline.
Review EECS 150 - Components and Design Techniques for Digital Systems Lec 05 Boolean Logic 94-04 David Culler Electrical Engineering and Computer Sciences University of California, Berkeley Design flow
More informationBOOLEAN ALGEBRA. Logic circuit: 1. From logic circuit to Boolean expression. Derive the Boolean expression for the following circuits.
COURSE / CODE DIGITAL SYSTEMS FUNDAMENTAL (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) BOOLEAN ALGEBRA Boolean Logic Boolean logic is a complete system for logical operations. It is used in countless
More informationBawar Abid Abdalla. Assistant Lecturer Software Engineering Department Koya University
Logic Design First Stage Lecture No.5 Boolean Algebra Bawar Abid Abdalla Assistant Lecturer Software Engineering Department Koya University Boolean Operations Laws of Boolean Algebra Rules of Boolean Algebra
More information1. Mark the correct statement(s)
1. Mark the correct statement(s) 1.1 A theorem in Boolean algebra: a) Can easily be proved by e.g. logic induction b) Is a logical statement that is assumed to be true, c) Can be contradicted by another
More informationCSE 20 DISCRETE MATH. Fall
CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam
More informationCSC Discrete Math I, Spring Sets
CSC 125 - Discrete Math I, Spring 2017 Sets Sets A set is well-defined, unordered collection of objects The objects in a set are called the elements, or members, of the set A set is said to contain its
More informationTo prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):
CS 70 Discrete Mathematics for CS Spring 2005 Clancy/Wagner Notes 7 This lecture returns to the topic of propositional logic. Whereas in Lecture Notes 1 we studied this topic as a way of understanding
More informationLSN 4 Boolean Algebra & Logic Simplification. ECT 224 Digital Computer Fundamentals. Department of Engineering Technology
LSN 4 Boolean Algebra & Logic Simplification Department of Engineering Technology LSN 4 Key Terms Variable: a symbol used to represent a logic quantity Compliment: the inverse of a variable Literal: a
More informationCombinational Logic & Circuits
Week-I Combinational Logic & Circuits Spring' 232 - Logic Design Page Overview Binary logic operations and gates Switching algebra Algebraic Minimization Standard forms Karnaugh Map Minimization Other
More informationA Survey of Mathematics with Applications 8 th Edition, 2009
A Correlation of A Survey of Mathematics with Applications 8 th Edition, 2009 South Carolina Discrete Mathematics Sample Course Outline including Alternate Topics and Related Objectives INTRODUCTION This
More informationBOOLEAN ALGEBRA AND CIRCUITS
UNIT 3 Structure BOOLEAN ALGEBRA AND CIRCUITS Boolean Algebra and 3. Introduction 3. Objectives 3.2 Boolean Algebras 3.3 Logic 3.4 Boolean Functions 3.5 Summary 3.6 Solutions/ Answers 3. INTRODUCTION This
More informationExperiment 3: Logic Simplification
Module: Logic Design Name:... University no:.. Group no:. Lab Partner Name: Mr. Mohamed El-Saied Experiment : Logic Simplification Objective: How to implement and verify the operation of the logical functions
More informationNP-Completeness. Algorithms
NP-Completeness Algorithms The NP-Completeness Theory Objective: Identify a class of problems that are hard to solve. Exponential time is hard. Polynomial time is easy. Why: Do not try to find efficient
More informationENGIN 112 Intro to Electrical and Computer Engineering
ENGIN 2 Intro to Electrical and Computer Engineering Lecture 5 Boolean Algebra Overview Logic functions with s and s Building digital circuitry Truth tables Logic symbols and waveforms Boolean algebra
More informationSimplification of Boolean Functions
COM111 Introduction to Computer Engineering (Fall 2006-2007) NOTES 5 -- page 1 of 5 Introduction Simplification of Boolean Functions You already know one method for simplifying Boolean expressions: Boolean
More informationSystems Architecture I
Systems Architecture I Topics Review of Digital Circuits and Logic Design Review of Sequential Logic Circuits Compilers, Assemblers, Linkers & Loaders Notes Courtesy of Jeremy R. Johnson Lec 2 Systems
More informationDefinition For vertices u, v V (G), the distance from u to v, denoted d(u, v), in G is the length of a shortest u, v-path. 1
Graph fundamentals Bipartite graph characterization Lemma. If a graph contains an odd closed walk, then it contains an odd cycle. Proof strategy: Consider a shortest closed odd walk W. If W is not a cycle,
More informationIntroduction to Computer Architecture
Boolean Operators The Boolean operators AND and OR are binary infix operators (that is, they take two arguments, and the operator appears between them.) A AND B D OR E We will form Boolean Functions of
More informationCSE 20 DISCRETE MATH. Winter
CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam
More informationCombinational Circuits
Combinational Circuits Q. What is a combinational circuit? A. Digital: signals are or. A. No feedback: no loops. analog circuits: signals vary continuously sequential circuits: loops allowed (stay tuned)
More informationHenry Lin, Department of Electrical and Computer Engineering, California State University, Bakersfield Lecture 7 (Digital Logic) July 24 th, 2012
Henry Lin, Department of Electrical and Computer Engineering, California State University, Bakersfield Lecture 7 (Digital Logic) July 24 th, 2012 1 Digital vs Analog Digital signals are binary; analog
More informationLogic Gates and Boolean Algebra ENT263
Logic Gates and Boolean Algebra ENT263 Logic Gates and Boolean Algebra Now that we understand the concept of binary numbers, we will study ways of describing how systems using binary logic levels make
More information7/25/2016. Example: Addition of Unsigned Bit Patterns. ECE 120: Introduction to Computing. Adding Two Non-Negative Patterns Can Overflow
University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 120: Introduction to Computing 2 s Complement Overflow and Boolean Logic Example: ddition of Unsigned Bit Patterns
More informationCombinational Logic Circuits
Chapter 2 Combinational Logic Circuits J.J. Shann (Slightly trimmed by C.P. Chung) Chapter Overview 2-1 Binary Logic and Gates 2-2 Boolean Algebra 2-3 Standard Forms 2-4 Two-Level Circuit Optimization
More informationFinite Model Generation for Isabelle/HOL Using a SAT Solver
Finite Model Generation for / Using a SAT Solver Tjark Weber webertj@in.tum.de Technische Universität München Winterhütte, März 2004 Finite Model Generation for / p.1/21 is a generic proof assistant: Highly
More informationSummary. Boolean Addition
Summary Boolean Addition In Boolean algebra, a variable is a symbol used to represent an action, a condition, or data. A single variable can only have a value of or 0. The complement represents the inverse
More informationCS8803: Advanced Digital Design for Embedded Hardware
CS883: Advanced Digital Design for Embedded Hardware Lecture 2: Boolean Algebra, Gate Network, and Combinational Blocks Instructor: Sung Kyu Lim (limsk@ece.gatech.edu) Website: http://users.ece.gatech.edu/limsk/course/cs883
More informationGate Level Minimization Map Method
Gate Level Minimization Map Method Complexity of hardware implementation is directly related to the complexity of the algebraic expression Truth table representation of a function is unique Algebraically
More informationSection 001. Read this before starting!
Points missed: Student's Name: Total score: / points East Tennessee State University Department of Computer and Information Sciences CSCI 25 (Tarnoff) Computer Organization TEST 2 for Fall Semester, 25
More informationMenu. Algebraic Simplification - Boolean Algebra EEL3701 EEL3701. MSOP, MPOS, Simplification
Menu Minterms & Maxterms SOP & POS MSOP & MPOS Simplification using the theorems/laws/axioms Look into my... 1 Definitions (Review) Algebraic Simplification - Boolean Algebra Minterms (written as m i ):
More informationChapter 3. Gate-Level Minimization. Outlines
Chapter 3 Gate-Level Minimization Introduction The Map Method Four-Variable Map Five-Variable Map Outlines Product of Sums Simplification Don t-care Conditions NAND and NOR Implementation Other Two-Level
More information6. Combinational Circuits. Building Blocks. Digital Circuits. Wires. Q. What is a digital system? A. Digital: signals are 0 or 1.
Digital Circuits 6 Combinational Circuits Q What is a digital system? A Digital: signals are or analog: signals vary continuously Q Why digital systems? A Accurate, reliable, fast, cheap Basic abstractions
More informationBoolean Algebra & Digital Logic
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
More informationChapter 2 Boolean algebra and Logic Gates
Chapter 2 Boolean algebra and Logic Gates 2. Introduction In working with logic relations in digital form, we need a set of rules for symbolic manipulation which will enable us to simplify complex expressions
More informationNotes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.
Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 1 / 1 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 1.3 1.4 of Rosen cse235@cse.unl.edu Introduction
More informationCSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Sections p.
CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Sections 10.1-10.3 p. 1/106 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer
More informationDiscrete Mathematics Lecture 4. Harper Langston New York University
Discrete Mathematics Lecture 4 Harper Langston New York University Sequences Sequence is a set of (usually infinite number of) ordered elements: a 1, a 2,, a n, Each individual element a k is called a
More informationCS40-S13: Functional Completeness
CS40-S13: Functional Completeness Victor Amelkin victor@cs.ucsb.edu April 12, 2013 In class, we have briefly discussed what functional completeness means and how to prove that a certain system (a set)
More informationCS470: Computer Architecture. AMD Quad Core
CS470: Computer Architecture Yashwant K. Malaiya, Professor malaiya@cs.colostate.edu AMD Quad Core 1 Architecture Layers Building blocks Gates, flip-flops Functional bocks: Combinational, Sequential Instruction
More informationLogic Design: Part 2
Orange Coast College Business Division Computer Science Department CS 6- Computer Architecture Logic Design: Part 2 Where are we? Number systems Decimal Binary (and related Octal and Hexadecimal) Binary
More informationLecture (04) Boolean Algebra and Logic Gates
Lecture (4) Boolean Algebra and Logic Gates By: Dr. Ahmed ElShafee ١ Dr. Ahmed ElShafee, ACU : Spring 26, Logic Design Boolean algebra properties basic assumptions and properties: Closure law A set S is
More informationLecture (04) Boolean Algebra and Logic Gates By: Dr. Ahmed ElShafee
Lecture (4) Boolean Algebra and Logic Gates By: Dr. Ahmed ElShafee Boolean algebra properties basic assumptions and properties: Closure law A set S is closed with respect to a binary operator, for every
More informationCOMP combinational logic 1 Jan. 18, 2016
In lectures 1 and 2, we looked at representations of numbers. For the case of integers, we saw that we could perform addition of two numbers using a binary representation and using the same algorithm that
More informationCOMPUTER SCIENCE. Paper 1
COMPUTER SCIENCE Paper 1 (THEORY) Three hours (Candidates are allowed additional 15 minutes for only reading the paper. They must NOT start writing during this time) ----------------------------------------------------------------------------------------------------------------------------------
More informationChapter 3. Boolean Algebra and Digital Logic
Chapter 3 Boolean Algebra and Digital Logic Chapter 3 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple logic circuits. Understand how
More informationHOL DEFINING HIGHER ORDER LOGIC LAST TIME ON HOL CONTENT. Slide 3. Slide 1. Slide 4. Slide 2 WHAT IS HIGHER ORDER LOGIC? 2 LAST TIME ON HOL 1
LAST TIME ON HOL Proof rules for propositional and predicate logic Safe and unsafe rules NICTA Advanced Course Forward Proof Slide 1 Theorem Proving Principles, Techniques, Applications Slide 3 The Epsilon
More informationRead this before starting!
Points missed: Student's Name: Total score: /100 points East Tennessee State University Department of Computer and Information Sciences CSCI 2150 (Tarnoff) Computer Organization TEST 1 for Spring Semester,
More informationBoolean Representations and Combinatorial Equivalence
Chapter 2 Boolean Representations and Combinatorial Equivalence This chapter introduces different representations of Boolean functions. It then discusses the applications of these representations for proving
More informationReasoning About Programs Panagiotis Manolios
Reasoning About Programs Panagiotis Manolios Northeastern University March 22, 2012 Version: 58 Copyright c 2012 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication
More informationComputer Science. Unit-4: Introduction to Boolean Algebra
Unit-4: Introduction to Boolean Algebra Learning Objective At the end of the chapter students will: Learn Fundamental concepts and basic laws of Boolean algebra. Learn about Boolean expression and will
More informationMath 55 - Spring 04 - Lecture notes # 1 - Jan 20 (Tuesday)
Math 55 - Spring 04 - Lecture notes # 1 - Jan 20 (Tuesday) Name, class, URL (www.cs.berkeley.edu/~demmel/ma55) on board Head TA Mike West speaks on bureaucracy Advertise CS 70 (T Th 2-3:30) as an "honors"
More informationBoolean Logic CS.352.F12
Boolean Logic CS.352.F12 Boolean Algebra Boolean Algebra Mathematical system used to manipulate logic equations. Boolean: deals with binary values (True/False, yes/no, on/off, 1/0) Algebra: set of operations
More informationLOGIC AND DISCRETE MATHEMATICS
LOGIC AND DISCRETE MATHEMATICS A Computer Science Perspective WINFRIED KARL GRASSMANN Department of Computer Science University of Saskatchewan JEAN-PAUL TREMBLAY Department of Computer Science University
More informationVLSI System Design Part II : Logic Synthesis (1) Oct Feb.2007
VLSI System Design Part II : Logic Synthesis (1) Oct.2006 - Feb.2007 Lecturer : Tsuyoshi Isshiki Dept. Communications and Integrated Systems, Tokyo Institute of Technology isshiki@vlsi.ss.titech.ac.jp
More informationLECTURE 2 An Introduction to Boolean Algebra
IST 210: Boot Camp Ritendra Datta LECTURE 2 An Introduction to Boolean Algebra 2.1. Outline of Lecture Fundamentals Negation, Conjunction, and Disjunction Laws of Boolean Algebra Constructing Truth Tables
More information3. According to universal addressing, what is the address of vertex d? 4. According to universal addressing, what is the address of vertex f?
1. Prove: A full m-ary tree with i internal vertices contains n = mi + 1 vertices. 2. For a full m-ary tree with n vertices, i internal vertices, and l leaves, prove: (i) i = (n 1)/m and l = [(m 1)n +
More informationDKT 122/3 DIGITAL SYSTEM 1
Company LOGO DKT 122/3 DIGITAL SYSTEM 1 BOOLEAN ALGEBRA (PART 2) Boolean Algebra Contents Boolean Operations & Expression Laws & Rules of Boolean algebra DeMorgan s Theorems Boolean analysis of logic circuits
More informationSpecifying logic functions
CSE4: Components and Design Techniques for Digital Systems Specifying logic functions Instructor: Mohsen Imani Slides from: Prof.Tajana Simunic and Dr.Pietro Mercati We have seen various concepts: Last
More informationLecture 14: Lower Bounds for Tree Resolution
IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Advanced Course on Computational Complexity Lecture 14: Lower Bounds for Tree Resolution David Mix Barrington and Alexis Maciel August
More information(Refer Slide Time 6:48)
Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 8 Karnaugh Map Minimization using Maxterms We have been taking about
More informationDepartment of Electrical Engineering McGill University ECSE 221 Introduction to Computer Engineering Assignment 2 Combinational Logic
Department of Electrical Engineering McGill University ECSE 221 Introduction to Computer Engineering Assignment 2 Combinational Logic Question 1: Due October 19 th, 2009 A convenient shorthand for specifying
More informationBoolean Algebra and Logic Gates
Boolean Algebra and Logic Gates Binary logic is used in all of today's digital computers and devices Cost of the circuits is an important factor Finding simpler and cheaper but equivalent circuits can
More information6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )
6. Combinational Circuits George Boole (85 864) Claude Shannon (96 2) Digital signals Binary (or logical ) values: or, on or off, high or low voltage Wires. Propagate logical values from place to place.
More informationLogic and Computation
Logic and Computation From Conceptualization to Formalization Here's what we do when we build a formal model (or do a computation): 0. Identify a collection of objects/events in the real world. This is
More informationRead this before starting!
Points missed: Student's Name: Total score: /100 points East Tennessee State University Department of Computer and Information Sciences CSCI 2150 (Tarnoff) Computer Organization TEST 1 for Spring Semester,
More informationDIGITAL CIRCUIT LOGIC UNIT 7: MULTI-LEVEL GATE CIRCUITS NAND AND NOR GATES
DIGITAL CIRCUIT LOGIC UNIT 7: MULTI-LEVEL GATE CIRCUITS NAND AND NOR GATES 1 iclicker Question 13 Considering the K-Map, f can be simplified as (2 minutes): A) f = b c + a b c B) f = ab d + a b d AB CD
More informationECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017
ECE 550D Fundamentals of Computer Systems and Engineering Fall 2017 Combinational Logic Prof. John Board Duke University Slides are derived from work by Profs. Tyler Bletsch and Andrew Hilton (Duke) Last
More informationObjectives: 1- Bolean Algebra. Eng. Ayman Metwali
Objectives: Chapter 3 : 1- Boolean Algebra Boolean Expressions Boolean Identities Simplification of Boolean Expressions Complements Representing Boolean Functions 2- Logic gates 3- Digital Components 4-
More informationGC03 Boolean Algebra
Why study? GC3 Boolean Algebra Computers transfer and process binary representations of data. Binary operations are easily represented and manipulated in Boolean algebra! Digital electronics is binary/boolean
More informationLecture 5. Logic I. Statement Logic
Ling 726: Mathematical Linguistics, Logic. Statement Logic V. Borschev and B. Partee, September 27, 2 p. Lecture 5. Logic I. Statement Logic. Statement Logic...... Goals..... Syntax of Statement Logic....2.
More informationLecture 3: Binary Subtraction, Switching Algebra, Gates, and Algebraic Expressions
EE210: Switching Systems Lecture 3: Binary Subtraction, Switching Algebra, Gates, and Algebraic Expressions Prof. YingLi Tian Feb. 5/7, 2019 Department of Electrical Engineering The City College of New
More informationRead this before starting!
Points missed: Student's Name: Total score: /100 points East Tennessee State University Department of Computer and Information Sciences CSCI 2150 (Tarnoff) Computer Organization TEST 1 for Spring Semester,
More informationCHAPTER-2 STRUCTURE OF BOOLEAN FUNCTION USING GATES, K-Map and Quine-McCluskey
CHAPTER-2 STRUCTURE OF BOOLEAN FUNCTION USING GATES, K-Map and Quine-McCluskey 2. Introduction Logic gates are connected together to produce a specified output for certain specified combinations of input
More informationRead this before starting!
Points missed: Student's Name: Total score: /100 points East Tennessee State University Department of Computer and Information Sciences CSCI 2150 (Tarnoff) Computer Organization TEST 1 for Fall Semester,
More information4&5 Binary Operations and Relations. The Integers. (part I)
c Oksana Shatalov, Spring 2016 1 4&5 Binary Operations and Relations. The Integers. (part I) 4.1: Binary Operations DEFINITION 1. A binary operation on a nonempty set A is a function from A A to A. Addition,
More informationIntegrated Math I. IM1.1.3 Understand and use the distributive, associative, and commutative properties.
Standard 1: Number Sense and Computation Students simplify and compare expressions. They use rational exponents and simplify square roots. IM1.1.1 Compare real number expressions. IM1.1.2 Simplify square
More informationL3: Representations of functions
L3: Representations of functions Representations of Boolean functions Boolean expression Two level sum of product form, factorized form Truth tables Karnaugh maps Cubes (MIN,MAX) notation positional cube
More information