23.4.25

Logic gates

Understanding Logic Gates

Logic gates are fundamental components of digital circuits that perform basic logical functions. Each gate has a unique function defined by its truth table.

AND Gate

The AND gate outputs true (1) only if both inputs are true (1).

Truth Table:
A B | Output
0 0 |  0
0 1 |  0
1 0 |  0
1 1 |  1

Calculation Example:
Input: A = 1, B = 1
Output: A AND B = 1 AND 1 = 1
            

OR Gate

The OR gate outputs true (1) if at least one input is true (1).

Truth Table:
A B | Output
0 0 |  0
0 1 |  1
1 0 |  1
1 1 |  1

Calculation Example:
Input: A = 0, B = 1
Output: A OR B = 0 OR 1 = 1
            

NOT Gate

The NOT gate outputs the inverse of the input.

Truth Table:
A | Output
0 |  1
1 |  0

Calculation Example:
Input: A = 1
Output: NOT A = NOT 1 = 0
            

NAND Gate

The NAND gate outputs false (0) only if both inputs are true (1).

Truth Table:
A B | Output
0 0 |  1
0 1 |  1
1 0 |  1
1 1 |  0

Calculation Example:
Input: A = 1, B = 0
Output: A NAND B = NOT (A AND B) = NOT (1 AND 0) = NOT 0 = 1
            

NOR Gate

The NOR gate outputs true (1) only if both inputs are false (0).

Truth Table:
A B | Output
0 0 |  1
0 1 |  0
1 0 |  0
1 1 |  0

Calculation Example:
Input: A = 0, B = 0
Output: A NOR B = NOT (A OR B) = NOT (0 OR 0) = NOT 0 = 1
            

XOR Gate

The XOR gate outputs true (1) if the inputs are different.

Truth Table:
A B | Output
0 0 |  0
0 1 |  1
1 0 |  1
1 1 |  0

Calculation Example:
Input: A = 1, B = 0
Output: A XOR B = 1 XOR 0 = 1
            

XNOR Gate

The XNOR gate outputs true (1) if the inputs are the same.

Truth Table:
A B | Output
0 0 |  1
0 1 |  0
1 0 |  0
1 1 |  1

Calculation Example:
Input: A = 1, B = 1
Output: A XNOR B = NOT (A XOR B) = NOT (1 XOR 1) = NOT 0 = 1
            

Conclusion

Logic gates are essential for creating digital circuits. Understanding their functions and truth tables allows for better design and analysis of electronic systems.

Logic Gate Calculations

1. AND Gate Calculations

The AND gate outputs true (1) only if both inputs are true (1).

Input A Input B Output (A AND B)
0 0 0
0 1 0
1 0 0
1 1 1

2. OR Gate Calculations

The OR gate outputs true (1) if at least one input is true (1).

Input A Input B Output (A OR B)
0 0 0
0 1 1
1 0 1
1 1 1

3. NOT Gate Calculations

The NOT gate outputs the inverse of the input.

Input A Output (NOT A)
0 1
1 0

4. NAND Gate Calculations

The NAND gate outputs true (1) unless both inputs are true (1).

Input A Input B Output (A NAND B)
0 0 1
0 1 1
1 0 1
1 1 0

5. NOR Gate Calculations

The NOR gate outputs true (1) only if both inputs are false (0).

Input A Input B Output (A NOR B)
0 0 1
0 1 0
1 0 0
1 1 0

6. XOR Gate Calculations

The XOR gate outputs true (1) if the inputs are different.

Input A Input B Output (A XOR B)
0 0 0
0 1 1
1 0 1
1 1 0

7. XNOR Gate Calculations

The XNOR gate outputs true (1) if the inputs are the same.

Input A Input B Output (A XNOR B)
0 0 1
0 1 0
1 0 0
1 1 1

No comments:

Post a Comment

Difference between File and Folder

10 Differences Between Files and Folders Definition: File: A collection of data or information stored on a computer. ...