170 likes | 178 Views
This tutorial provides a review of Boolean algebra and examples of logic gates. It includes exercises to write truth tables for different expressions and circuits, as well as explanations of De Morgan's Theorem and memory concepts.
E N D
COMPSCI 210Semester 1 - 2015 Tutorial 2: Logic Gates
Review of Boolean algebra Example 1 . Write the truth table for : B+(BA)=F(AB)
___ • Exercise 1: write a “truth table” for: • a) (x+y+z)(xyz) • b) (XYZ) + (XY) (Z+Y) • c) PT(P+Z) _ _ _
Basic logic gates • Not • And • Or • Nand • Nor • Xor
NAND Gate X Z X Y Z 0 0 1 0 1 1 1 0 1 1 1 0 NOT-AND Y NAND W = X.Y Z = W = X.Y _ ____ X ____ W Z = X.Y nand(Z,X,Y) Z Y
NOR Gate NOR NOT-OR W X X Z Z Y Y _______ _ _______ Z = (X + Y) nor(Z,X,Y) W = X + Y Z = W = (X + Y) X Y Z 0 0 1 0 1 0 1 0 0 1 1 0
(x+y)y y Rosen, §10.3 question 1 • Find the output of the following circuit • Answer: (x+y)y x+y __
___ _ _ x y x y x y Rosen, §10.3 question 2 • Find the output of the following circuit • Answer: xy
x+y x Rosen, §10.3 question 6 • Write the circuits for the following Boolean algebraic expressions • x+y __
(x+y)x x+y Rosen, §10.3 question 6 • Write the circuits for the following Boolean algebraic expressions • (x+y)x _______ x+y
Example • Draw the circuit diagram to implement the expression
De Morgan’s Theorem • NOT all variables • Change . to +and +to . • NOT the result • -------------------------------------------- _______ _______ __ __ ______ __ __ __ __ __________ (X . Y) = (X + Y) = X + Y X . Y (X + Y) = __ __ X + Y =
Memory • A flip-flop holds a single bit of memory • The bit “flip-flops” between the two NAND gates • In reality, flip-flops are a bit more complicated • Have 5 (or so) logic gates (transistors) per flip-flop • Consider a 1 Gb memory chip • 1 Gb = 8,589,934,592 bits of memory • That’s about 43 million transistors! • In reality, those transistors are split into 9 ICs of about 5 million transistors each