Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
41 views8 pages

Logic

This document discusses basic logical operations including AND, OR, NOT, NAND, NOR, and XOR. It provides truth tables and logic gate diagrams for each operation and examples of how to evaluate expressions using them. It also explains that logic is important for both computer hardware using logic circuits and software using logic in programs.

Uploaded by

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

Logic

This document discusses basic logical operations including AND, OR, NOT, NAND, NOR, and XOR. It provides truth tables and logic gate diagrams for each operation and examples of how to evaluate expressions using them. It also explains that logic is important for both computer hardware using logic circuits and software using logic in programs.

Uploaded by

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

Basic Logical Operations

(Fascinating)
In this section you will learn what are
the basic logical operations and how to
evaluate different logical expressions

Image from Star Trek © Paramount James Tam

Logical AND

Truth table Truth table

X Y X AND Y X Y X AND Y

False False False 0 0 0

False True False 0 1 0

True False False 1 0 0


True True True 1 1 1

Logic gate

James Tam

Basic logic 1
Logical AND: An Example

T T F F T F

AND F T F T T F

F T F F T F

James Tam

Logical OR

Truth table Truth table

X Y X OR Y X Y X OR Y

False False False 0 0 0

False True True 0 1 1

True False True 1 0 1

True True True 1 1 1

Logic gate

James Tam

Basic logic 2
Logical OR: An Example

T T F F T F

OR F T F T T F

T T F T T F

James Tam

Logical NOT

Truth table Truth table

X Not X X Not X

False True 0 1

True False 1 0

Logic gate

James Tam

Basic logic 3
Logical NOT: An Example

T T F F T F

NOT F F T T F T

James Tam

Logical NAND
Truth table
X Y X AND Y X NAND Y
False False False True
False True False True
True False False True
True True True False

Truth table
X Y X AND Y X NAND Y
0 0 0 1
Logic gate
0 1 0 1
1 0 0 1
1 1 1 0

James Tam

Basic logic 4
Logical NAND: An Example

T T F F T F

AND F T F T T F

F T F F T F

NAND T F T T F T

James Tam

Logical NOR
Truth table
X Y X OR Y X NOR Y
False False False True
False True True False
True False True False
True True True False

Truth table
X Y X OR Y X NOR Y
0 0 0 1
Logic gate
0 1 1 0
1 0 1 0
1 1 1 0
James Tam

Basic logic 5
Logical NOR: An Example

T T F F T F

OR F T F T T F

T T F T T F

NOR F F T F F T

James Tam

Logical Exclusive OR (XOR)

Truth table Truth table


X Y X XOR Y X Y X XOR Y
False False False 0 0 0
False True True 0 1 1
True False True 1 0 1
True True False 1 1 0

Logic gate

James Tam

Basic logic 6
Logical XOR: An Example

T T F F T F

XOR F T F T T F

T F F T F F

James Tam

Reasons For Learning About Logic


Hardware perspective
• The computer is built using logic circuits

James Tam

Basic logic 7
Reasons For Learning About Logic (2)

Software perspective
• Logic is common-place in computer programs

James Tam

You Should Now Know


The different types of logical operations that a computer may
perform
• AND
• OR
• NOT
• NAND
• NOR
• XOR

How logic gates form an important part of computers

James Tam

Basic logic 8

You might also like