Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECA1212 Introduction to Electrical & Electronics Engineering Chapter 8: Digital Electronics – Combinational Logic by Muhazam Mustapha, November 2011.

Similar presentations


Presentation on theme: "ECA1212 Introduction to Electrical & Electronics Engineering Chapter 8: Digital Electronics – Combinational Logic by Muhazam Mustapha, November 2011."— Presentation transcript:

1 ECA1212 Introduction to Electrical & Electronics Engineering Chapter 8: Digital Electronics – Combinational Logic by Muhazam Mustapha, November 2011

2 Learning Outcome By the end of this chapter, students are expected to understand binary number concepts Boolean algebra and minimization

3 Chapter Content Motivation Number Systems Negative Numbers
Boolean Algebra Gates Karnaugh Map

4 Motivations CO3

5 Definition & Nature Field of electronics that represents signals by DISCRETE bands of analog levels, rather than by a continuous range Work of digital electronics: estimates analog values as numbers (binary) math is more in boolean and integer mode deals more with algorithms and timing Opposite: Analog electronics represents signals as continuous range works on manipulating signal shape math is real valued and may involve calculus deals more with transfer functions and models CO3

6 Definition & Nature Digital amplifier Analog amplifier DSP Analog view
32 bits 32 bits Analog view Digital view F X X F Y Y CO3

7 Number Systems CO3

8 Binary System (Base-2) Binary (short as ‘bin’) system is the positional number system that uses only 2 symbols (b): 0 and 1 (N = 2) ...b3b2b1b0 . b−1b−2b−3... Number value = b3×23 + b2×22 + b1×21 + b0×20 + b−1×2−1 + b−2×2−2 + b−3×2− For binary system, bn, which is either 0 or 1, is also called BIT The above formula is used to get the decimal (base-10) values from non-base-10 numbers CO3

9 Octal & Hexadecimal Base-2 (binary) is too small which makes the number tends to be very long Larger bases are needed so that the number is shorter and more handy Octal (short as ‘oct’) numbers are base-8, using 8 symbols: 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal (short as ‘hex’) numbers are base-16, using 16 symbols (10 digits and 6 first alphabets either lower or upper case): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F CO3

10 Oct & Hex to Dec Conversion
Similar conversion rule as bin to dec (short for decimal) applies Octal: ...d3d2d1d0 . d−1d−2d−3... Number value = d3×83 + d2×82 + d1×81 + d0×80 + d−1×8−1 + d−2×8−2 + d−3×8− Hexadecimal: ...d3d2d1d0 . d−1d−2d−3... Number value = d3×163 + d2×162 + d1×161 + d0×160 + d−1×16−1 + d−2×16−2 + d−3×16− CO3

11 Conversion from Dec (Integer)
If the dec number has fraction part, we have to split it into integer and fraction To convert from integer dec, M, to any base do the following algorithm: DIVIDE the integer M with the base (N) Keep the REMAINDER of the division (in sequence) – these are the digits of the base-N number Also keep the integer value of the division – this will be the new value of M If M is more than 0, repeat step 1-4 The base-N number is the remainders kept in step 2 written from the last one to the first one (reversed) CO3

12 Conversion from Dec (Integer)
Example: Convert 62 dec to bin Remainder 2 62 2 31 1 2 15 1 6210 = 2 7 1 2 3 1 2 1 1 Try yourself to convert 62 dec to oct and hex CO3

13 Conversion from Dec (Fraction)
To convert from dec fraction, m, to any base do the following algorithm: MULTIPLY the fraction m with the base (N) Keep and remove the INTEGER PART of the multiplication (in sequence) – these are the digits of the base-N number Also keep the fraction value of the multiplication – this will be the new value of m If m is more than 0, repeat step 1-4, or continue to step 5 until the required no. fraction digits are obtained The base-N number is the integer parts kept in step 2 written from the first one to the last one (in order) CO3

14 Conversion from Dec (Fraction)
Example: Convert 0.62 dec to bin Integer Part = 2 × 0.62 = 2 × 0.24 = 2 × 0.48 = = 2 × 0.96 = 2 × 0.92 = 2 × 0.84 Try yourself to convert 0.62 dec to oct and hex CO3

15 Bin, Oct & Hex Conversions
Groups mapping: Bin Hex 0000 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 8 1001 9 1010 A 1011 B 1100 C 1101 D 1110 E 1111 F Bin Oct 000 001 1 010 2 011 3 100 4 101 5 110 6 111 7 CO3

16 Bin, Oct & Hex Conversions
Example: Convert bin to oct and hex = 15138 1 5 1 3 = 34B16 3 4 B CO3

17 Bin, Oct & Hex Conversions
Example: Convert 526 oct to bin 5268 5268 = Example: Convert 52C hex to bin 52C16 52C16 = CO3

18 Negative Numbers CO3

19 Representing Negative Number
For our course we will only consider integer negative numbers Sign-magnitude representation: the magnitude is represented like positive number the sign will be kept as 1 bit flag straight-forward but requires more circuit Complement method: less direct but results in simpler circuit we will study complement methods for bin numbers – 1’s and 2’s complement there are complement methods for dec numbers – 9’s and 10’s complement, but we won’t go into details CO3

20 Motivation In digital processing we will be doing a lot of binary arithmetic Most of the arithmetic will be additive (addition or subtraction) because multiplicative arithmetic can always be converted to additive ones The motivation to have complement method in binary numbers is to convert subtraction into addition so that both operations (and all operations) can homogeneously handled as one type of operation CO3

21 1’s and 2’s Complement 1’s and 2’s complements (comp) are negative number representation for binary numbers The size of the number must be known The negative number (1’s or 2’s comp) is then indicated by a 1 in the MSB (most significant bit) 1’s complement is constructed by: toggling (change 1 to 0, or 0 to 1) each bit in the number there will be 2 ways to represent 0 (zero): – positive zero, or – negative (1’s comp) zero CO3

22 1’s and 2’s Complement 2’s complement is constructed by:
Constructing the 1’s complement, then Add 1 to the result Differences from 1’s comp: there is only 1 way to represent zero: zero is considered positive since the MSB is 0 the number with only MSB as 1 and the rest is zero ( ) is the largest negative number that has NO matching positive number (check for yourself why) CO3

23 1’s and 2’s Complement 4 bits 1’s and 2’s comp: CO3 1’s comp Dec 0000
0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 −7 1001 −6 1010 −5 1011 −4 1100 −3 1101 −2 1110 −1 1111 −0 2’s comp Dec 0000 0001 1 0010 2 0011 3 0100 4 0101 5 0110 6 0111 7 1000 −8 1001 −7 1010 −6 1011 −5 1100 −4 1101 −3 1110 −2 1111 −1 CO3

24 1’s and 2’s Complement Example: Compute 53 dec 1’s and 2’s comp for bin number of 8 bits long 53 dec = bin −53 dec = − bin = ’s comp = ’s comp Example: Compute the following 1’s and 2’s comp numbers’ sign-magnitude dec ’s comp = bin = -100 dec ’s comp = ’s comp = bin = -811 dec CO3

25 2’s Comp Arithmetic We shall cover only 2’s complement arithmetic
Take place only when it involves SUBTRACTION or NEGATIVE numbers Represent any negative number with the corresponding 2’s comp Replace subtraction with addition of its negative Subtraction of 2’s complement is the addition with the corresponding positive number CO3

26 2’s Comp Arithmetic Both addition and subtraction are performed as ADDITION Even though the MSB can be considered as sign flag, but the addition is done disregarding that fact, i.e. MSB is involved in the addition Ignore any carry beyond MSB: OVERFLOW happens when addition of 2 positive numbers results in a negative number UNDERFLOW happens when addition of 2 negative numbers results in a positive number CO3

27 2’s Comp Arithmetic 2’s comp example:
−3−2 dec = −0011−0010 bin = bin = bin = −5 dec 5+5 dec = bin = bin = −6 dec ⇒ wrong answer due to overflow overflow indication CO3

28 Boolean Algebra CO3

29 Definition Boolean algebra has 2 similar but different definitions for mathematician and engineers Mathematician: Boolean algebra is part of the so called abstract mathematics that involves structures and lattice Wikipedia: Engineers: Boolean algebra is calculus of truth values that is used as a means to facilitate the design of logic and digital systems Wikipedia: CO3

30 Boolean Values Boolean expressions represent the 2 levels of binary system in the digital systems In real digital systems the levels can be ON/OFF states, LOW/HIGH voltage levels In Boolean expressions the levels (values) are TRUE/FALSE or 1/0 1 HIGH LOW True False ON OFF CO3

31 Boolean Operation Boolean algebra has 3 fundamental operations: AND, OR, NOT (also called inverter) AND: Operates on 2 operands Gives true (1) if both operands are true Symbol: ‘·’ (dot) - optional Example: Assume A = True, B = False Then A AND B = False Written as: A·B = AB = False = 0 CO3

32 Boolean Operation OR: Example: Operates on 2 operands
Gives true (1) if either or both operands are true Symbol: ‘+’ Example: Assume A = True, B = False Then A OR B = True Written as: A+B = True = 1 CO3

33 Boolean Operation NOT: Example: Operates on 1 operand
Gives 1 if the operand is 0, otherwise it gives 0 symbol: ‘‾’ (bar / overline) Example: Assume A = True Then NOT A = False Written as: A = False = 0 CO3

34 Boolean Function & Expression
Boolean Expressions: Composed of any combination of Boolean variables and operations Example: Boolean Functions: Function with Boolean values and defined by Boolean valued variables (parameters) Example: Function f of a, b and c CO3

35 Truth Table Since Boolean functions are Boolean valued, and composed of Boolean valued parameters, all possible values of the function with respect to all possible combinations of the parameter can be listed in a table Such a table is called Truth Table Truth table is a way to define a Boolean function that is not available in other mathematical functions – truth table can be applied to Boolean functions only CO3

36 Truth Table Truth table of the 3 fundamental Boolean operations:
NOT OR AND A 1 A B A+B 1 A B AB 1 Truth table can also be built for any Boolean function CO3

37 Truth Table Example of step by step construction of truth table of function: A B C AC F 1 CO3

38 Boolean Expression from Truth Table
Since truth table is constructed from Boolean functions, it is also possible to construct Boolean function from a given truth table By MINTERM Sum of Product (SOP) Create minterms by AND-ing all variables where the outputs (function values) are 1 The variables that have value of 0 will be inverted The variables that have value of 1 will not be inverted The minterms will then be combined by OR operation CO3

39 Boolean Expression from Truth Table
By MAXTERM Product of Sum (POS) Create maxterms by OR-ing all variables where the outputs (function values) are 0 The variables that have value of 1 will be inverted The variables that have value of 0 will not be inverted The maxterms will then be combined by AND operation CO3

40 Boolean Expression from Truth Table
The SOP and POS of minterms and maxterm, respectively, are also called the CANONICAL form of the boolean function The form is the one with the smallest no. terms and all variables appear in each term Canonical also means ‘standard’ CO3

41 Boolean Expression from Truth Table
Minterm example: Truth Table A B C F 1 Sum of Product (SOP) short notation CO3

42 Boolean Expression from Truth Table
Maxterm example: Truth Table A B C F 1 Product of Sum (POS) short notation CO3

43 DeMorgan’s Theorem Used to split groups of large inversion CO3 A B AB
1 A B A+B AB 1 CO3

44 Other Boolean Operations
NOR OR followed by NOT A NOR B = A+B NAND AND followed by NOT A NAND B = AB XOR true if either one, but not both, is true symbol: ‘⊕’ XNOR true if both parameters are the same XOR followed by NOT symbol: ‘⊙’ CO3

45 Other Boolean Operations
NAND A B AB 1 XOR A B 1 NOR A B A+B 1 A B 1 XNOR CO3

46 Gates CO3

47 Boolean Operators as Gates
NOT A A A XOR B A AND B A A A OR B B B B A XNOR B A A NAND B A NOR B A A B B B CO3

48 Gate Tree For more general and complicated boolean functions CO3 B B+C
A(B+C) A A(B+C)+AD A D AD CO3

49 Karnaugh Map CO3

50 Karnaugh Map K-Map is a transformation of truth table into a table that arranges the terms in such a way that the adjacent terms have ONLY 1 VARIABLE CHANGE The mapping from truth table to K-map is a one-to-one mapping, but the counting sequence in K-map is changed to maintain 1 variable change between the neighboring (adjacent) box CO3

51 Karnaugh Map 1 variable truth table 1 variable K-Map
Term No. 1 A A B Term No. 1 2 3 A 1 B 1 1 2 1 3 1 A B C Term No. 1 2 3 4 5 6 7 3 variable truth table 3 variable K-Map AB C 00 01 11 10 2 6 4 1 3 7 5 1 CO3

52 Karnaugh Map AB 4 variable K-Map CD 5 variable K-Map A = 0 A = 1 BC BC
00 01 11 10 00 4 12 8 1 5 13 9 3 7 15 11 2 6 14 10 01 11 10 5 variable K-Map A = 0 A = 1 BC BC DE 00 01 11 10 DE 00 01 11 10 00 4 12 8 1 5 13 9 3 7 15 11 2 6 14 10 00 16 20 28 24 17 21 29 25 19 23 31 27 18 22 30 26 01 01 11 11 10 10 CO3

53 Karnaugh Map Example 2: Put the following function into K-map
F(A, B, C, D) = Σm(2, 3, 6, 10, 11, 12) AB CD 00 01 11 10 00 1 01 11 10 CO3

54 Implicants Implicants are coverings of the K-map that maintain adjacency in ALL of its variables 1 minterm is an implicant by itself 2 adjacent minterms can be combined to form a bigger (2-minterm) implicant This new implicant will lose the changing variable 2 adjacent implicants, with all its variables are also adjacent, can also be combined to form a yet bigger implicant This bigger implicant will lose one more changing variable CO3

55 Implicants Example 3: F(A,B,C,D)=Σm(2,3,6,10,11,12,14,15) AB AB CD CD
00 01 11 10 CD 00 01 11 10 1 1 00 00 01 01 11 11 10 10 CO3

56 Implicants An implicant that is contained entirely within another implicant can be eliminated An implicant that cannot be grown anymore is called PRIME implicant An essential prime implicant is the prime implicant that cover some area that is NOT covered by any other implicant The simplified function is the one that contains the minimum no. implicants that cover all 1-s CO3

57 Final Simplification Example 3 (continued):
F(A,B,C,D)=Σm(2,3,6,10,11,12,14,15) AB CD 00 01 11 10 1 00 01 11 10 CO3


Download ppt "ECA1212 Introduction to Electrical & Electronics Engineering Chapter 8: Digital Electronics – Combinational Logic by Muhazam Mustapha, November 2011."

Similar presentations


Ads by Google