Uploaded June 2014 | Updated September 2026, 2 weeks ago
The Boolean instructions are AND, OR, XOR and NOT. They work on the bits of their parameters and perform some logical comparison of the bits of the input operands. They return some predefined values depending on the 1's and 0's in the inputs. Boolean operations in computers are usually performed between all the corresponding pairs of bits in the input operands, and for this reason, they are sometimes called bitwise operations.
They might seem simple, but it's amazing to see what billions of them can do!
I said in the tute that they were used to create "if" statements, but that's not usually true. They can be used to create complex conditions, but more often than not, C++ will use branching, even though it would usually be faster to use Boolean instructions and conditional moves.
The Boolean instructions are AND, OR, XOR and NOT. They work on the bits of their parameters and perform some logical comparison of the bits of the input operands. They return some predefined values depending on the 1's and 0's in the inputs. Boolean operations in computers are usually performed between all the corresponding pairs of bits in the input operands, and for this reason, they are sometimes called bitwise operations.
They might seem simple, but it's amazing to see what billions of them can do!
I said in the tute that they were used to create "if" statements, but that's not usually true. They can be used to create complex conditions, but more often than not, C++ will use branching, even though it would usually be faster to use Boolean instructions and conditional moves.









