23

A few days ago I was asked, why it is pretty common to use the + instead of the v symbol as the boolean OR operator in digital logic.

His argument was, that it is totally counter intuitive to use + for OR, because it is more likely to be interpreted as AND from general usage/context.

From Wiki: In logic and mathematics, or is a truth-functional operator also known as (inclusive) disjunction and alternation. The logical connective that represents this operator is also known as "or", and typically written as v or +.

I did some research and came up with the origin of the v sign. It comes from the Latin word "vel", which means "or".

One thing that adds up to the confusing nature is, that + means 'and' from a historical standpoint. According to this and this it was invented around 1360 as and abbreviation for Latin "et" ("and") resembling the plus sign.

However, I have no clue who came up with + in the boolean algebra and why it seems to be preferred to the v in digital logic / engineering context.

Rev
  • 10,017
  • 7
  • 40
  • 77
  • 7
    OR is akin to PLUS in "normal" mathematics. AND is akin to MULTIPLY, so the · operator is used. – Majenko Sep 29 '14 at 19:15
  • Perhaps because in binary logic evaluation, any non-zero result would be considered "1", then "sum" would be correct. – Tut Sep 29 '14 at 19:19
  • 2
    0*1 = 0 and 0 AND 1 = 0. 0+1 = 1 and 0 OR 1 = 1. – The Photon Sep 29 '14 at 20:00
  • 2
    More theoretically, 0 is the additive identity for the integers, and 0 is also the identity value for the OR operation on the boolean value set. (Apologies to any mathematicians if I've abused your jargon) – The Photon Sep 29 '14 at 20:02
  • 1
    In some sense + would be better used as the exclusive-or operator, since with AND as the multiplicative operator one obtains an algebra (in the sense of an algebra over a field) over F_2. The sum-and-product notation is used in lattice theory texts to represent meets and joins (of which, AND and OR are examples in a boolean lattice); the notation might possibly have its origins in universal algebra. In the end, the choice may amount to nothing more than the convenience of being able to write products as concatenated strings rather than having to write the binary operator explicitly. – Tobias Hagge Sep 29 '14 at 21:27
  • @ThePhoton 1+1≠1 – user253751 Sep 30 '14 at 07:36
  • In boolean algebra, the symbol 1 doesn't represent "one of something". – Phyllostachys Sep 30 '14 at 13:30
  • @immibis I didn't say that OR and addition are identical operations. I said that 0 is the identity for both operations. – The Photon Sep 30 '14 at 15:28
  • 1
    Could it be that while keyboards have a V, it's the letter V not a special V for or, and they don't have an upside down V, for AND. Maybe if keyboards had keys for those or even just for OR , then they wouldn't use + – barlop Sep 30 '14 at 19:08

4 Answers4

20

One line of reasoning I always used for logical AND and OR signs is their relation to mathematical operations they represent.

Let's start with logical AND. It's often represented as multiplication sign, for example *. So if you have a long expression like s1*s2*s3*s4.... and one of the variables takes value of 0, or logical false, then the entire expression will take the value of 0, which is quite normal for multiplication, because 1*1*0*1... equals 0.

On the other hand, when we use the + sign, which commonly stands for addition to represent logical OR, we have similar case. If we have several variables that are ORed, then we have again the case of s1+s2+s3+s4... If just one of the variables is non-zero, then the result will be non-zero as well, which is logical (IMHO) when we compare OR to addition. For example 0+0+1+0... equals 1. One point where this breaks is that is we have more ones, the result is still just one. One way of thinking I used for this is to just keep in mind that one represents existence, so of something exists and you add more existence to it, it will still exist.

AndrejaKo
  • 23,261
  • 25
  • 110
  • 186
  • I think the sign is a matter of convention, since the logical operations defined in Boolean algebra. The logical sum is well defined as the logical product so that the sign could be anyone. I think the signs that are more familiar are used, which may have some relation to the definitions. Good answer. – Martin Petrei Sep 29 '14 at 19:26
  • Interesting answer. As a point of interest, I just supplemented to my post that it seems that the historical origin of the `+` sign (as binary operator) comes down to an abbreviation for Latin "et" ("and") resembling the plus sign. – Rev Sep 29 '14 at 19:43
20

One word: Distributivity

Multiplication is distributive over addition, and so is logical AND distributive over logical OR.

On the other hand, multiplication is often used without a symbol (2a instead of 2*a), and logical AND is very similar. If both A and B must be true, it's simple and intuitive to write AB.

It is very handy in constructing truth tables and algorithms based on them.

$$f = A + BC$$

even someone with little experience will notice at first glance, that f can occur when A is true, or when both B and C are true.

Compare it with $$f = A \vee B \wedge C$$ If you don't use this for a few days, you'll have to wonder again, was v the OR and ^ the AND, or vice versa? Even if you don't forget them, it's much clearer and easier to read if you just use multiplication and addition symbols, especially as they cannot be confused. In boolean logic there is no addition or multiplication, so their symbols can be re-used.

The fact that 1 * 0 = 0 and 1 + 0 = 1 and in boolean algebra we have chosen 1 to mean true and 0 to mean false also helps identifying which operator is which. Symbols in mathematics are just that: symbols. They have a meaning because we assigned a meaning to them, so it's better if we choose symbols which can easily be remembered and their usage in other fields are similar.

Kevin Fegan
  • 221
  • 1
  • 5
vsz
  • 2,554
  • 1
  • 17
  • 32
  • 4
    The operators AND and OR distribute over *each other*, in ways that multiplication and addition do not. Not only is `A or (B and C)` equivalent to `(A or B) and (A or C)`, but `X and (Y or Z)` is equivalent to `(X and Y) or (X and Z)`. Still, I think the fact that multiplication behaves more like "and" is sufficient basis for deciding that "or" gets mapped to "+". – supercat Sep 29 '14 at 23:17
  • I tend to accept this answer because it is somewhat cleaner and to the point than the one from AndrejaKo. – Rev Sep 30 '14 at 06:39
5

Michael Shcroeder's "A brief history of the notation of Boole's algebra", Nordic Journal of Philosophical Logic 2 (1):41-62 (1997), attributes use of + to represent inclusive-or to Leibniz in his "Elementa Calculi", and discusses Boole's use of the notation, as well as some other notations. online link

Tobias Hagge
  • 151
  • 1
2

No discussion of why is is common to use + instead of ∪,∩,∨,∧ would be complete without noting that printers and tranmission codes (such as Baudot, ITA, and ASCII) provided the Alphabet, Numbers, and 'common business symbols'.

It's hard to imagine now, but there was a time when special symbols were not easily represented on input, and represented an additional cost even when typeset.

The mathematicians (and other Algol supporters) wanted a larger symbol set for this reason, but 50 years ago, you wouldn't even have been able to express the larger question except by writing 'why don't we use the inverted v symbol instead of writing .AND. ?'

david
  • 4,364
  • 15
  • 30
  • Even today entering special symbols is still more effort than just typing something that has a key on the keyboard and non-ascii characters sometimes get mangled when moving between different systems (though some ASCII characters are vulnerable too due to the rise of markup languages). – Peter Green Sep 09 '19 at 19:52