Order of operations in boolean algebra

Click For Summary
The order of operations in Boolean algebra is NOT, AND, and then OR, with expressions in brackets evaluated first. XOR is treated differently in programming languages, where it can have precedence over AND and OR but is lower than bitwise AND. The discussion emphasizes that while understanding precedence is important, using parentheses can eliminate any ambiguity in expressions. The consensus is that clarity in expression is key, regardless of the order of operations. Ultimately, using parentheses is the best practice to ensure correct evaluations.
Bipolarity
Messages
773
Reaction score
2
I have a rather technical question in boolean algebra to which I was not able to find an answer.

What is the order of operations in boolean algebra?
Is it first logical NOT, logical AND, logical OR, and finally logical XOR?

Correct me if I am wrong.

BiP
 
Physics news on Phys.org
The order of Boolean operations from high to low priority is NOT, AND, OR, while expressions inside brackets are always evaluated first.

http://www.doc.ic.ac.uk/~dfg/hardware/hardware.html, Handout, page 2.
 
What about XOR?

BiP
 
Since xor is equivalent as not equals, at least in C-based languages xor (as !=) has precedence over logical and (&&) and logical or (||). However, bitwise and (&) has precedence over bitwise xor (^), which in turn has precedence over bitwise or (|).

In the end, does it really matter? Just use parentheses and there's no doubt.
 
If there are an infinite number of natural numbers, and an infinite number of fractions in between any two natural numbers, and an infinite number of fractions in between any two of those fractions, and an infinite number of fractions in between any two of those fractions, and an infinite number of fractions in between any two of those fractions, and... then that must mean that there are not only infinite infinities, but an infinite number of those infinities. and an infinite number of those...

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 21 ·
Replies
21
Views
3K
Replies
9
Views
2K
  • · Replies 10 ·
Replies
10
Views
1K
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 34 ·
2
Replies
34
Views
3K
  • · Replies 12 ·
Replies
12
Views
7K
  • · Replies 20 ·
Replies
20
Views
5K
Replies
5
Views
3K