1 Binary storage & registers
CS 151 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
CS 151 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 overbar ( ¯ ), a single quote mark (') after, or (~) before the variable.
CS 151 Examples: – is read “Y is equal to A AND B.” – is read “z is equal to x OR y.” – 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 is read “X is equal to NOT A.”
CS 151 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
منطق دو دويي
CS X NOT XZ Truth Tables Truth table a 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
گيتهاي منطقي معادل
CS 151 Using Switches –For inputs: logic 1 is switch closed logic 0 is switch open –For outputs: logic 1 is light on logic 0 is light off. NOT uses a switch such that: 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
اصول جبر بول If a & b K a.b K a+b K اصول اساسی : اصل 1: تعریف : برای هر و که متعلق به مجموعه ی هستند، و نیز به مجموعه ی تعلق دارند. ( ، و ، نامیده می شود ). ab a.b a+b And a.bOr a+b k k
x + 0 = x اصول جبر بول اصل 2: موجودیت عناصر 0 و 1: x. 1 = x x x + 0 x
اصول جبر بول (3) اصل 3: خاصیت عناصر + و. : x + y = y + x x. y = y. x xy x.yy.xx+yy+x
x.(y + z) = x. y + x. z خاصیت توزیع پذیری + بر. و. بر +: x +(y. z) = (x + y). (x + z) اصول جبر بول
xyzy.zx+y.zx+yx+z(x+y)(x+z) آزمون درستی توزیع پذیری + بر. و. بر + (2) =
Postulates and Theorems of Boolean Algebra Postulate 2(a) x+0= x (b) x. 1 = x Postulate 5(a) x + x = 1 (b) x. x = 0 Theorem 1(a) x + x = x (b) x. x = x Theorem 2(a) x + 1 = 1 (b) x. 0 = 0 Theorem 3, involution(x ) = x Postulate 3, commutative(a) x+y = y+x (b) xy =yx Theorem 4, associative(a) x +(y+z) = (x+y)+z (b) x(yz)=(xy)z Postulate 4, distributive(a) x(y+z) = xy+xz (b) x+yz =(x+y)(x+z) Theorem 5, DeMorgen(a) (x +y) = xy (b) (xy) =x+y Theorem 6, absorption(a) x+xy =x(b) x(x+y)=x
نحوه نمايش توابع بولي بصورت تركيبي از عبارات و متغيرهاي بولي. جدول صحت مداري متشكل از گيتهاي منطقي
CS Logic Diagrams and Expressions Boolean equations, truth tables and logic diagrams describe the same function! Truth tables are unique; expressions and logic diagrams are not. This gives flexibility in implementing functions. X Y F Z Logic Diagram Equation ZY X F Truth Table X Y Z Z Y X F Y Y Z X + Y Z
CS Boolean Operator Precedence The order of evaluation in a Boolean expression is: 1.Parentheses 2.NOT 3.AND 4.OR Consequence: Parentheses appear around OR expressions Example: F = A(B + C)(C + D)
BME 231 DIGITAL DESIGN22
BME 231 DIGITAL DESIGN23
BME 231 DIGITAL DESIGN24
BME 231 DIGITAL DESIGN25
BME 231 DIGITAL DESIGN26
BME 231 DIGITAL DESIGN27
BME 231 DIGITAL DESIGN28
BME 231 DIGITAL DESIGN29
CS Boolean Function Evaluation z x yx F4 x z yx zyx F3 x F2 xy F1 z yz y Kindly view notes page for answer
BME 231 DIGITAL DESIGN31 Boolean Functions Boolean algebra deals with binary variables and logic operations. Function results in binary 0 or 1 x x y y z z F F F = x(y+z’) x y z z’ y+z’ F = x(y+z’)
BME 231 DIGITAL DESIGN32 Boolean Functions Boolean algebra deals with binary variables and logic operations. Function results in binary 0 or 1 x x y y z z xy 0 1 x y z G = xy +yz yz xy We will learn how to transition between equation, symbols, and truth table. yz G G
CS Which Design is simpler? Expression Simplification F= XYZ + XYZ + XZ = XY(Z + Z) + XZ = XY. 1 + XZ = XY + XZ
CS Algebraic Manipulation XYZXZXYZ XZXYXYZ+XYZ+XZXY+XZ All possible combinations of 3 variables Intermediate Results (Terms in Function) F1F2
CS Algebraic Manipulation How can we reduce Boolean expression in order to simplify circuits? –Computer programs –Manual method (cut-and-try procedures) Examples: 1.X + XY = X(1 + Y) = X 2.XY + XY = X(Y + Y) = X 3.X + XY = (X+X)(X+Y) = X+Y 4.X(X+Y) = X + XY = X 5.(X+Y)(X+Y) = X + YY = X 6.X (X+Y) = XX + XY = XY Dual of equations 1,2,3
قوانین دمرگان ( 1) (x.y)’=x’+y’ (x+y)’=x’.y’ این قانون می تواند به صورت زیر تعمیم پیدا کند : (x.y.....t)’=x’+y’+...+t’ (x+y+...+t)’=x’.y’.....t’
(duality) دوگان 01 duality AndOr duality مثال: x+y’z x.(y’+z) دوگان
نحوه نمايش توابع بولي توابع بولي را ميتوان به چند طريق نمايش داد: بصورت تركيبي نامرتب از عبارات و متغيرهاي بولي. بصورت مجموع جملات مينيمم بصورت حاصلضرب جملات ماكزيمم چند جمله اي مي نيمم : يك عبارت حاصلضرب است كه همة متغيرها يا مكمل آنها حتماً وجود دارد.
مثال : جدول درستي را براي تابع f(A,B,C) = AB + A΄C + AC΄ بدست آوريد.
BME 231 DIGITAL DESIGN40 Minterms, Maxterms and Canonical Forms Each variable in a Boolean expression is a literal Boolean variables can appear in normal (x) or complement form (x’) Each AND combination of terms is a minterm Each OR combination of terms is a maxterm Minterms x y z Minterm x’y’z’ m x’y’z m 1 … xy’z’ m 4 … xyz m 7 Maxterms x y z Maxterm x+y+z M x+y+z’ M 1 … x’+y+z M 4 … x’+y’+z’ M 7
) (1) POS)) و ماکسترم ها SOP) مینترم xyzx+y+z Minterm Maxterm x’.y’.z’ m 0 x+y+z M x’.y’.z m 1 x+y+z’ M x’.y.z’ m 2 x+y’+z M x’.y.z m 3 x+y’+z’ M x.y’.z’ m 4 x’+y+z M x.y’.z m 5 x’+y+z’ M x.y.z’ m 6 x’+y’+z M x.y.z m 7 x’+y’+z’ M 7
) (2) POS)) و ماکسترم ها SOP) مینترم مثال: تابع زیر را به صورت مینترمی بنویسید. xyF F (x, y) = x. y 1. رسم جدول درستی 2. تعیین مینترم ها F (x, y) = F(2)
BME 231 DIGITAL DESIGN43 Representing Functions with Minterms Minterm number same as row position in truth table (starting from top from 0) Shorthand way to represent functions x x y y z z F F F = xyz + xyz’ + x’yz F = m 7 + m 6 + m 3 = Σ(3, 6, 7)
BME 231 DIGITAL DESIGN44 Truth Table to Expression Converting a truth table to an expression –Each row with output of 1 becomes a product term –Sum product terms together. x x y y z z F F xyz + xyz’ + x’yz Any Boolean Expression can be represented in sum of products form!
BME 231 DIGITAL DESIGN45 Equivalent Representations of Circuits All three formats are equivalent Number of 1’s in truth table output column equals AND terms for Sum-of-Products (SOP) x y z x x y y z z F F F = xyz + xyz’ + x’yz F x x x x x x x x x
BME 231 DIGITAL DESIGN46 Reduced Hardware Implementation Reduced equation requires less hardware! Same function implemented! x y z x x y y z z F F F = xyz + xyz’ + x’yz = xy + yz F x x x x
BME 231 DIGITAL DESIGN47 Conversion Between Canonical Forms Easy to convert between minterm and maxterm representations For maxterm representation, select rows with 0’s x x y y z z F F F = xyz + xyz’ + x’yz F = m 7 + m 6 + m 3 = Σ(3, 6, 7) F = M 0 M 1 M 2 M 4 M 5 = Π(0,1,2,4,5) F = (x+y+z)(x+y+z’)(x+y’+z)(x’+y+z)(x’+y+z’)
نحوه نمايش توابع بولي توابع بولي را ميتوان به چند طريق نمايش داد: بصورت تركيبي نامرتب از عبارات و متغيرهاي بولي. بصورت مجموع جملات مينيمم بصورت حاصلضرب جملات ماكزيمم چند جمله اي مي نيمم : يك عبارت حاصلضرب است كه همة متغيرها يا مكمل آنها حتماً وجود دارد.
تبديل بين شكلهاي متعارف هرگاه يك تابع بولي بر حسب مجموع جملات مينيمم نوشته شده باشد ، مكمل آن برابر است با حاصلجمع جملات مينيممي كه از تابع اصلي حذف شده اند. بطور مشابه مي توان هر تابع بصورت مجموع جملات مينيمم را بصورت حاصلضرب جملات ماكزيممي نوشت كه شماره هاي متناظر آن از جملات مينيمم، از تابع اصلي حذف شدهاند. مثال : f 1 (A,B,C) = m (2,3,6,7) = f 2 (A,B,C) = M(0,1,4,5)
روش ديگر مي توان براي يافتن حاصلضرب جملات ماكزيمم از مجموع جملات مي نيمم نيز استفاده كرد. مثال : تابع زير را بصورت حاصلضرب جملات ماكزيمم نمايش دهيد: f(A,B,C) = AB + AC΄ + A΄C حل : در مثال قبل اين تابع بولي را به صورت مجموع جملات مينيمم نمايش داديم: f(A,B,C )= m(1, 3, 4, 6, 7) بنابراين مي توان نوشت: f(A,B,C ) )= m(1, 3, 4, 6, 7)==П(0,2,4)