Appendix a a Non-Linear Algebra: an Introduction to Boolean Algebra

Appendix a a Non-Linear Algebra: an Introduction to Boolean Algebra

Appendix A A Non-linear Algebra: An Introduction to Boolean Algebra A.1 Basic Logical Gates This chapter is, strictly speaking, not about linear algebra. Nonetheless, the topic of this chapter, i.e. Boolean algebra, is related to linear algebra and it has been crucially important, over the last decades, for the progress of electronics. More specifically, while linear algebra deals with numbers, vectors, and matrices, Boolean algebra deals with binary states 0 and 1. In addition, the basic operators of Boolean algebra are non-linear. Furthermore, it must be remarked that Boolean algebra is related to linear algebra as it allows its implementation within digital circuits. Thus, Boolean algebra can be seen as the “trait d’union” between abstract algebra and computational science. In order to introduce Boolean algebra, let us consider an object x and a set A.A membership function mf (x) scores 0 if x ∈/ A and1ifx ∈ A. At an abstract level, if we consider all the possible objects and sets of the universe, we can associate a membership relationship between each object and set. Each relationship will score 0 when the belonging relationship is not verified (the statement is false) and 1 when the belonging relationship is verified (the statement is true). We can think about an image space where only the true and false (or 1 and 0, respectively) are allowed. In this space, the variables, namely binary variables can be combined to generate a binary algebra, namely Boolean algebra. Since the latter has to obey to logical rules, the same subject can be seen from a different perspective and named Boolean logic. This name is due to George Boole, the English mathematician that in 1853 described this logic in his book, “An Investigation of the Laws of Thought”, see [30]. As mentioned above, in Boolean algebra, a variable x can take either the value 0 or 1. Thus, x is a generic variable of a binary set B = {0, 1}. Three elementary operators (or basic logical gates), one of them unary (that is applied to only one variable) and two of them binary (that is applied to two variables) are here introduced. The first operator, namely NOT, is defined in the following way: © Springer International Publishing Switzerland 2016 451 F. Neri, Linear Algebra for Computational Sciences and Engineering, DOI 10.1007/978-3-319-40341-0 452 Appendix A: A Non-linear Algebra: An Introduction to Boolean Algebra if x = 1 then x¯ = NOT (x) = 0 if x = 0 then x¯ = NOT (x) = 1 The NOT operators is also graphically represented by the following symbol. The second operator, namely AND or logical multiplication, processes two inputs, x and y respectively, and returns the values x ∧ y according to the following rules: x y x ∧ y 0 0 0 1 0 0 0 1 0 1 1 1 A graphical representation of the AND operator is given in the following way. The third operator, namely OR or logical sum, processes two inputs, x and y respectively, and returns the values x ∨ y according to the following rules: x y x ∨ y 0 0 0 1 0 1 0 1 1 1 1 1 A graphical representation of the OR operator is given in the following way. A.2 Properties of Boolean Algebra As for numerical linear algebra, the Boolean operators are characterized by basic properties. These properties are here listed. Appendix A: A Non-linear Algebra: An Introduction to Boolean Algebra 453 • neutral element for AND: ∀x binary number, x ∧ 1 = x • absorbing element for AND: ∀x binary number, x ∧ 0 = 0 • neutral element for OR: ∀x binary number, x ∨ 0 = x • absorbing element for OR: ∀x binary number, x ∨ 1 = 1 • commutativity with respect to AND: x ∧ y = y ∧ x • commutativity with respect to OR: x ∨ y = y ∨ x • distributivity 1: x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧ z) • distributivity 2: x ∨ (y ∧ z) = (x ∨ y) ∧ (x ∨ z) • identity property 1: x ∧ x = x • identity property 2: x ∨ x = x • negative property 1: x ∧¯x = 0 • negative property 2: x ∨¯x = 1 These basic properties, when combined, allow us to detect more complex rela- tionships, as shown in the following example. Theorem A.1 x ∧ (x ∨ y) = x Proof x ∧ (x ∨ y) = (x ∧ x) ∨ (x ∧ y) = x ∨ (x ∧ y) = x ∧ (1 + y) = x ∧ 1 = x. Important properties of Boolean algebra are the so-called De Morgan’s laws. Theorem A.2 (First De Morgan’s Law) The negation of a disjunction is the con- junction of the negations. (x ∨ y) =¯x ∧¯y Proof In order to prove the first De Morgan’s law, we consider that (x ∨ y) =¯x ∧¯y is equivalent to write that (x ∨ y) ∧ (x¯ ∧¯y) = 0 (for the negative property 1). The latter equation can be written as (x ∨ y) ∧ (x¯ ∧¯y) = ((x ∨ y) ∧¯x) ∧¯y = (0 ∨ (x¯ ∧ y)) ∧¯y =¯x ∧ y ∧¯y =¯x ∧ 0 = 0 Theorem A.3 (Second De Morgan’s Law) The negation of a conjunction is the disjunction of the negations. (x ∧ y) =¯x ∨¯y The second De Morgan’s Law can be proved in an analogous way. Example A.1 Let us consider the following expression (x ∨ y)∧(x ∨¯y). This expres- sion can be simplified. Let us re-write it: (x ∨ y) ∧ (x ∨¯y) = x ∨ x ∧¯y ∨ x ∧ y ∨ 0 = = x ∧ (1 ∨ y ∨¯y) = x ∧ (1 ∨ y) = x. 454 Appendix A: A Non-linear Algebra: An Introduction to Boolean Algebra A.3 Boolean Algebra in Algebraic Structures The abstract aspects of Boolean Algebra are very complex and deserves possibly a separate book. However, with the purpose of linking Boolean Algebra to the other chapters of this book, especially to place it within algebraic structures, this section introduces some other concepts of abstract algebra. Definition A.1 The algebraic structure composed of a set L endowed with two binary operators ∨ and ∧, respectively, is said lattice and indicated with (L, ∨, ∧).For lattices and x, y, z ∈ L, the following properties hold: • commutativity 1: x ∨ y = y ∨ x • commutativity 2: x ∧ y = y ∧ x • associativity 1: (x ∨ y) ∨ z = x ∨ (y ∨ z) • associativity 2: (x ∧ y) ∧ z = x ∧ (y ∧ z) • absorption 1: x ∨ (x ∧ y) • absorption 2: x ∧ (x ∨ y) • idempotence 1: a ∨ a = a • idempotence 2: a ∧ a = a Definition A.2 A lattice (L, ∨, land) is said to be bounded when 0 is the neutral element for ∨ (x ∨ 0 = x) and 1 is the neutral element for ∧ (x ∧ 1 = x). It can be observed that a lattice can be seen as the combination of two semigroups: (L, ∨) and (L, ∧) respectively. In the cases of bounded lattice, it is the combination of two monoids. Definition A.3 A lattice (L, ∨, land) is said to be complemented when it is bounded (with infimum equal to 0 and supremum equal to 1) and for all x ∈ L, there exists an element y such that x ∧ y = 0 and x ∨ y = 1. Definition A.4 A lattice (L, ∨, ∧) is said to be distributive when the following equality holds x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧ z) . The latter equality can be proved to be equivalent to x ∨ (y ∧ z) = (x ∨ y) ∧ (x ∨ z) . It can be easily seen that Boolean algebra is a complemented distributive lattice. Appendix A: A Non-linear Algebra: An Introduction to Boolean Algebra 455 A.4 Composed Boolean Gates From the three basic gates several composed gates can be generated. An important example is the NAND operator composed of an AND and a NOT and here represented. A more complex example is the XOR operator. This operator processes two inputs and returns 0 when the inputs are the same and 1 when they are different. x y x ∨ y 0 0 0 1 0 1 0 1 1 1 1 0 This operator is composed as x ∧¯y ∨¯x ∧ y. This expression is graphically repre- sented in the following way, or, more compactly as In order to appreciate the practical implications of Boolean logic and it composed gates, let us consider a so-called half adder circuit. The latter is a logic structure, obtained by a straightforward combination of XOR and AND gates, that performs sum. The scheme is given by: 456 Appendix A: A Non-linear Algebra: An Introduction to Boolean Algebra If we consider that S stands for sum while C stands for carry, the functioning of the half adder can be summarized in the following way. A more complex example is the XOR operator. This operator processes two inputs and returns 0 when the inputs are the same and 1 when they are different. x y C S 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 As shown the result of the operation 1 + 1 = 10 (where 10 is 2 in binary). Thus, the half adder is an elementary structure that can be used to perform sums. More generally, Boolean logic allows, by means of binary operator, to define a complex logic. This feature is relevant in computational devices where the physics imposes the employment of a binary logic at the hardware level. Without entering into the details of a computer hardware, it can be easily seen that it is easier to measure whether or not an amperage flows trough a conductor rather than measuring it intensity and associate a semantic value to it. In other words, in order to be reliable a computer hardware must be kept simple at the low level. Then these simple gates can be logically combined in billions of way in order to build a complex logic. As a further remark, Boolean logic was not defined to satisfy the necessities of a computational device since it was defined about one century earlier that the first computers.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    13 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us