### Author Topic: Reverse the logical operator AND  (Read 492 times)

#### mabdelouahab

• Member
• Posts: 450
##### Reverse the logical operator AND
« on: January 07, 2020, 07:27:44 PM »
how to reverse  the logical operator AND, if I have:
(A AND B) XOR C = D
how to get: A
A=(D XOR C) ?? B

#### caballero

• Member
• Posts: 1452
• Matrix - Noah
##### Re: Reverse the logical operator AND
« Reply #1 on: January 07, 2020, 08:24:03 PM »
As far as I know, only XOR is reversible in AND, OR and XOR. There are other reversibles as NEG... hmmm or it was NOT...
« Last Edit: January 07, 2020, 09:44:48 PM by caballero »
The logic of the error is hidden among the most unexpected lines of the program

#### mineiro

• Member
• Posts: 593
##### Re: Reverse the logical operator AND
« Reply #2 on: January 07, 2020, 10:48:15 PM »
I do this quickly, so, please check if this is correct.
Code: [Select]
(A AND B) XOR C = D A = ?
(A AND B) == Y
Y     XOR C = D

DISCRAMBLING XOR 2 INPUTS (Y,C), 1 OUTPUT (D)
(Y AND (NOT C)) OR ((NOT Y) AND C) == D
SWITCHING Y TO (A AND B)
((A AND B) AND (NOT C)) OR ( (NOT(A AND B)) AND C) == D
SWITCHING A TO D
((D AND B) AND (NOT C)) OR ( (NOT(D AND B)) AND C) == A

I check these results and they are wrong. At night I will play with this.
« Last Edit: January 08, 2020, 12:34:02 AM by mineiro »
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

#### dedndave

• Member
• Posts: 8827
• Still using Abacus 2.0
##### Re: Reverse the logical operator AND
« Reply #3 on: January 08, 2020, 02:47:51 AM »
AND, OR, NAND, NOR, XOR, XNOR cannot be reversed
NOT may be reversed

this is because these operations may mask and ignore certain inputs

for example, A AND B....
if B = 0, then A is "don't care" - there is no way to reverse the operation and discover what A was

in the case of XOR, XNOR - there is no way to know which input was low and which was high :)

#### vitsoft

• Regular Member
• Posts: 10
##### Re: Reverse the logical operator AND
« Reply #4 on: January 08, 2020, 03:15:39 AM »
how to reverse  the logical operator AND, if I have:
(A AND B) XOR C = D
how to get: A
There are only 16 combination of four boolean variables, so it is easy to prove that A is not an unequivocal  function of B,C,D:

A B C D      (A&B)    (A&B)^C      ((A&B)^C)=D
0 0 0 0        0           0                1
0 0 0 1        0           0                0
0 0 1 0        0           1                0
0 0 1 1        0           1                1
0 1 0 0        0           0                1
0 1 0 1        0           0                0
0 1 1 0        0           1                0
0 1 1 1        0           1                1
1 0 0 0        0           0                1
1 0 0 1        0           0                0
1 0 1 0        0           1                0
1 0 1 1        0           1                1
1 1 0 0        1           1                0
1 1 0 1        1           1                1
1 1 1 0        1           0                1
1 1 1 1        1           0                0

Variable A is false when B,C,D is 0,0,0 or 0,1,1 or 1,0,0 or 1,1,1.
Variable A is  true when B,C,D is 0,0,0 or 0,1,1 or 1,0,1 or 1,1,0.

#### daydreamer

• Member
• Posts: 1323
• building nextdoor
##### Re: Reverse the logical operator AND
« Reply #5 on: January 08, 2020, 03:22:34 AM »
I have gone digital electronics class long time ago
Make truth table for your function may help
The coolest thing we made adder with nand gates,added some gates that formed two complement (same as NEG) ,and the whole circuit could subtract
But we prepared with make the desired pattern,truth table for add and two complement
Truth table you make input and output of all possible outcomes

Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D
I love assembly,because its legal to write
princess:lea eax,luke
:)

#### mineiro

• Member
• Posts: 593
##### Re: Reverse the logical operator AND
« Reply #6 on: January 08, 2020, 03:50:20 AM »
I review De morghans, Karnaugh, truth tables and schematics diagram. I was not able to reverse that.
So, it's impossible in this case? I know that any circuits can be done only using nand.
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

#### hutch--

• Member
• Posts: 7461
• Mnemonic Driven API Grinder
##### Re: Reverse the logical operator AND
« Reply #7 on: January 08, 2020, 04:33:05 AM »
White privilege

hutch at movsd dot com
http://www.masm32.com

#### K_F

• Member
• Posts: 1608
• Anybody out there?
##### Re: Reverse the logical operator AND
« Reply #8 on: January 09, 2020, 09:12:38 AM »
how to reverse  the logical operator AND, if I have:
(A AND B) XOR C = D
how to get: A
A=(D XOR C) ?? B
An interesting question..
Boolean Algebra is generally defined as functioning in one direction (Input to Output), but there's nothing to prevent you from playing with the algebraic side.
Maybe a feedback circuit would be required back to A, but as mentioned you could end up with run-away condition where the A value oscillates at the frequency which is a function of the delay paths.
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

#### HSE

• Member
• Posts: 1349
• <AMD>< 7-32>
##### Re: Reverse the logical operator AND
« Reply #9 on: January 09, 2020, 11:57:07 AM »
how to reverse  the logical operator AND, if I have:
(A AND B) XOR C = D
how to get: A
A=(D XOR C) ?? B
The funny question is: how you know D?