Boolean Algebra and Logic Gates 1 Computer Engineering (Logic Circuits) Lec. # 3 Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering Faculty of Engineering Zagazig University
Boolean Algebra and Logic Gates Course Web Page
Announcements 30 Minutes Quiz will be held at the beginning of lecture. No Cheatings. Zero marks for the cheaters. Do not forget to write your names on the answer sheet. Boolean Algebra and Logic Gates 3
Lec. # 3 Binary Logic & Gates Boolean Algebra and Logic Gates 4
Boolean Algebra and Logic Gates 5 Binary Logic and Gates Binary variables take on one of two values. Logical operators operate on binary values and binary variables. Basic logical operators are the logic functions AND, OR and NOT. Logic gates implement logic functions. Boolean Algebra: a useful mathematical system for specifying and transforming logic functions. We study Boolean algebra as a foundation for designing and analyzing digital systems!
Boolean Algebra and Logic Gates 6 Binary Variables Recall that the two binary values have different names: True/False On/Off Yes/No 1/0 We use 1 and 0 to denote the two values. Variable identifier examples: A, B, y, z, or X 1 for now RESET, START_IT, or ADD1 later
Boolean Algebra and Logic Gates 7 Logical Operations The three basic logical operations are: AND OR NOT AND is denoted by a dot (·). OR is denoted by a plus (+). NOT is denoted by an over bar ( ¯ ), a single quote mark (') after.
Boolean Algebra and Logic Gates 8 Examples: is read “Y is equal to A AND B.” is read “z is equal to x OR y.” is read “X is equal to NOT A.” Notation Examples Note: The statement: = 2 (read “one plus one equals two”) is not the same as = 1 (read “1 or 1 equals 1”). BAY yxz AX
Boolean Algebra and Logic Gates 9 Operator Definitions Operations are defined on the values "0" and "1" for each operator: AND 0 · 0 = 0 0 · 1 = 0 1 · 0 = 0 1 · 1 = 1 OR = = = = 1 NOT 10 01 Buffer 1 1 00
Boolean Algebra and Logic Gates X NOT XZ 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: Z = X·Y YX AND OR XYZ = X+Y
Filling A Truth Table ( i/ps) Boolean Algebra and Logic Gates 11
Boolean Algebra and Logic Gates 12 dcba
Boolean Algebra and Logic Gates 13 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 Logic Function Implementation Switches in series => AND Switches in parallel => OR C Normally-closed switch => NOT
Boolean Algebra and Logic Gates 14 Example: Logic Using Switches Light is on (L = 1) for L(A, B, C, D) = and off (L = 0), otherwise. Useful model for relay and CMOS gate circuits, the foundation of current digital logic circuits Logic Function Implementation – cont’d B A D C A (B C + D) = A B C + A D
Boolean Algebra and Logic Gates 15 Logic Gates 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.
Boolean Algebra and Logic Gates 16 Logic Gate Symbols and Behavior Logic gates have special symbols: And waveform behavior in time as follows : X 0011 Y0101 X · Y(AND)0001 X+ Y(OR)0111 (NOT)X 1100 OR gate X Y Z= X+ Y X Y Z= X · Y AND gate X Z= X NOT gate or inverter YY BUFFER
Boolean Algebra and Logic Gates 17
Boolean Algebra and Logic Gates 18 `
Boolean Algebra and Logic Gates 19 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
Boolean Algebra and Logic Gates 20 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 X Y Z Z Y X F
Logic Circuit Analysis Boolean Algebra and Logic Gates 21 a b c f F = a + b + c b c a f
Logic Circuit Analysis Boolean Algebra and Logic Gates 22 a b c f F = abc b c a f
Logic Circuit Analysis Boolean Algebra and Logic Gates 23 a b c f F = ab + c
Logic Circuit Analysis Boolean Algebra and Logic Gates 24 a c f F = a + c
Logic Circuit Analysis Boolean Algebra and Logic Gates 25 a c F = (a + c). (b+d) f b d
Truth Table (Last Example) Boolean Algebra and Logic Gates 26
Boolean Algebra and Logic Gates 27 F=(a + c). (b+d) b+da + cdcba