D
D
Dmitry2210602019-08-04 19:09:20
Electronics
Dmitry221060, 2019-08-04 19:09:20

Is there an algebra of logic with a logical subtraction operator?

There are three operations in Boolean algebra: AND(conjunction), OR(disjunction), NOT(negation);
which can be converted to mathematical expressions as: *, +, 1-;
respectively. Thus, the expression NOT (A AND B) AND (A OR B), aka XOR, can be written as
(1-(A*B))*(A+B) = A+B-(A+B) *(A*B) = A+B-(A*A*B+A*B*B)
Based on the idempotency property, we can simplify the expression to
A+BA*BA*B = A+B-2*A*B = A+B*(1-2A) = A OR (B AND NOT 2A)

truth table

A B  !2A  B&!2A  R 
0 0   1     0    0
0 1   1     1    1
1 0  -1     0    1
1 1  -1    -1    0

This is incredibly convenient for simplifying complex logical expressions, however, sometimes the result is a subtraction and the expression becomes impossible to write through Boolean algebra without inverse transformations.
Is there a logical operation that represents subtraction? Should I use the ternary number system if the result is 100% binary?
In search of material on this topic, I found only this article , which says that logical subtraction / division does not make sense, as well as a bunch of others about subtractors and adders that are not related to the topic.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Griboks, 2019-08-04
@Dmitry221060

Let's make a truth table for mathematical subtraction.

A B A-B
0 0 0
0 1 1
1 0 1
1 1 0

We get that A-B=A xor B, therefore -:= XOR.
Open Google: Modulo 2 addition (exclusive "or", XOR, strict disjunction, bitwise addition, mask inversion, Zhegalkin addition, logical subtraction , logical disparity) - a boolean function, as well as a logical and bit operation, in the case of two variables, the result is true if and only if one of the arguments is true and the other is false.
Accordingly, its meaning is in the mutual difference of two sets, i.e. the result does not belong to two sets at the same time.
A B (Необщая часть A) (Необщая часть B) (Объединения частей)
0 0 0 0 1
0 1 0 1 1
1 0 1 0 1
1 1 0 0 0

V
vanyamba-electronics, 2019-08-04
@vanyamba-electronics

! (A || B) = (! A) && (! B)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question