0% found this document useful (0 votes)
50 views

Digital Logic Design - Switch Logic & Basic Gates

The document discusses basic digital logic gates and their functions. It covers: 1) Common logic gates like AND, OR, NOT, NAND, NOR, XOR and XNOR and their truth tables. 2) How logic gates can be combined to perform more complex logic functions. Both NAND and NOR gates are "universal" as they can be used to construct all other basic gates. 3) Waveform and timing diagrams that show how logic gate inputs and outputs change with time. Logic gates operate on binary inputs of 1/0 and produce 1/0 outputs.

Uploaded by

Troon Soon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Digital Logic Design - Switch Logic & Basic Gates

The document discusses basic digital logic gates and their functions. It covers: 1) Common logic gates like AND, OR, NOT, NAND, NOR, XOR and XNOR and their truth tables. 2) How logic gates can be combined to perform more complex logic functions. Both NAND and NOR gates are "universal" as they can be used to construct all other basic gates. 3) Waveform and timing diagrams that show how logic gate inputs and outputs change with time. Logic gates operate on binary inputs of 1/0 and produce 1/0 outputs.

Uploaded by

Troon Soon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

Digital Logic Design

-Switch Logic & Basic Gates-


A Simple Switch

2
Switches in Series

3
Switches in Parallel

4
Normal vs Inverting Switch

5
Boolean Logic

Boolean Logic is based on two states, e.g., True (1) or False (0)
Boolean Logic is a form of algebra which is based on three simple
Operators: “Not”, “Or,” and “And,”.

There are different ways to represent Boolean logic


• True / False,
• 1 / 0,
• ON / OFF,
• High / Low,
• Active / Inactive

6
The Inverter (NOT Gate)

The inverter performs the Boolean NOT operation. When the


input is LOW, the output is HIGH; when the input is HIGH,
the output is LOW.

Input Output
A X A X
0 1
1 0

The NOT operation (complement / invert) is shown with an


overbar or apostrophe. Thus, the Boolean expression for an
inverter is X = A or X = A’

7
The Inverter (Not Gate)

A X

As time passes, we may change the input of the gate if we


want to, as a result the output changes. Such changes can be
represented as a waveform (also called a timing diagram).
The x-axis is the time, the y-axis the value of the input or
the output.

Example waveforms:
A
X

8
Decimal vs Binary Numbers

 Decimal Numbers
 Commonly used in our daily lives
 They have 10 possible symbols (called digits) 0,1,2,3,4,5,6,7,8,9
 Binary Numbers
 Used in all digital systems
 They have 2 possible symbols (called bits) 0,1

 Decimal numbers larger than 9 can be represented by adding more digits


 Example: 247635, 526, 83474
 Binary numbers larger than 1 can be represented by adding more bits
 Example: 10110, 110, 00110011

9
The Inverter (Not Gate)

A group of inverters can be used to get the 1’s complement


of a binary number:

Binary number
1 0 0 0 1 1 0 1

0 1 1 1 0 0 1 0
1’s complement

1’s complement of a binary number means that we invert each


bit of that number.

10
The AND Gate

The AND gate produces a HIGH output when all inputs are
HIGH; otherwise, the output is LOW. For a 2-input gate,
the truth table is

Inputs Output
A B X
0 0 0 A X
0 1 0 B
1 0 0
1 1 1

The AND operation is usually shown with a dot between the


variables, but it may be implied (no dot). Thus, the AND
operation is written as X = A .B or X = AB.

11
The AND Gate

A X
B

Example waveforms:

A
B
X

If the binary number 1010 0011


is ANDed with 0000 1111
what is the result? 0000 0011
12
The OR Gate

The OR gate produces a HIGH output if any input is HIGH;


if all inputs are LOW, the output is LOW. For a 2-input gate,
the truth table is
Inputs Output
A B X
0 0 0 A X
0 1 1
B
1 0 1
1 1 1

The OR operation is shown with a plus sign (+) between the


variables. Thus, the OR operation is written as X = A + B.

13
The OR Gate

A X
B

Example waveforms:
A
B

If the binary number 1010 0011


is ORed with 0000 1111
what is the result? 1010 1111
14
Timing Diagram / Waveform

15
Logical Operations
Assuming A=0101 and B=1001 as inputs and X as output

AND Logic Gate X = A.B or AB


A= 0101
B= 1001
X= 0001

OR Logic Gate X =A+B


A= 0101
B= 1001
X= 1101
NOT Logic Gate
X =Ā or A’ (A Complement)
A= 0101
X= 1010
16
The NAND Gate A X
B

The NAND gate produces a LOW(0) output when all inputs


are HIGH (1); otherwise, the output is HIGH (1).
Think of it as AND followed by NOT
For a 2-input gate, the truth table is Inputs Output
A B X
Input NAND
0 0 1
A B AND AND-NOT X
0 1 1
0 0 0 1 1 1 0 1
0 1 0 1 1 1 1 0
1 0 0 1 1
1 1 1 0 0
The NAND operation is written as X = A .B (Also as, X = AB) = (AB)’
pronounced as AB whole complement
17
The NAND Gate

A X
B
Example waveforms:
A
B

X
The NAND gate is particularly useful because it is a
“universal” gate – all other basic gates can be constructed
from NAND gates.
How to build a NOT gate from a 2-input NAND gate?

18
The NOR Gate A X
B

The NOR gate produces a LOW (0) output if any input is


HIGH (1); if all inputs are HIGH (1), the output is LOW(0)

Inputs Output
Think of it as OR followed by NOT A B X
ForInput
a 2-input gate, the truth table is 0 0 1
NOR
0 1 0
A B OR OR-NOT X 1 0 0
0 0 0 1 1 1 1 0
0 1 1 0 0
1 0 1 0 0
1 1 1 0 0
The NOR operation is written as X = A + B = (A+B)’
pronounced as A+B whole complement
19
The NOR Gate

A X
B
Example waveforms:
A
B

X
The NOR operation will produce a LOW if any input is HIGH.

The NOR gate is also a “universal” gate – all other basic


gates can be constructed from NOR gates.
Only NAND and NOR are called universal gates

20
The XOR Gate

A X
B

The XOR Exclusive-OR gate produces a HIGH output only


when both inputs are at opposite logic levels. The truth table is
Inputs Output
A B X
0 0 0
0 1 1
1 0 1
1 1 0

The XOR operation is written as X = AB + AB.


Alternatively, it can be written with a circled plus sign
between the variables as X = A + B.
21
The XOR Gate

A X
B

Example waveforms:
A
B

X
Notice that the XOR gate will produce a HIGH only when exactly one
input is HIGH.

If the A and B waveforms are both inverted for the above


waveforms, how is the output affected?

There is no change in the output.


22
The XNOR Gate
A X
B

The XNOR Exclusive NOR gate produces a HIGH output


only when both inputs are at the same logic level.
Think of it as XOR followed by NOT Inputs Output
A B X
Input XNOR 0 0 1
A B XOR XOR-NOT X 0 1 0
0 0 0 1 0 0
1 1
1 1 1
0 1 1 0 0
1 0 1 0 0
1 1 0 1 1

The XNOR operation shown as X = AB + AB.


It can be shown as X = A .
B.
23
The XNOR Gate

A X
B

Example waveforms:
A
B

Notice that the XNOR gate will produce a HIGH when both inputs are the
same. This makes it useful for comparison functions.

If the A waveform is inverted but B remains the same, how is


the output affected?

The output will be inverted.


24
Three Input AND Gate

Inputs Output
A
C X A B C X=ABC
B
0 0 0
0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
Notice that 1 1 1 1
• A 1-input inverter has two possible input values: 0, 1.
• A 2-input gate has 4 possible input combinations: 00, 01, 10, 11.
• A 3-input gate has 8 possible input combinations, for each input the
number of combinations is doubled. c
25
Three Input OR Gate
Inputs Outputs
A B C X=A+B+C
0 0 0
0
0 0 1
1
0 1 0
1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
Notice that 1 1 1 1
To create the input combinations, we use alternating 0s and 1s.
• Input C has one 0 followed by one 1.
• Input B has two 0s followed by two 1s.
• Input A has four 0s followed by four 1s, and so on…
26
Three Input XOR Gate
X= A + B + C

Inputs XOR
A B C D=A + B D+C X
0 0 0 0 0 0
0 0 1 0 1 1
0 1 0 1 1 1
0 1 1 1 0 0
1 0 0 1 1 1
1 0 1 1 0 0
1 1 0 0 0 0
1 1 1 0 1 1

For ODD number of 1s, the output is 1.

27

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy