Download presentation
Presentation is loading. Please wait.
Published byKristin Newman Modified over 9 years ago
1
Boolean Algebra and Logic Gates CSE-1108 Ahsanullah University of Science and Technology (AUST)
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. 2
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. 3
4
Logic Gate Implementation Using Switches Inputs: Inputs: logic 1 is switch closed logic 0 is switch open Outputs: Outputs: logic 1 is light on logic 0 is light off. NOT input: NOT input: logic 1 is switch open logic 0 is switch closed Switches in series => AND Switches in parallel => OR C Normally-closed switch => NOT
5
Logic Gate Implementation In 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.
6
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!
7
7 Basic logic gates NotAndOrNandNorXor
8
Truth Tables Tabular listing of the values of a function for all possible combinations of values on its arguments Example: Truth tables for the basic logic operations: 01 10 X NOT XZ 111 001 010 000 Z = X·Y YX AND OR XYZ = X+Y 000 011 101 111
9
Truth Tables – Cont’d Used to evaluate any logic function Consider F(X, Y, Z) = X Y + Y Z XYZX YYY ZF = X Y + Y Z 0000100 0010111 0100000 0110000 1000100 1010111 1101001 1111001
10
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
11
Boolean Algebra 1. 3. 5. 7. 9. 11. 13. 15. 17. Commutative Associative Distributive DeMorgan’s 2. 4. 6. 8. X. 1 X = X. 00 = X. XX = 0 = 10. 12. 14. 16. X + YY + X = (X + Y)Z + X + (YZ)Z) += X(Y + Z)XYXZ += X + YX. Y = XYYX = (XY)ZX(YX(YZ)Z) = X+ YZ(X + Y)(X + Z)= X. YX + Y = X + 0 X = + X 11 = X + XX = 1 = 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
12
Boolean Operator Precedence The order of evaluation is: 1.Parentheses 2.NOT 3.AND 4.OR Consequence: Parentheses appear around OR expressions Example: F = A(B + C)(C + D)
13
13 Logic Circuit to Boolean expression Find the output of the following circuit Answer: (x+y)y Or (x y) y Or (x y) y x+yx+y y (x+y)y(x+y)y__
14
14 Logic Circuit to Boolean expression Find the output of the following circuit Answer: xy Or ( x y) ≡ x y Or ( x y) ≡ x y x y xyxy _ _ ___ ___
15
15 Boolean expression to Logic Circuit Write the circuits for the following Boolean algebraic expressions a) x+y __ __ x x+yx+y
16
16 Boolean expression to Logic Circuit Write the circuits for the following Boolean algebraic expressions b)(x+y)x _______ x+yx+y x+yx+y (x+y)x(x+y)x
17
17 How to add binary numbers Consider adding two 1-bit binary numbers x and y 0+0 = 0 0+0 = 0 0+1 = 1 0+1 = 1 1+0 = 1 1+0 = 1 1+1 = 10 1+1 = 10 Carry is x AND y Sum is x XOR y The circuit to compute this is called a half-adder xyCarrySum 0000 0101 1001 1110
18
18 The half-adder Sum = x XOR y Carry = x AND y
19
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 0 0 + 1 1 1 0 010? 001
20
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 Inputs: x, y, carry in Outputs: sum, carry out Outputs: sum, carry out This is called a full adder Will add x and y with a half-adder Will add x and y with a half-adder Will add the sum of that to the carry in Will add the sum of that to the carry in What about the carry out? It’s 1 if either (or both): It’s 1 if either (or both): x+y = 10 x+y = 10 x+y = 01 and carry in = 1 x+y = 01 and carry in = 1 xyccarrysum 11111 11010 10110 10001 01110 01001 00101 00000
21
21 The full adder The “HA” boxes are half-adders
22
22 The full adder The full circuitry of the full adder
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.