**Logic Gates and Boolean Algebra**

**Logic Gates **

The Computer (Electronic Devices) is made of a large amount of complex digital circuits. Logic gates are the basic items of any digital circuits. There are seven basic logic gates:

**AND, OR, NOT, XOR, NAND, NOR, XNOR**

How to be a Programmer

- How to be a Programmer | Part 1: Introduction
- How to be a Programmer | Part 2: Top 20 Programming Languages
- How to be a Programmer | Part 3: Basic Concept of Programming
- How to be a Programmer | Part 4: Control Structures
- How to be a Programmer | Part 5: Number Systems
- How to be a Programmer | Part 6: Coding Systems in Computer

**Logic Gates and Boolean Algebra – AND Gate (.)**

If at least one input is in False (0) state, the output of AND gate is False (0).

Input | Output | |

A | B | |

0 | 0 | 0 |

0 | 1 | 0 |

1 | 0 | 0 |

1 | 1 | 1 |

**Logic Gates and Boolean Algebra – OR Gate (+)**

At least one input should be 1 for the output of OR gate to be 1.

Input | Output | |

A | B | |

0 | 0 | 0 |

0 | 1 | 1 |

1 | 0 | 1 |

1 | 1 | 1 |

**Logic Gates and Boolean Algebra – NOT Gate (**^{–})

^{–})

Not gate consists of only one input. Output will be FALSE if input is TRUE and Output will be TRUE if input is FALSE.

Input | Output |

A | |

0 | 1 |

1 | 0 |

** Logic Gates and Boolean Algebra – XOR Gate**

In this gate, the output will be FALSE if both inputs are at the same state (TRUE or FALSE) and output will be TRUE if both the inputs are at the different state.

Input | Output | |

A | B | |

0 | 0 | 0 |

0 | 1 | 1 |

1 | 0 | 1 |

1 | 1 | 0 |

### **Logic Gates and Boolean Algebra – NAND Gate**

NAND gate is a combination of AND gate and NOT gate. It works opposite to the AND gate

Input | Output | |

A | B | |

0 | 0 | 1 |

0 | 1 | 1 |

1 | 0 | 1 |

1 | 1 | 0 |

** Logic Gates and Boolean Algebra – NOR Gate**

NOR gate is a combination of OR gate and NOT gate. It works opposite to the OR gate

Input | Output | |

A | B | |

0 | 0 | 1 |

0 | 1 | 0 |

1 | 0 | 0 |

1 | 1 | 0 |

** Logic Gates and Boolean Algebra – XNOR Gate**

It is exclusive NOR gate. It is a combination of XOR gate and NOT gate. It works opposite to the XOR gate. In this gate, the output will be TRUE when both the inputs are at the same state. and output will be FALSE if both the input are a different state,

Input | Output | |

A | B | |

0 | 0 | 1 |

0 | 1 | 0 |

1 | 0 | 0 |

1 | 1 | 1 |

**Boolean Algebra**

Boolean Algebra is used to analyze and simplify the logic circuits. It introduced by George Boole in 1847

**Annulment Law**

X.0 = 0

X+1 = 1

**Identity law**

X.1 = X

X+0 = X

**Idempotent law**

X.X = X

X+X = X

**Complement law**

X.X = 0

X+X = 1

**Double Negation law**

X = X

**Commutative law**

X.Y = Y.X

X+Y = Y+X

**Associative law**

X.(Y.Z) = (X.Y).Z = (X.Z).Y = X.Y.Z

X+(Y+Z) = (X+Y)+Z = (X+Z)+Y = X+Y+Z

**Distributive law**

X.(Y+Z) = X.Y + X.Z

X+Y.Z = (X+Y).(X+Z)

**de Morgan’s Theorem**

X.Y = X+Y

X+Y = X.Y

**Absorption law**

X.(X+Y) = X

X+(X.Y) = X

**Consensus law**

(X+Y).(X+Z).(Y+Z) = (X+Y).(X+Z)

(X.Y)+(X.Z)+(Y.Z) = X.Y+X.Z

**Redundancy law**

(X+Y).(X+Y) = X

X.Y+X.Y = X

(X+Y).Y = XY

X.Y+Y = X+Y

### Hi Friends,

Hope this post (How to be a Programmer Part 7 – Logic Gates and Boolean Algebra) will help you to learn something. If you enjoy my work, please **Share **my posts with your friends and anyone who might be interested in programming. Don’t forget to **Comment **and, **Subscribe**.

**See you in the comment section.**

Like ctechf Facebook fan page : https://www.facebook.com/ctechf

Also Read :

- HTML Tutorial | Introduction for Beginners
- How to install Ubuntu on Windows 10
- JavaSctipt Tutorial | Introduction for Beginners
- Python Tutorial | Introduction for Beginners
- Python Tutorial | Introduction for Beginners (Part 2)
- MySQL Tutorial | Introduction for Beginners (Basic)
- Python Tutorial | How to Connect MySQL Database in Python
- Python Tutorial: Python GUI Programming (Tkinter)

How to be a Programmer

- How to be a Programmer | Part 1: Introduction
- How to be a Programmer | Part 2: Top 20 Programming Languages
- How to be a Programmer | Part 3: Basic Concept of Programming
- How to be a Programmer | Part 4: Control Structures
- How to be a Programmer | Part 5: Number Systems
- How to be a Programmer | Part 6: Coding Systems in Computer