Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 1 Binary storage & registers

2

3 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

4 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.

5 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: 1 + 1 = 2 (read “one plus one equals two”) is not the same as 1 + 1 = 1 (read “1 or 1 equals 1”).  BAY  yxz   AX  is read “X is equal to NOT A.”

6 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 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 1 NOT 10  01 

7 منطق دو دويي

8 CS 151 01 10 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: 111 001 010 000 Z = X·Y YX AND OR XYZ = X+Y 000 011 101 111

9 گيتهاي منطقي معادل

10

11 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

12

13 اصول جبر بول If a & b K a.b K a+b K اصول اساسی : اصل 1: تعریف : برای هر و که متعلق به مجموعه ی هستند، و نیز به مجموعه ی تعلق دارند. ( ، و ، نامیده می شود ). ab a.b a+b And a.bOr a+b k k

14 x + 0 = x اصول جبر بول اصل 2: موجودیت عناصر 0 و 1: x. 1 = x x x + 0 x. 1 0 0 0 1 1 1

15 اصول جبر بول (3) اصل 3: خاصیت عناصر + و. : x + y = y + x x. y = y. x xy x.yy.xx+yy+x 0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 0 1 1 1 1 1 1 1 1

16 x.(y + z) = x. y + x. z خاصیت توزیع پذیری + بر. و. بر +: x +(y. z) = (x + y). (x + z) اصول جبر بول

17 xyzy.zx+y.zx+yx+z(x+y)(x+z) 000 0 0 0 0 0 001 0 0 0 1 0 010 0 0 1 0 0 011 1 1 1 1 1 100 0 1 1 1 1 101 0 1 1 1 1 110 0 1 1 1 1 111 1 1 1 1 1 آزمون درستی توزیع پذیری + بر. و. بر + (2) =

18 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

19 نحوه نمايش توابع بولي بصورت تركيبي از عبارات و متغيرهاي بولي. جدول صحت مداري متشكل از گيتهاي منطقي

20 CS 15120 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 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    Y Y Z X + Y Z

21 CS 15121 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)

22 BME 231 DIGITAL DESIGN22

23 BME 231 DIGITAL DESIGN23

24 BME 231 DIGITAL DESIGN24

25 BME 231 DIGITAL DESIGN25

26 BME 231 DIGITAL DESIGN26

27 BME 231 DIGITAL DESIGN27

28 BME 231 DIGITAL DESIGN28

29 BME 231 DIGITAL DESIGN29

30 CS 15130 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

31 BME 231 DIGITAL DESIGN31 Boolean Functions Boolean algebra deals with binary variables and logic operations. Function results in binary 0 or 1 x00001111x00001111 y00110011y00110011 z01010101z01010101 F00001011F00001011 F = x(y+z’) x y z z’ y+z’ F = x(y+z’)

32 BME 231 DIGITAL DESIGN32 Boolean Functions Boolean algebra deals with binary variables and logic operations. Function results in binary 0 or 1 x00001111x00001111 y00110011y00110011 z01010101z01010101 xy 0 1 x y z G = xy +yz yz xy We will learn how to transition between equation, symbols, and truth table. yz 0 1 0 1 G00010011G00010011

33 CS 15133 Which Design is simpler? Expression Simplification F= XYZ + XYZ + XZ = XY(Z + Z) + XZ = XY. 1 + XZ = XY + XZ

34 CS 15134 Algebraic Manipulation XYZXZXYZ XZXYXYZ+XYZ+XZXY+XZ 000110000 00 001100000 00 010110101 11 011101001 11 100010000 00 101000010 11 110010000 00 111000010 11 All possible combinations of 3 variables Intermediate Results (Terms in Function) F1F2

35 CS 15135 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

36 قوانین دمرگان ( 1) (x.y)’=x’+y’ (x+y)’=x’.y’ این قانون می تواند به صورت زیر تعمیم پیدا کند : (x.y.....t)’=x’+y’+...+t’ (x+y+...+t)’=x’.y’.....t’

37 (duality) دوگان 01 duality AndOr duality مثال: x+y’z x.(y’+z) دوگان

38 نحوه نمايش توابع بولي توابع بولي را مي‌توان به چند طريق نمايش داد: بصورت تركيبي نامرتب از عبارات و متغيرهاي بولي. بصورت مجموع جملات مي‌نيمم بصورت حاصلضرب جملات ماكزيمم چند جمله ‌ اي مي ‌ نيمم : يك عبارت حاصلضرب است كه همة متغيرها يا مكمل آنها حتماً وجود دارد.

39 مثال : جدول درستي را براي تابع f(A,B,C) = AB + A΄C + AC΄ بدست آوريد.

40 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 0 0 0 x’y’z’ m 0 0 0 1 x’y’z m 1 … 1 0 0 xy’z’ m 4 … 1 1 1 xyz m 7 Maxterms x y z Maxterm 0 0 0 x+y+z M 0 0 0 1 x+y+z’ M 1 … 1 0 0 x’+y+z M 4 … 1 1 1 x’+y’+z’ M 7

41 ) (1) POS)) و ماکسترم ها SOP) مینترم xyzx+y+z Minterm Maxterm 0 0 0 0x’.y’.z’ m 0 x+y+z M 0 0 0 1 1x’.y’.z m 1 x+y+z’ M 1 0 1 0 1x’.y.z’ m 2 x+y’+z M 2 0 1 1 1x’.y.z m 3 x+y’+z’ M 3 1 0 0 1x.y’.z’ m 4 x’+y+z M 4 1 0 1 1x.y’.z m 5 x’+y+z’ M 5 1 1 0 1x.y.z’ m 6 x’+y’+z M 6 1 1 1 1x.y.z m 7 x’+y’+z’ M 7

42 ) (2) POS)) و ماکسترم ها SOP) مینترم مثال: تابع زیر را به صورت مینترمی بنویسید. xyF 000 010 100 111 F (x, y) = x. y 1. رسم جدول درستی 2. تعیین مینترم ها F (x, y) = F(2)

43 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 x00001111x00001111 y00110011y00110011 z01010101z01010101 F00010011F00010011 F = xyz + xyz’ + x’yz F = m 7 + m 6 + m 3 = Σ(3, 6, 7)

44 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. x00001111x00001111 y00110011y00110011 z01010101z01010101 F00010011F00010011 xyz + xyz’ + x’yz Any Boolean Expression can be represented in sum of products form!

45 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 x00001111x00001111 y00110011y00110011 z01010101z01010101 F00010011F00010011 F = xyz + xyz’ + x’yz F x x x x x x x x x

46 BME 231 DIGITAL DESIGN46 Reduced Hardware Implementation Reduced equation requires less hardware! Same function implemented! x y z x00001111x00001111 y00110011y00110011 z01010101z01010101 F00010011F00010011 F = xyz + xyz’ + x’yz = xy + yz F x x x x

47 BME 231 DIGITAL DESIGN47 Conversion Between Canonical Forms Easy to convert between minterm and maxterm representations For maxterm representation, select rows with 0’s x00001111x00001111 y00110011y00110011 z01010101z01010101 F00010011F00010011 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’)

48 نحوه نمايش توابع بولي توابع بولي را مي‌توان به چند طريق نمايش داد: بصورت تركيبي نامرتب از عبارات و متغيرهاي بولي. بصورت مجموع جملات مي‌نيمم بصورت حاصلضرب جملات ماكزيمم چند جمله ‌ اي مي ‌ نيمم : يك عبارت حاصلضرب است كه همة متغيرها يا مكمل آنها حتماً وجود دارد.

49 تبديل بين شكلهاي متعارف هرگاه يك تابع بولي بر حسب مجموع جملات مي‌نيمم نوشته شده باشد ، مكمل آن برابر است با حاصلجمع جملات مينيممي كه از تابع اصلي حذف شده اند. بطور مشابه مي توان هر تابع بصورت مجموع جملات مي‌نيمم را بصورت حاصلضرب جملات ماكزيممي نوشت كه شماره هاي متناظر آن از جملات مينيمم، از تابع اصلي حذف شده‌اند. مثال : f 1 (A,B,C) =  m (2,3,6,7) = f 2 (A,B,C) =  M(0,1,4,5)

50 روش ديگر مي توان براي يافتن حاصلضرب جملات ماكزيمم از مجموع جملات مي نيمم نيز استفاده كرد. مثال : تابع زير را بصورت حاصلضرب جملات ماكزيمم نمايش دهيد: 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)


Download ppt "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."

Similar presentations


Ads by Google