Guillermo Ceballos
Guillermo Ceballos

Reputation: 380

Kind of logical subtraction

Having these two bitsets as an example:

1 1 0 0
1 0 0 1

How can I get this following result:

0 1 0 0

From my point of view this kind of logic operation must be a subtraction but omitting the borrow bit.

Is it possible to have a simple logical operation to get that result?

Thanks in advance.

Upvotes: 1

Views: 205

Answers (1)

user1300630
user1300630

Reputation:

it is only true, if A is true and B is false. So it can be solved as A & ~B

Upvotes: 3

Related Questions