Construct a truth table

Resources | Subject Notes | Computer Science

Logic Gates and Truth Tables

Objective: Construct a Truth Table

This section focuses on understanding logic gates and how to construct their truth tables. A truth table systematically lists all possible input combinations for a logic gate and the corresponding output for each combination. This is a fundamental skill in digital logic.

1. AND Gate

The AND gate outputs a 1 (True) only when both inputs are 1 (True). If either or both inputs are 0 (False), the output is 0 (False).

Input A Input B Output
0 0 0
0 1 0
1 0 0
1 1 1

2. OR Gate

The OR gate outputs a 1 (True) if either one or both of its inputs are 1 (True). The output is 0 (False) only when both inputs are 0 (False).

Input A Input B Output
0 0 0
0 1 1
1 0 1
1 1 1

3. NOT Gate

The NOT gate (also known as the inverter) inverts the input. If the input is 1 (True), the output is 0 (False), and vice versa.

Input Output
0 1
1 0

4. NAND Gate

The NAND gate is the inverse of the AND gate. It outputs 0 (False) only when both inputs are 1 (True). If either or both inputs are 0 (False), the output is 1 (True).

Input A Input B Output
0 0 1
0 1 1
1 0 1
1 1 0

5. NOR Gate

The NOR gate is the inverse of the OR gate. It outputs 1 (True) only when both inputs are 0 (False). If either or both inputs are 1 (True), the output is 0 (False).

Input A Input B Output
0 0 1
0 1 0
1 0 0
1 1 0

6. XOR Gate

The XOR (exclusive OR) gate outputs 1 (True) if its inputs are different. It outputs 0 (False) if its inputs are the same.

Input A Input B Output
0 0 0
0 1 1
1 0 1
1 1 0

7. XNOR Gate

The XNOR (exclusive NOR) gate is the inverse of the XOR gate. It outputs 1 (True) if its inputs are the same, and 0 (False) if they are different.

Input A Input B Output
0 0 1
0 1 0
1 0 0
1 1 1

These truth tables demonstrate the behavior of basic logic gates. Understanding these fundamental gates is crucial for building more complex digital circuits.