Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CS 352 Introduction to Logic Design Lecture 1 Ahmed Ezzat Number Systems and Boolean Algebra, Ch-1 + Ch-2.

Similar presentations


Presentation on theme: "1 CS 352 Introduction to Logic Design Lecture 1 Ahmed Ezzat Number Systems and Boolean Algebra, Ch-1 + Ch-2."— Presentation transcript:

1 1 CS 352 Introduction to Logic Design Lecture 1 Ahmed Ezzat Number Systems and Boolean Algebra, Ch-1 + Ch-2

2 CS-352Ahmed Ezzat 2 Outline Introduction Number Systems and Conversion Binary Arithmetic Representation of Negative Numbers Binary Codes Basic Boolean Operations Boolean Expressions and Truth Tables Basic Theorems Commutative, Associative, and Distribitution laws Simplification Theorems Multiplying Out & Factoring DeMorgan’s Laws

3 CS-352Ahmed Ezzat 3 Introduction Digital Systems: works with discrete values, and can be divided into: – System Design: Breaks overall system into subsystems and specify characteristics of each subsystem – Logic Design: Determine how to interconnect basic building blocks to perform a specific function – Circuit Design: Specify interconnection of specific components, such as resistors and transistors, to form a gate, flip-flop, or other logic block

4 CS-352Ahmed Ezzat 4 Introduction (2) Switching Circuits: A form of digital system, and comes in 2 flavors: – Combinational Circuits: Output values depend only on the present input values and not on past values – Sequential Circuits: Output depend on both the present and past input values

5 CS-352Ahmed Ezzat 5 Introduction (3) Boolean Algebra describes the relationship between input and output signals mathematically. To be economic, we need to simplify the boolean algebra  Karnaugh map and Quine-McCluskey procedures. Basic memory element used in designing sequential circuit is called Flip/Flop (F/F). F/Fs are the basic building blocks for counters, registers, etc. VHDL is a hardware description language used in the design of Combinational logic, Sequential logic and digital systems. This course is devoted to the study of “Logic Design.”

6 CS-352Ahmed Ezzat 6 Number Systems and Conversion (1) Decimal numbers are written using positional notations: 123.45 = 1 x 10 2 + 2 x 10 1 + 3 x 10 0 + 4 x 10 -1 + 5 x 10 -2 Any positive integer R (R > 1) can be used as a Radix or base of a number system For base R, then R digits (0, 1, 2, 3, …R-1) digits are needed to represent any number in that base Numbers written in positional notation can be written in a power series of R. 101.01 2 = 1 x 2 2 + 0 x 2 1 + 1 x 2 0 + 0 x 2 -1 + 1 x 2 -2 = 4 + 1 + ¼ = 5.25

7 CS-352Ahmed Ezzat 7 Number Systems and Conversion (2) 101.01 8 = 1 x 8 2 + 0 x 8 1 + 1 x 8 0 + 0 x 8 -1 + 1 x 8 -2 = 64 + 1 + 1/64 = 65.015625 3F 16 = 3 x 16 1 + 15 x 16 0 = 48 + 15 = 63

8 CS-352Ahmed Ezzat 8 Number Systems and Conversion (3): Converting Decimal Number N  Base R To convert a decimal number N to a base R number: Notice that N = (a n a n-1... a 2 a 1 a 0 ) R N = a n R n + a n-1 R n-1 +... + a 1 R 1 + a 0 Divide N by R to get Q 1 remainder (i.e., a 0 ) N/R = Q 1 = a n R n-1 + a n-1 R n-2 +... + a 2 R 1 + a 1 Divide Q 1 by R to get Q 2 remainder (i.e., a 1 ) Repeat process until a n is found.

9 CS-352Ahmed Ezzat 9 Number Systems and Conversion (4): Converting Decimal Number N  Base R Convert 53 decimal to a binary number: Check your work!  110101  1 + 0 + 4 + 16 + 32 = 53

10 CS-352Ahmed Ezzat 10 Number Systems and Conversion (5): Converting Decimal Number N  Base R To convert a decimal fraction F to base R: Notice that F = (.a -1 a -2... a -m ) R Multiply F by R = F * R = a -1 + F 1 Multiply F 1 by R = F 1 * R = a -2 + F 2 Repeat process until a m is found or process repeats.

11 CS-352Ahmed Ezzat 11 Number Systems and Conversion (6): Converting Decimal Fraction F  Base R Convert 0.625 to a binary number: 0.625 10 = (0.101) 2 0.7 10 = 01 0110 0110 0110… 2

12 CS-352Ahmed Ezzat 12 Number Systems and Conversion (7): Converting Between two bases other than Decimal Best to convert source number to decimal first and then convert the decimal number to the new base: e.g., Convert 231.3 4 to base 7

13 CS-352Ahmed Ezzat 13 Number Systems and Conversion (8): Converting Decimal Fraction F  Base R Converting between binary and octal and binary and hexadecimal is easily done by inspection because each octal digit corresponds to exactly three binary digits and each hexadecimal digit corresponds to exactly 4 binary digits. (1 000 111. 011 001) 2 = (1 0 7. 3 1) 8 = (4 7. 6 4) 16 (F C 2. 7) 16 = (1111 1100 0010. 0111) 2

14 CS-352Ahmed Ezzat 14 Binary Arithmetic (1) Arithmetic is usually done in binary in digital systems because such logic networks are easier to design. The methods for binary addition, subtraction, multiplication, and division are the same as for decimal addition, etc. except that everything is done in powers of 2. Add 5 + 12 in binary: 11  carries 00101 = 5 +01100 = 12 --------- 10001 = 17

15 CS-352Ahmed Ezzat 15 Binary Arithmetic (2) Subtract 5 from 12 in binary: 111  borrows 01100 = 12 - 00101 = 5 --------- 00111  7

16 CS-352Ahmed Ezzat 16 Binary Arithmetic (3) Multiply 13 by 5 in binary: 1101 = 13 (multiplicand) x 0101 = 5 (multiplier) --------- 1101 0000 1101 0000 ------------- 1000001 = 65

17 CS-352Ahmed Ezzat 17 Binary Arithmetic (4) Divide 145 10 (dividend) by 11 10 (divisor) in binary: Quotient is 1101 2 = 13 10, and remainder is 10 2 = 2 10

18 CS-352Ahmed Ezzat 18 Representation of Negative Numbers (1) Sign and Magnitude Representation: For an n-bits number, the MSB is the sign bit and the remaining (n-1) bits represents the magnitude. Thus an n-bit word can represent +2 n-1  -2 n-1 integer numbers 2’s Complement and 1’s Complement Representation: is more common because arithmetic operations are easier. Thus an n-bit word can represent +(2 n-1 -1)  0  -2 n-1

19 CS-352Ahmed Ezzat 19 Representation of Negative Numbers (2)

20 CS-352Ahmed Ezzat 20 Representation of Negative Numbers (3)

21 CS-352Ahmed Ezzat 21 Representation of Negative Numbers (4)

22 CS-352Ahmed Ezzat 22 Representation of Negative Numbers (5)

23 CS-352Ahmed Ezzat 23 Representation of Negative Numbers (6) 1’s complement addition is similar to 2’s complement addition except that instead of discarding the last carry-bit, it is added to the n-bit (LSB) of the sum in the position furthest to the right.

24 CS-352Ahmed Ezzat 24 Binary Codes (1) Computers internally use binary, however I/O devices typically use decimal numbers. A Binary-Coded-Decimal (BCD – 8-4-2-1) is formed by replacing each decimal digit by its 4-bit binary equivalent: 342.61 --> 0011 0100 0010. 0110 0001 Excess-3 code is obtained from BCD by adding 3 (0011). The 2-out-of-5 code has exactly 2 bits out of the 5 are 1. Gray code has successive decimal codes differ in only one digit – typically used when transforming analog values into digital form

25 CS-352Ahmed Ezzat 25 Binary Codes (2)

26 CS-352Ahmed Ezzat 26 Basic Boolean Operations (1) Basic Mathematics for studying logic design of digital systems is Boolean algebra Basic Operations are AND, OR, and Complement (inverse) Truth Tables list all combinations of inputs and the corresponding outputs for combinational circuits. An AND gate produces a 1 iff all inputs are 1 An OR gate produces a 1 iff one or more inputs are 1 A NOT gate (inverter) produces an output opposite to the input

27 CS-352Ahmed Ezzat 27 Basic Boolean Operations (2)

28 CS-352Ahmed Ezzat 28 Basic Boolean Operations (3) Switching Algebra

29 CS-352Ahmed Ezzat 29 Boolean Expressions and Truth Tables (1) Boolean expression is the application of basic operations to one or more variables (x, y, etc.) or constants (0 or 1)

30 CS-352Ahmed Ezzat 30 Boolean Expressions and Truth Tables (2) A truth table specifies the values of a Boolean expression for every possible combination of values of the variables in the expression Two expressions are equal iff they have the same truth tables

31 CS-352Ahmed Ezzat 31 Boolean Expressions and Truth Tables (3) Expressions (AB’ + C) = (A + C)(B’ + C)// equivalent

32 CS-352Ahmed Ezzat 32 Basic Theorems (1)

33 CS-352Ahmed Ezzat 33 Basic Theorems (2) The above six axioms completely define switching algebra. All other facts about the system can be proved starting with the axioms.

34 CS-352Ahmed Ezzat 34 Commutative, Associative and Distributive Laws Commutative law: XY = YX X + Y = Y + X Associative law: (XY)Z = X(YZ) = XYZ (X + Y) + Z = X + (Y + Z) = X + Y + Z XYZ = 1 iff X = Y = Z = 1 X + Y + Z = 0 iff X = Y = Z = 0 Distributive law: X(Y + Z) = XY + XZ X + YZ = (X + Y)(X + Z)

35 CS-352Ahmed Ezzat 35 Simplification Theorems (1) XY + XY’ = X(X + Y)(X + Y’) = X X + XY = XX(X + Y) = X (X + Y’) Y = XYXY’ + Y = X + Y

36 CS-352Ahmed Ezzat 36 Simplification Theorems (2)

37 CS-352Ahmed Ezzat 37 Multiplying Out and Factoring (1) Multiply Out (Sum Of Products): An expression is said to be in sum-of- products form when all products are the products of single variables only. The distributive laws are used to multiply out an expression to obtain a sum- of-products form. Applying 2 nd Distributive law [ (X + YZ) = (X + Y)(X + Z) ] first, when applicable, can reduce the amount of work required to arrive at a simplified sum-of-products form. Example: AB + AC + CD' + E is a sum of products A(B+C) + CD + E' is not a sum of products Multiplying out is a technique that is simpler than traditional multiplication of the given expression

38 CS-352Ahmed Ezzat 38 Multiplying Out and Factoring (2) Multiplying out:(A + BC)(A + D + E) Assume X = A, Y = BC, Z = D + E Then (X + Y)(X + Z) = X + YZ  A + BC(D + E) = A + BCD + BCE Traditional Multiplication Alternative: (A + BC)(A + D + E) = A + AD + AE + ABC + BCD + BCE = A(1 + D + E + BC) + BCD + BCE = A + BCD + BCE Multiplying out: AB'(C + D) + (C + D)' Assume X = AB’ Y = (C + D)’ and using XY’ + Y = X + Y Then: AB'(C + D) + (C + D)' = XY’ + Y  X + Y = AB' + (C + D)'

39 CS-352Ahmed Ezzat 39 Multiplying Out and Factoring (3) Multiplying out: (A + B)(B + C)(B + D')(ACD' + E) = (A + B)(B + CD')(ACD' + E) by D2 = (B + ACD')(ACD' + E) by D2 = ACD' + BE by D2 Multiplying out: (A + B')(A + D' + C)(A + D' + B) = (A + B')(A + D' + BC) by D2 = A + B'(D' + BC) by D2 = A + B'D' by D1 Factoring (Product-of-Sums): A + B’CD Assume: X = A, Y = B’, Z = CD = (X +YZ) = (X + Y)(X + Z) = (A + B’)(A + CD) = (A + B’)(A + C)(A + D)

40 CS-352Ahmed Ezzat 40 Multiplying Out and Factoring (4) Factoring: ABC + A'B'C + CD' = C(AB + A'B') + CD' by D1 = C(AB + A'B' + D') by D1 = C((AB + A')(AB + B') + D') by D2 = C((A + A')(B + A')(A + B')(B + B') + D') by D2 = C((B + A')(A + B') + D') by D2 = C(B + A'+ D')(A + B'+ D') by D2

41 CS-352Ahmed Ezzat 41 Multiplying Out and Factoring (5) Factoring: ABC + A'B'C = C(AB + A'B') by D1 = C((AB + A')(AB + B')) by D2 = C( (A' + A) (A' + B) (B' + B)(B' + A) ) by D2 = C(A' + B)(B' + A)

42 CS-352Ahmed Ezzat 42 Multiplying Out and Factoring (6) Factoring: C’D + C’E’ + G’H = C’(D + E’) + G’H by D1 = (C’ + G’H)(D + E’ + G’H) by D2 = (C’ + G’)(C’ + H)(D + E’ + G’)(D + E’ + H) by D2

43 CS-352Ahmed Ezzat 43 DeMorgan’s Laws (1) DeMorgan's laws: the inverse or complement of any Boolean expression can be found by successively applying the following theorems: (X + Y)' = X'Y' (XY)' = X'+ Y' DeMorgan's laws are generalized as follows: (X 1 + X 2 + X 3 +... + X n )' = X 1 'X 2 'X 3 '... X n ' (X 1 X 2 X 3... X n )' = X 1 '+ X 2 '+ X 3 '+... + X n '

44 CS-352Ahmed Ezzat 44 DeMorgan’s Laws (2) Method: Replace each variable with its complement. Replace 0 with 1 and 1 with 0. Replace OR with AND and AND with OR. Note: ANDing takes precedence over ORing. Use parentheses to preserve operation hierarchy in the complemented expression.

45 CS-352Ahmed Ezzat 45 DeMorgan’s Laws (3) Example: [(a'b + 1)(cd + e') + f(g'+ 0) + h]' = ([a'b + 1]' + [cd + e']') * ([f(g'+ 0)]') * (h') = ([a'b]'0 + [cd]'e) (f'+ [g'+ 0]') h' = ((a + b')0 + (c'+ d')e)(f' + g1)h'

46 CS-352Ahmed Ezzat 46 DeMorgan’s Laws (4) [(A’ + B)C’]’ = [(A’ + B)’ + C] = AB’ + C [(AB’ + C)D’ + E]’ = [(AB’ + C)’ + D] E’ = [(AB’)’ C’ + D]E’ = [(A’ + B)C’ + D]E’ [A’B + AB’]’ = (A’B)’ (AB’)’ = (A + B’)(A’ + B) = AA’ + AB + A’B’ + BB’ = AB + A’B’

47 CS-352Ahmed Ezzat 47


Download ppt "1 CS 352 Introduction to Logic Design Lecture 1 Ahmed Ezzat Number Systems and Boolean Algebra, Ch-1 + Ch-2."

Similar presentations


Ads by Google