Download - Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)
![Page 1: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/1.jpg)
Boolean Algebra and Logic Gates
CSE-1108
Ahsanullah University of Science and Technology (AUST)
![Page 2: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/2.jpg)
2
Have you ever asked yourself?
1. How does a computer adds/ subtract/ multiply/ divide two (or more) numbers? Does it have a brain like human?
2. How does computer stores something? (Documents, songs, movies etc.) Does it have a memory like human?
Answer 01: Logic gates and circuits.
Answer 02: Logic gates and circuits.
![Page 3: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/3.jpg)
3
What is Logic Gate?
Logic gates are electronic circuits that operates on one or more input signals to produce standard output signals.
Are the building blocks of all the circuits in a computer.
Some of the most useful and basic logic gates are AND, OR, NOT, NAND and NOR gates.
![Page 4: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/4.jpg)
Logic Gate Implementation
Using Switches Inputs:
logic 1 is switch closed
logic 0 is switch open Outputs:
logic 1 is light on
logic 0 is light off. NOT input:
logic 1 is switch open
logic 0 is switch closed
Switches in series => AND
Switches in parallel => OR
CNormally-closed switch => NOT
![Page 5: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/5.jpg)
Logic Gate ImplementationIn the earliest computers, switches were
opened and closed by magnetic fields
produced by energizing coils in relays. The
switches in turn opened and closed the current
paths.
Later, vacuum tubes that open and close
current paths electronically replaced relays.
Today, transistors are used as electronic
switches that open and close current paths.
![Page 6: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/6.jpg)
What is Boolean Algebra?
We need operator and operands in an Algebra.
In Boolean algebra, operands are called binary variables.
Operators are called Logical Operators.
Basic logical operators are the logic functions AND, OR and NOT.
Logic gates implement logic functions.
Boolean Algebra is a useful mathematical system for specifying and transforming logic functions.
We study Boolean algebra as a foundation for designing and analyzing digital systems!
![Page 7: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/7.jpg)
7
Basic logic gates
Not
And
Or
Nand
Nor
Xor
xx
xy
xy xy
xyz
zx+yx
yxy
x+y+z
z
xy
xy
x+yxy
xÅyxy
![Page 8: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/8.jpg)
Truth TablesTabular listing of the values of a function for all possible combinations of values on its argumentsExample: Truth tables for the basic logic operations:
01
10
X
NOT
XZ=
111
001
010
000
Z = X·YYX
AND OR
X Y Z = X+Y
0 0 0
0 1 1
1 0 1
1 1 1
![Page 9: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/9.jpg)
Truth Tables – Cont’d
Used to evaluate any logic function
Consider F(X, Y, Z) = X Y + Y Z
X Y Z X Y Y Y Z F = X Y + Y Z0 0 0 0 1 0 00 0 1 0 1 1 10 1 0 0 0 0 00 1 1 0 0 0 01 0 0 0 1 0 01 0 1 0 1 1 11 1 0 1 0 0 11 1 1 1 0 0 1
![Page 10: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/10.jpg)
Logic Diagrams and Expressions
Boolean equations, truth tables and logic diagrams describe the same function!Truth tables are unique, but expressions and logic diagrams are not. This gives flexibility in implementing functions.
X
Y F
Z
Logic Diagram
Logic Equation
ZY X F +=
Truth Table
11 1 1
11 1 0
11 0 1
11 0 0
00 1 1
00 1 0
10 0 1
00 0 0
X Y Z Z Y X F ×+=
![Page 11: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/11.jpg)
Boolean Algebra
1.
3.
5.
7.
9.
11.
13.
15.
17.
Commutative
Associative
Distributive
DeMorgan’s
2.
4.
6.
8.
X . 1 X=
X . 0 0=
X . X X=
0=X . X
10.
12.
14.
16.
X + Y Y + X=
(X + Y) Z+ X + (Y Z)+=
X(Y + Z) XY XZ+=
X + Y X . Y=
XY YX=
(XY) Z X(Y Z)=
X + YZ (X + Y) (X + Z)=
X . Y X + Y=
X + 0 X=
+X 1 1=
X + X X=
1=X + X
X = X
Invented by George Boole in 1854 An algebraic structure defined by a set B = {0, 1}, together with two
binary operators (+ and ·) and a unary operator ( )
Idempotence
Complement
Involution
Identity element
![Page 12: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/12.jpg)
Boolean Operator Precedence
The order of evaluation is:
1. Parentheses2. NOT3. AND4. OR
Consequence: Parentheses appear around OR expressions
Example: F = A(B + C)(C + D)
![Page 13: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/13.jpg)
13
Logic Circuit to Boolean expression
Find the output of the following circuit
Answer: (x+y)y Or (xy)y
xy
x+y
y
(x+y)y
__
xy
y
![Page 14: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/14.jpg)
14
x
y
Logic Circuit to Boolean expression
Find the output of the following circuit
Answer: xy Or (xy) ≡ xy
x
y
x y x y
_ _ ___
![Page 15: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/15.jpg)
15
Boolean expression to Logic Circuit
Write the circuits for the following Boolean algebraic expressions
a) x+y
xyxyxy
__
x x+y
![Page 16: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/16.jpg)
16
xyxyxy
Boolean expression to Logic Circuit
Write the circuits for the following Boolean algebraic expressions
b) (x+y)x_______
xy
x+yx+y (x+y)x
![Page 17: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/17.jpg)
17
How to add binary numbers
Consider adding two 1-bit binary numbers x and y 0+0 = 0 0+1 = 1 1+0 = 1 1+1 = 10
Carry is x AND y
Sum is x XOR y
The circuit to compute this is called a half-adder
x y Carry Sum0 0 0 00 1 0 11 0 0 11 1 1 0
![Page 18: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/18.jpg)
18
The half-adder
Sum = x XOR y
Carry = x AND y
xy Sum
Carry
![Page 19: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/19.jpg)
19
Using half adders
We can then use a half-adder to compute the sum of two Boolean numbers
1 1 0 0
+ 1 1 1 0010?
001
![Page 20: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/20.jpg)
20
How to fix this
We need to create an adder that can take a carry bit as an additional input
Inputs: x, y, carry in Outputs: sum, carry out
This is called a full adder Will add x and y with a half-adder Will add the sum of that to the
carry in
What about the carry out? It’s 1 if either (or both): x+y = 10 x+y = 01 and carry in = 1
x y c carry sum
1 1 1 1 1
1 1 0 1 0
1 0 1 1 0
1 0 0 0 1
0 1 1 1 0
0 1 0 0 1
0 0 1 0 1
0 0 0 0 0
![Page 21: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/21.jpg)
21
The full adder
The “HA” boxes are half-adders
HAX
Y
S
C
HAX
Y
S
C
xy
c
c
s
HAX
Y
S
C
HAX
Y
S
C
xy
c
![Page 22: Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)](https://reader035.vdocuments.mx/reader035/viewer/2022070413/5697bfed1a28abf838cb8d51/html5/thumbnails/22.jpg)
22
The full adder
The full circuitry of the full adder
xy
s
c
c