Is ~x + ~y == ~(x + y) always false?

Asked 2 years ago, Updated 2 years ago, 46 views

When you say that both x and y are paid by two, Is ~x+y==~(x+y) always false?

The numbers between 5000 and 5000 are all false Wouldn't there be a true number somewhere?

c bit-manipulation signed tow-complement

2022-09-22 22:19

1 Answers

In conclusion, ~x+y == ~(x+y) is always false.

I'll prove it to you by regurgitation. First, ~(x+y) == ~x+~y Assume that x, y is true, and

Where x and y are conservatives of 2, so for x and y, the following holds true.

-x == ~x + 1
<==>  -1 == ~x + x

If you keep putting this into the expression,

~(x+y) == ~x + ~y
<==>  ~(x+y) + (x+y) == ~x + ~y + (x+y)
<==>  ~(x+y) + (x+y) == (~x + x) + (~y + y)
<==>  ~(x+y) + (x+y) == -1 + -1
<==>  ~(x+y) + (x+y) == -2
<==>  -1 == -2

So, this is a contradiction. Therefore, ~x+y == ~(x+y) is always false.


2022-09-22 22:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.