Logic Gates

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

Logic Gates and Boolean Algebra

Logic Gates and Boolean Algebra


CSE 104 for CS/CE and SE

Wrya Muhammad Ali

UKH

Spring 2021-2022
Logic Gates and Boolean Algebra

Outline

1 Introduction

2 Switch and Lamp equivalent of logic gates

3 The Basic Gates again


The NOT gate
The AND Gate
The OR gate
The NAND Gate
The NOR Gate
The XOR Gate
4 References
Logic Gates and Boolean Algebra
Introduction

Introduction

We explained the transition from analog electronics to digital one


by introducing the two state symbol (0 and 1 or LOW and HIGH)
number system with base 2 called binary number system. We saw
the relation with the two state operation of transistors: cut-off and
saturation.
For any number system there is mathematics rules to deal with it.
For binary number system it is called Boolean Algebra. The basic
operations of this mathematics are AND, OR and NOT.
The implementation of these operations using electronics
components are through Gates.
Logic Gates and Boolean Algebra
Switch and Lamp equivalent of logic gates

Switch and Lamp equivalent of logic gates

The basic operation in digital logic are OR, AND and NOT.
They can be explained in a simpler way by using a simple
electrical circuits using switches, supply and lamp, as follows:

The OR logic: if Switch A ON The AND logic: if Switch A


OR Switch B ON then Lamp ON AND Switch B ON then
ON Lamp ON
Logic Gates and Boolean Algebra
The Basic Gates again
The NOT gate

The NOT gate

The NOT gate symbol, equation and its input/output


functioning
Logic Gates and Boolean Algebra
The Basic Gates again
The NOT gate

The NOT gate

The NOT gate symbol and its input/output functioning is


shown below:

What will be the output in the following case?


Logic Gates and Boolean Algebra
The Basic Gates again
The NOT gate

The NOT gate used to obtain 1’s complement

To obtain the 1’s complement of a binary number of 8 bits, we


need to take the complement of each bit. This can be easily
implemented by 8 NOT gates as shown below:
Logic Gates and Boolean Algebra
The Basic Gates again
The AND Gate

The AND Gate

The AND gate Symbol and truth table are shown below:

AND gates with Multiple inputs > 2 are also possible as below:
Logic Gates and Boolean Algebra
The Basic Gates again
The AND Gate

The AND Gate

A two input AND gate with inputs varying with time and the
out as a function of the varying inputs (also called timing
diagram)
Logic Gates and Boolean Algebra
The Basic Gates again
The AND Gate

The AND Gate another example

For a three input AND gate with the following varying inputs
the output will be as shown below:
Logic Gates and Boolean Algebra
The Basic Gates again
The OR gate

The OR gate

The OR gate symbol and truth table are shown below:

OR gates with multiple inputs > 2 are also possible as shown


below:
Logic Gates and Boolean Algebra
The Basic Gates again
The OR gate

The OR Gate

A two input OR gate with varying inputs with time and the
output as a function of the input changes:
Logic Gates and Boolean Algebra
The Basic Gates again
The OR gate

The OR Gate another example

A 3 input OR gate with varying inputs with time and the


output as a function of the input changes:
Logic Gates and Boolean Algebra
The Basic Gates again
The NAND Gate

The NAND Gate

The Symbol and truth table of the NAND Gate are shown
below:
Logic Gates and Boolean Algebra
The Basic Gates again
The NAND Gate

The NAND Gate


An example of 2 input NAND gate with varying inputs is
shown below.
Logic Gates and Boolean Algebra
The Basic Gates again
The NAND Gate

The NAND Gate


An example of 2 input NAND gate with varying inputs is
shown below.
Logic Gates and Boolean Algebra
The Basic Gates again
The NAND Gate

The NAND Gate another example

An example of 3 input NAND gate with varying inputs is


shown below.
Logic Gates and Boolean Algebra
The Basic Gates again
The NOR Gate

The NOR Gate

The Symbol and truth table of the NOR Gate are shown
below:
Logic Gates and Boolean Algebra
The Basic Gates again
The NOR Gate

The NOR Gate

An example of 2 input NOR gate with varying inputs is shown


below.
Logic Gates and Boolean Algebra
The Basic Gates again
The XOR Gate

The XOR Gate

The Symbol and truth table of the XOR Gate are shown below:
Logic Gates and Boolean Algebra
The Basic Gates again
The XOR Gate

The XOR Gate


An example of 2 input XOR gate with varying inputs is shown
below.
Logic Gates and Boolean Algebra
The Basic Gates again
The XOR Gate

The XOR Gate another example


An example of 2 input XOR gate can work as an adder
Logic Gates and Boolean Algebra
References

References

Thomas L. Floyd, ”Digital Fundamentals”, 11th edition,


Pearson, 2015.

You might also like