Precedence of nested NOTs in boolean algebra

106 Views Asked by At

I have the following equation:

$y = \overline{\overline{\overline{x_{1} + \overline{x_{2}}} .x_{2}.x_{1}} + \overline{x_{3}.\overline{x_{1}+x_{2}} + x_{2}}}$

I'm trying to solve it in four ways:

1) From the outmost NOT to the innermost NOTs

2) From the outmost NOT to the innermost NOTs (with brackets)

3) From the innermost NOT to the outmost NOT

4) From the innermost NOT to the outmost NOT (with brackets)

Cases 2, 3 and 4 result in $0$, however, case 1 results in $x_{2}$:

$y = \overline{\overline{\overline{x_{1} + \overline{x_{2}}} .x_{2}.x_{1}} + \overline{x_{3}.\overline{x_{1}+x_{2}} + x_{2}}}$

$y = \overline{\overline{\overline{x_{1} + \overline{x_{2}}} .x_{2}.x_{1}}} . \overline{\overline{x_{3}.\overline{x_{1}+x_{2}} + x_{2}}}$

$y = \overline{\overline{x_{1} + \overline{x_{2}}} .x_{2}.x_{1}} . \overline{x_{3}.\overline{x_{1}+x_{2}} + x_{2}}$

$y = \overline{x_{1} + \overline{x_{2}}} .x_{2}.x_{1} . x_{3}.\overline{x_{1}+x_{2}} + x_{2}$

$y = \overline{x_{1}} + \overline{\overline{x_{2}}} .x_{2}.x_{1} . x_{3}.\overline{x_{1}}.\overline{x_{2}} + x_{2}$

$y = x_{2} + x_{2}$

$y = x_{2}$

I can't seem to figure out why is this difference as I am not sure about the precedence. The result, in fact, should be 0. All I could find about my problem was about the precedence NOT > AND > XOR, but nothing on the NOT precedence when there's a nested expression like above. I am pretty much a beginner so any help will be greatly appreciated.

2

There are 2 best solutions below

0
On BEST ANSWER

From:

$y = \overline{\overline{\overline{x_{1} + \overline{x_{2}}} .x_{2}.x_{1}}} . \overline{\overline{x_{3}.\overline{x_{1}+x_{2}} + x_{2}}}$

it doesn't follow that:

$y = \overline{\overline{x_{1} + \overline{x_{2}}} .x_{2}.x_{1}} . \overline{x_{3}.\overline{x_{1}+x_{2}} + x_{2}}$

but rather:

$y = (\overline{ x_{1} + \overline{x_{2} }} . x_{2}.x_{1} ) . (x_{3}.\overline{x_{1}+x_{2}} + x_{2} )$

By the way, from a mathematical standpoint, the question of precedence of the operators plays no significant role, as it's a mere convention for the reader; as long as the convention is well understood, there's no such a thing as a standard precedence of Not over And etc. From the reading of your question it's clear that the overline has precedence over the other operators, but this is circumstantial.

2
On

$y = \overline{\overline{\overline{x_{1} + \overline{x_{2}}} • x_{2} • x_{1}} + \overline{x_{3}•\overline{x_{1}+x_{2}} + x_{2}}}$

Take DeMorgan's:

$y = \overline{\overline{\overline{x_{1} + \overline{x_{2}}} • x_{2} • x_{1}}} • \overline{ \overline{x_{3}•\overline{x_{1}+x_{2}} + x_{2}}}$

$\overline{\overline{X}} = X$, so:

$y = \overline{x_{1} + \overline{x_{2}}} • x_{2} • x_{1} • x_{3}•\overline{x_{1}+x_{2}} + x_{2}$

Take DeMorgan's

$y = \overline{x_{1}} • {x_{2}} • x_{2} • x_{1} • x_{3}•\overline{x_{1}} • \overline{x_{2}} + x_{2}$

$\overline{X} • X = 0$, so:

$y = 0 + x_{2}$

$X + 0 = X$, which means I do not get $0$.

$y = x_{2}$

So the processing of not, in this case, is NOT a precedence thing. All the ANDs apply over the OR.

If you see $a = x • y + z$, if it was math, you'd take multiplication over addition. But $(x • y) + z ≠ x • (y + z)$. Without brackets AND and OR have equal precedence. It's probably, NOT, NAND or NOR, AND or OR.