Boolean Logic: AND, OR, NOT
Classical computation is built from three elementary Boolean operations on bits:
- NOT flips a bit: NOT 0 = 1, NOT 1 = 0.
- AND is 1 only when both inputs are 1.
- OR is 1 when at least one input is 1.
Every classical circuit — adders, processors, the device you are reading this on — is some
combination of these. In code you will see them as !, &&, and ||. We treat 1 as true and 0
as false.
Try it
Evaluate and return the result (0 or 1).
Run your code to see the quantum state.
Sign in on the full site to ask questions and join the discussion.