• + 8 comments

    I think we can further simplify the above boolean function (^ is for XOR):

    (((A B) ^ (A + B)) (A ^ B)) =           
    apply A ^ B = (A'B) + (A B')
    ( ((A B)' (A + B)) + ((A B) (A + B)')) (A ^ B)) =   
    apply DeMorgan law (X+Y+...)'=X'Y'Z'... and (XYZ...)'=X'+Y'+...
    ( ((A' + B') (A + B)) + ((A B) (A' B'))) (A ^ B)) = 
    apply Distributive Law X(Y+Z) = XY + XZ
    (A'A + A'B + AB' + BB' + AA' + BB') (A ^ B) =       
    apply X+X=X, XX=X
    (A'B + AB') (A ^ B) =
    (A ^ B) (A ^ B) = A ^ B = A xor B
    

    So we get the same result by just using a simple A XOR B. Is the above simplifacation correct? Can anyone confirm that?

    • + 1 comment

      I agree that the entire logical operation can be simplified down to A XOR B because:

      1. if you expand A ^ B you get exactly (A & B) ^ (A | B)
      2. Idempotent laws states that C & C = C
      3. so to save calculation time we can reduce the operation
          down to finding the max of what A ^ B is.
      
      • + 1 comment

        Simplify proof

        1. Since (A ^ B) = (A & B) ^ (A | B)

        Substitute (A ^ B)

        (((A & B) ^ (A | B)) & (A ^ B)) = (((A & B) ^ (A | B)) & ((A & B) ^ (A | B)))

        1. Since X & X = X

        ((A & B) ^ (A | B)) & ((A & B) ^ (A | B)) = (A & B) ^ (A | B)

        And (A & B) ^ (A | B) = A ^ B --- first equation

        Therefore

        (((A & B) ^ (A | B)) & (A ^ B)) = A ^ B

        • + 0 comments

          in the base case there minimum and next menimum is 2 and 3 and itxor is 1 so how it is correct;

    • + 0 comments

      yes u r right

    • + 0 comments

      YES IT IS :)

    • + 0 comments

      I came to the same result. When there are only 2 inputs A and B, you can also build a truth table to show that (((A & B) ^ (A | B)) & (A ^ B)) = A ^ B ;)

    • + 0 comments

      Or since they are all bitwise operations, just figure it out for 4 cases. If you look at the first part:

      // s = ((a & b) ^ (a | b))
      ((0 & 0) ^ (0 | 0)) == 0 ^ 0 == 0
      ((0 & 1) ^ (0 | 1)) == 0 ^ 1 == 1
      ((1 & 0) ^ (1 | 0)) == 0 ^ 1 == 1
      ((1 & 1) ^ (1 | 1)) == 1 ^ 1 == 0
      

      So you do an equivalent of xoring a number and 'and' that with xoring the number.

    • + 0 comments

      Yep I agree. Did the same :)

    • + 0 comments

      you can draw de morgan diagrams and things will be trivial - no need to recall formulas or laws

    • + 0 comments

      The truth table for the expression given in the question will be same as that of the XOR logic. It's good to know the math but it's not neccessary here. :)