Search code examples
assemblybooleanalgebra

What does a identity element mean in boolean algebra?


I'm reading The Art of Assembly Programming by Randa Hyde (http://www.ic.unicamp.br/~pannain/mc404/aulas/pdfs/Art%20Of%20Intel%20x86%20Assembly.pdf) and I've reached the following statement in the book: "P4 The identity element with respect to • is one and + is zero. There is no identity element with respect to logical NOT." but I don't entirely understand what its saying. Can someone help me understand this sentence? English is my first language and I can normally read anything, but this is a bit confusing. I also know normal algebra, so most of this isn't new to me. I know what the additive and multiplicative identities are in plain ole' algebra.


Solution

  • When you perform an operation (addition, multilpication) having an identity element as one of operands (0 for addition, 1 for multiplication) you get the second operand as the result

    x + 0 = x
    y * 1 = y
    

    So for boolean algebra

    x OR 0 <=> x
    
    truth table
    x | 0 | x or 0 | x OR 0 <=> x
    1 | 0 |    1   |         1
    0 | 0 |    0   |         1
    
    y AND 1 <=> y
    
    truth table
    y | 1 | y and 1 | y and 1 <=> y
    1 | 1 |    1    |          1
    0 | 1 |    0    |          1
    

    Boolean negation is unary operator (has only one operand) so it has no identity value, as it wouldn't make any sense.