Boolean Logic Calculator
Use this calculator to evaluate common boolean logic operations based on two input values (A and B).
(Checked = True, Unchecked = False)
(Checked = True, Unchecked = False)
AND (A & B)
OR (A | B)
XOR (A ^ B)
NAND (NOT (A & B))
NOR (NOT (A | B))
NOT A (!A)
NOT B (!B)
Result:
Please select inputs and an operation, then click Calculate.
Understanding Boolean Logic
Boolean logic, named after mathematician George Boole, is a fundamental branch of algebra that deals with variables that can only have two possible values: true or false (often represented as 1 or 0). It's the bedrock of all digital electronics, computer science, and programming.
Key Concepts:
- Boolean Variables: These are variables that can only hold one of two states: True (1) or False (0).
- Logic Gates: These are elementary building blocks of digital circuits that implement boolean functions. Common gates include AND, OR, NOT, XOR, NAND, and NOR.
- Truth Tables: A truth table is a mathematical table used in logic to compute the functional values of logical expressions on each of their functional arguments, that is, on each combination of truth values taken by their sentential variables.
Common Boolean Operations:
This calculator supports the following operations:
- AND (Conjunction): The output is True only if ALL inputs are True. Otherwise, the output is False.
Example: If A is True and B is True, A AND B is True. If A is True and B is False, A AND B is False. - OR (Disjunction): The output is True if AT LEAST ONE input is True. The output is False only if ALL inputs are False.
Example: If A is True and B is False, A OR B is True. If A is False and B is False, A OR B is False. - NOT (Negation): This is a unary operation (takes only one input). It reverses the truth value of its input. If the input is True, the output is False, and vice-versa.
Example: If A is True, NOT A is False. If A is False, NOT A is True. - XOR (Exclusive OR): The output is True if the inputs are DIFFERENT. The output is False if the inputs are the SAME.
Example: If A is True and B is False, A XOR B is True. If A is True and B is True, A XOR B is False. - NAND (NOT AND): The output is the opposite of an AND gate. It is False only if ALL inputs are True. Otherwise, the output is True.
Example: If A is True and B is True, A NAND B is False. If A is True and B is False, A NAND B is True. - NOR (NOT OR): The output is the opposite of an OR gate. It is True only if ALL inputs are False. Otherwise, the output is False.
Example: If A is False and B is False, A NOR B is True. If A is True and B is False, A NOR B is False.
How to Use the Calculator:
- Set Input A: Check the box for Input A if you want it to be True, or leave it unchecked for False.
- Set Input B: Check the box for Input B if you want it to be True, or leave it unchecked for False.
- Select Operation: Choose the boolean operation you wish to perform from the dropdown menu (e.g., AND, OR, XOR).
- Calculate: Click the "Calculate" button to see the result of the chosen operation based on your inputs.
Examples:
- Example 1: A is True, B is False, Operation: AND
Set Input A (checked), Input B (unchecked). Select "AND".
Result: False (Because for AND, both must be True). - Example 2: A is False, B is True, Operation: OR
Set Input A (unchecked), Input B (checked). Select "OR".
Result: True (Because for OR, at least one must be True). - Example 3: A is True, B is True, Operation: XOR
Set Input A (checked), Input B (checked). Select "XOR".
Result: False (Because for XOR, inputs must be different). - Example 4: A is False, B is True, Operation: NOT B
Set Input A (unchecked), Input B (checked). Select "NOT B".
Result: False (The NOT operation reverses B's value from True to False).