lecture2-ch2

lecture2-ch2 - SPECIFICATION OF COMBINATIONAL SYSTEMS 1...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: SPECIFICATION OF COMBINATIONAL SYSTEMS 1 High-level and binary-level speci cations. Representation of data elements (signal values) by binary variables (signals) and standard codes for positive integers and characters. Representation by switching functions and switching expressions. not, and, or, nor, xor, and xnor switching functions and their representation. Gate symbols. Transformation of switching expressions using the switching algebra. Use of various speci cation methods Use of the vhdl description language. Introduction to Digital Systems 2 { Speci cation of Combinational Systems Combinational System 2 z (t) = F (x(t)) or z = F (x) x z Time t Figure 2.1: Introduction to Digital Systems Combinational system. 2 { Speci cation of Combinational Systems Binary level 3 z b = Fb(xb) High-level specification F x Coding C xb Binary specification n Figure 2.2: Introduction to Digital Systems Fb zb Decoding z D m High-level and binary-level speci cation. 2 { Speci cation of Combinational Systems Example 2.1: Input: Output: 4 x 2 f0; 1; 2; 3; 4; 5; 6; 7; 8; 9g z 2 f0; 1; 2g Function: F is described by the following table x 0123456789 z = F (x) 0 1 2 0 1 2 0 1 2 0 or by the arithmetic expression z = x mod 3, x xb = C (x) 0 1 2 3 4 5 6 7 8 9 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 zb 00 01 10 z = D(z b) 0 1 2 Input: xb = (x3; x2; x1; x0); xi 2 f0; 1g Output: z b = (z1; z0); zi 2 f0; 1g Function: Fb is described by the following table xb z b = Fb (xb ) Introduction to Digital Systems 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 00 01 10 00 01 10 00 01 10 00 2 { Speci cation of Combinational Systems High-level speci cation 5 The set of values for the input, input set; The set of values for the output, output set; and The speci cation of the input-output function. Introduction to Digital Systems 2 { Speci cation of Combinational Systems Input and output sets fup; ; down ; left right ; 6 g fire fx j (5 x 104) and (x mod 3 = 0)g Examples of vectors Vector type Digit x = (xn 1 ; xn 2; : : :; x0) xi 2 f0; 1; 2; : : :; 9g Character c = (cn 1; cn 2; : : :; c0) Set Bit Introduction to Digital Systems Example x = (7; 0; 6; 3) c = (B; O; O; K ) ci 2 f ; A; B; : : :; Z g s = (sn 1; sn 2; : : :; s0) s = (red; blue; blue) si 2 fred; blue; whiteg y = (yn 1 ; yn 2; : : :; y0) y = (1; 1; 0; 1; 0; 0) yi 2 f0; 1g y = 110100 2 { Speci cation of Combinational Systems Input-output function 1. Table 7 xz A B C D E 65 66 67 68 69 2. Arithmetic expression z = 3x + 2y 2 3. Conditional expression 8 > > > < > > > : a+b z= a b 0 Introduction to Digital Systems if if if c>d c=d c<d 2 { Speci cation of Combinational Systems Input-output function (cont.) 8 4. Logical expression z = (switch1 = closed ) and ( switch2 = open ) or ( switch3 = closed) 5. Composition of simpler functions greater: (v; w; x; y) = greater(v; greater(w; greater(x; y))) max in which (a; b) = a if a > b b otherwise greater Introduction to Digital Systems 8 > < > : 2 { Speci cation of Combinational Systems Example 2.2 9 x = (x3; x2; x1; x0), xi 2 fA; B; : : : ; Z; a; b; : : : ; zg y 2 fA; B; : : : ; Z; a; b; : : : ; zg k 2 f0; 1; 2; 3g Outputs: z = (z3; z2; z1; z0), zi 2 fA; B; : : : ; Z; a; b; : : : ; zg Inputs: 8 > < > : Function: zj = xj if j 6= k y if j = k Input: x = (c,a,s,e) , y = r , k = 1 Output: z = (c,a,r,e) Introduction to Digital Systems 2 { Speci cation of Combinational Systems Data representation and coding fAl; Al Bert Dave Jerry Len Introduction to Digital Systems Bert ; Dave ; Jerry ; 10 g Len Fixed-length Variable-length Code 1 Code 2 Code 3 000 0110 01 010 0101 001 100 0011 0001 110 1001 00001 111 1111 000001 2 { Speci cation of Combinational Systems Alphanumeric Codes 11 Codes Character ASCII EBCDIC A 100 0001 1100 0001 B 100 0010 1100 0010 C 100 0011 1100 0011 .. .. .. Y 101 1001 1110 1000 Z 101 1010 1110 1001 0 011 0000 1111 0000 1 011 0001 1111 0001 2 011 0010 1111 0010 .. .. .. 8 011 1000 1111 1000 9 011 1001 1111 1001 blank 010 0000 0100 0000 . 010 1110 0100 1011 ( 010 1000 0100 1101 + 010 1011 0100 1110 ... ... ... A blank C A B . 01000001 00100000 01000011 01000001 01000010 00101110 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Representation of positive integers 12 Level 1: integer () digit-vector Level 2: digits () bit-vector Level 1: Integer (Digit-vector) 5 6 3 0 Level 2: Bit-vector 1 0 1 1 1 0 0 1 1 0 0 0 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Representation by digit-vector 13 x = (xn 1; xn 2; : : : ; x1; x0) nX1 i x = i=0 xir digit xi in f0; 1; : : : ; r 1g, r { the radix () x = (1; 0; 0; 1; 0; 1) 1 25 + 0 24 + 0 23 + 1 22 + 0 21 + 1 20 = (37)10 Set of representable values 0 x rn 1 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Example of Binary Codes 14 Binary Quaternary Octal Hexadecimal Digit Value (Symbol) k = 1 k=2 k=3 k=4 0 1 2 3 4 5 6 7 8 9 10 (A) 11 (B) 12 (C) 13 (D) 14 (E) 15 (F) Introduction to Digital Systems d 0 0 1 dd 1 00 01 10 11 0 ddd 2 1 000 001 010 011 100 101 110 111 0 dddd 3 2 1 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 0 2 { Speci cation of Combinational Systems Binary-code representation of a digit-vector 5 6 3 15 0 101110011000 a) Gray code. b) Gray-code bit-vector representation of a digit-vector. Digit Gray code 0 000 1 001 4 5 3 0 2 011 3 010 4 110 110111010000 5 111 6 101 7 100 (b) (a) Introduction to Digital Systems 2 { Speci cation of Combinational Systems Codes for Decimal Digits Digit Value 0 1 2 3 4 5 6 7 8 9 Introduction to Digital Systems BCD 8421 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 16 2421 Excess-3 2-Out-of-5 0000 0011 00011 0001 0100 11000 0010 0101 10100 0011 0110 01100 0100 0111 10010 1011 1000 01010 1100 1001 00110 1101 1010 10001 1110 1011 01001 1111 1100 00101 2 { Speci cation of Combinational Systems Binary-level speci cation of C - systems 17 Switching functions f0; 1g3 xn xn x1 x0 1 2 - Combinational system z z -m -m - (a) Figure 2.3: Introduction to Digital Systems - f0; 1g 000XXXX XXX z 0 001@ > 010Z@@ Z@ 011HHZZ@ HHZ@ 100 ZR HH@ ~ Z j H 101 :1 110 111 1 2 z1 z0 a) Binary combinational system; b) a switching function for n = 3 (b) 2 { Speci cation of Combinational Systems Tabular representation of switching functions 18 n-tuple notation Simpli ed notation x2x1x0 f (x2 ; x1; x0) j f (j ) 000 001 010 011 100 101 110 111 0 0 1 1 0 0 1 1 0 1 2 3 4 5 6 7 0 0 1 1 0 0 1 1 x2 x1 x0 x4x3 000 001 010 011 100 101 110 111 00 01 10 11 Introduction to Digital Systems 0 0 1 0 0 1 1 1 1 1 0 0 1 1 1 1 f 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 2 { Speci cation of Combinational Systems Important switching functions 19 Table 2.10: Switching functions of one variable f 0 f 1 f 2 f 3 0-CONSTANT IDENTITY COMPLEMENT 1-CONSTANT x (always 0) (equal to x) (NOT) (always 1) 0 0 0 1 1 1 0 1 0 1 Introduction to Digital Systems 2 { Speci cation of Combinational Systems 20 Table 2.11: Switching functions of two variables Function 00 f0 0 f1 0 f2 0 f3 0 f4 0 f5 0 f6 0 f7 0 f8 1 f9 1 f10 1 f11 1 f12 1 f13 1 f14 1 f15 1 Introduction to Digital Systems xx 1 01 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 10 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 11 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 and exclusive-or (xor) or nor equivalence (equ) nand 2 { Speci cation of Combinational Systems Incomplete switching functions xyz 000 001 010 011 100 101 110 111 21 f 0 1 0 { 1 0 { 1 or one-set(1,4,7), zero-set(0,2,5) ] one-set(1,4,7), dc-set(3,6) ] zero-set(0,2,5), dc-set(3,6) ] Introduction to Digital Systems 2 { Speci cation of Combinational Systems Composition of switching functions 22 and(x3 ; x2; x1 ; x0) = and(and(x3 ; x2); and(x1 ; x0)) xor(x1 ; x0) = or(and(not(x0 ); x1 ); and(x0 ; not(x1 ))) maj(x3 ; x2; x1 ; x0) = or(and(x3 ; x2; x1); and(x3; x2 ; x0); and(x3 ; x1 ; x0); and(x2 ; x1; x0)) Introduction to Digital Systems 2 { Speci cation of Combinational Systems Switching expressions 23 1. The symbols 0 and 1 are SEs. 2. A symbol representing a binary variable is a SE. 3. If A and B are SEs, then (A) is a SE. This is referred to as \A complement." Sometimes we use A to denote complementation. (A) (B ) is a SE. This is referred as \A or B "; it is also called \A plus B " or \sum" due to the similarity with the corresponding arithmetic symbol. (A) (B ) is a SE. This is referred to as \A and B "; it is also called \A times B " or \product" due to the similarity with the corresponding arithmetic symbol. 0 Precedence rules: 0 precedes which precedes Well-formed switching expressions are: x 0 x xx 1 2 0 3 1 0(x y ) whereas (x1 x2 )x3 and \This is a switching expression" are not. 0 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Switching algebra and expression evaluation Switching algebra: two elements 0 and 1 operations , , and 0 01 0 01 1 11 01 000 101 24 0 01 10 E (x2; x1; x0) = x2 x02x1 x1x00 The value of E for assignment (1; 0; 1) is E (1; 0; 1) = 1 10 0 0 10 = 1 0 0 = 1 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Representing switching functions by switching expressions 25 E (x2; x1; x0) = x2 x02x1 x1x00 represents f : x2x1x0 f 000 001 010 011 100 101 110 111 2 variables and x1x0 or x1 x0 xor x1x00 x01x0 = x1 equiv x01x00 x1x0 nand (x1 x0)0 = x01 x00 nor (x1 x0)0 = x01x00 Introduction to Digital Systems x0 0 0 1 1 1 1 1 1 n variables xn 1xn 2 : : :x0 xn 1 xn 2 : : : x0 (xn 1 xn 2 : : :x0)0 = x0n 1 x0n 2 : : : x00 (xn 1 xn 2 : : : x0)0 = x0n 1x0n 2 : : :x00 2 { Speci cation of Combinational Systems Switching functions and gates Introduction to Digital Systems 26 2 { Speci cation of Combinational Systems 27 Gate type NOT Symbol x or x AND OR NAND NOR XOR XNOR z z = x’ z x1 z x1 x0 x1 x0 x1 x0 z = x 1x ’ + x ’ x 0 0 1 = x1 + x0 z x0 z = ( x 1+ x 0 )’ z x1 z = ( x 1 x 0 )’ z x0 z = x 1+ x 0 z x1 z = x1x0 z x0 Figure 2.4: Introduction to Digital Systems Switching expression z = x1 x ’ + x 1x 0 ’0 Gate symbols 2 { Speci cation of Combinational Systems 28 Symbol Gate type AND x n-1 x n-2 Switching expression z = x n-1 x n-2 .... x 0 z x0 OR x n-1 x n-2 x0 Figure 2.5: Introduction to Digital Systems z z = x n-1 + x n-2 ....+x 0 n-input and and or gate symbols 2 { Speci cation of Combinational Systems Equivalent switching expressions 29 W and Z switching expressions are equivalent W = x1x0 x01 Z = x01 x0 The corresponding switching functions are x1 x0 W Z 00 01 10 11 Introduction to Digital Systems 1 1 0 1 1 1 0 1 2 { Speci cation of Combinational Systems Equivalence Classes Set of switching functions 30 Set of switching expressions Equivalent expressions Figure 2.6: Introduction to Digital Systems Correspondence among switching functions and switching expressions 2 { Speci cation of Combinational Systems Algebraic method of obtaining equivalent expressions 31 The principal identities of Boolean algebra 1. a b =b a ab 2. a (bc) = (a b)(a c) a(b c) 3. a (b c) = (a b) c a(bc) =a b c 4. a a =a aa 5. a a =1 aa 6. 1 a =1 0a 7. 0 a =a 1a 8. (a ) = a 9. a ab = a a(a b) 10. a ab =a b a(a b) 11. (a b) = a b (ab) 0 0 = ba = (ab) (ac) = (ab)c = abc =a =0 =0 =a 00 0 0 0 Introduction to Digital Systems 0 0 0 =a = ab =a b 0 0 Commutativity Distributivity Associativity Idempotency Complement Identity Involution Absorption Simpli cation DeMorgan's Law 2 { Speci cation of Combinational Systems Example 32 Show that E1 and E2 are equivalent: E1(x2; x1; x0) = x2x1 x2x01 x2x0 E2(x2; x1; x0) = x2 x x x x x x = x (x x ) x x =x 1 x x = x (1 x ) =x 1 =x 2 1 2 0 1 2 0 2 0 1 2 2 2 2 Introduction to Digital Systems 2 1 2 0 0 0 using ab ac = a(b c) using a a = 1 using ab ac = a(b c) using 1 a = 1 using a 1 = a 0 2 { Speci cation of Combinational Systems Sum of products and sum of minterms 33 Literals x, y, z , x Product terms x0, x2x1, x3x1 x0 Sum of products x2 x3x1 x3x1x0 0 0 0 0 x0 0 x3 x1 0 0 z = x 3 x 1x’0 (a) x’2 x2 x3 x1 x1 x0 z = x’2 + x’3x 1 + x’3x’1x 0 x’3x 1 x’3x’1x 0 (b) Figure 2.7: Sum of products and and-or gate network: a) Product term. b) Sum of products. Introduction to Digital Systems 2 { Speci cation of Combinational Systems Minterm notation Minterm mj , j integer 34 x0i ! 0 xi ! 1; Example: minterm x3x02x01x0 denoted m9 because 1001 = 9 8 > < > : mj (a) = 1 0 if a = j otherwise n1 a = iX ai2i =0 Example: m11 = x3x02x1x0 { has value 1 only for a = (1; 0; 1; 1) Introduction to Digital Systems 2 { Speci cation of Combinational Systems Minterm functions xxx 2 1 0 m m m m m m m m xxx xxx xxx xxx xxx xxx xxx xxx 0 0 000 001 010 011 100 101 110 111 35 2 0 1 1 0 0 0 0 0 0 0 Introduction to Digital Systems 1 0 0 0 2 0 1 0 1 0 0 0 0 0 0 2 0 0 2 1 0 0 1 0 0 0 0 0 3 0 0 0 2 1 0 0 0 1 0 0 0 0 4 0 2 0 1 0 0 0 0 1 0 0 0 5 0 0 2 0 1 0 0 0 0 0 1 0 0 6 0 2 1 0 0 0 0 0 0 1 0 7 0 0 2 1 0 0 0 0 0 0 0 1 0 2 { Speci cation of Combinational Systems Example x1 x2 36 m1 x0 x0 x1 x2 x1 Figure 2.8: Introduction to Digital Systems m2 z =Σ m(1,2,6) m6 Gate network corresponding to E (x2; x1 ; x0) = P m(1; 2; 6). 2 { Speci cation of Combinational Systems Example 2.12: Table ! sum of minterms j x2 x1 x0 0 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 37 f 0 0 1 1 0 1 0 0 E = X m(2; 3; 5) = x02x1x00 x02x1x0 x2x01x0 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Product of sums and product of maxterms 38 Sum terms x0, x2 x1, x3 x1 x00 Product of sums (x02 x3 x01)(x03 x1)x0 x4 x2 z = x 4 + x’2 + x 1 x1 (a) x3 x2 x1 x’3+ x’2 + x 1 z = x 0( x 2 + x’3 )( x’3+ x’2 + x 1) x2 x0 x 2 + x’3 Figure 2.9: Introduction to Digital Systems (b) Product of sums and or-and gate network. a) Sum term. b) Product of sums. 2 { Speci cation of Combinational Systems Maxterm Notation xi ! 0; Maxterm Mj , j integer 39 x0i ! 1 Example: maxterm x3 x02 x1 x00 denoted M5 because 0101 = 5 8 > < > : Mj (a) = 0 if a = j 1 otherwise Example: M5 = x3 x02 x1 x00 { has value 0 only for assignment 0101 Introduction to Digital Systems 2 { Speci cation of Combinational Systems 40 x1 x2 x0 M0 x2 x0 M5 x1 z = Π M(0,5,6) x1 x0 M6 Figure 2.10: Introduction to Digital Systems Q Gate network corresponding to E (x2; x1; x0 ) = M (0; 5; 6). 2 { Speci cation of Combinational Systems Example 2.15: Table ! product of sums j 0 1 2 3 4 5 6 7 x2 x1 x0 000 001 010 011 100 101 110 111 41 f 0 1 1 0 0 0 1 0 E (x2; x1; x0) = Q M (0; 3; 4; 5; 7) = (x2 x1 x0)(x2 x01 x00)(x02 x1 x0) (x02 x1 x00)(x02 x01 x00) Introduction to Digital Systems 2 { Speci cation of Combinational Systems Conversion among canonical forms 42 Sum of minterms ! one-set Product of maxterms ! zero-set ) conversion straightforward X m(fj j f (j ) = 1g) = Y M (fj j f (j ) = 0g) Example: m-notation: M -notation: Introduction to Digital Systems f (x; y; z ) = X m(0; 4; 7) f (x; y; z ) = Y M (1; 2; 3; 5; 6) 2 { Speci cation of Combinational Systems Example 2.19: Radix-4 Comparator 43 Inputs: x; y 2 f0; 1; 2; 3g Output: z 2 fG,E,Sg 8 > > > < > > > : G if x > y Function: z = E if x = y S if x < y y 0 1 x2 3 Introduction to Digital Systems 0 E G G G 1 S E G G z 2 S S E G 3 S S S E 2 { Speci cation of Combinational Systems Example 2.19 (cont.) 44 Coding: x = 2x1 + x0 and y = 2y1 + y0 z z2z1z0 G 100 E 010 S 001 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Binary speci cation: 8 > < > : 8 > < > : 8 > < > : 1 z2 = 0 z1 = 1 0 1 z0 = 0 45 if x1 > y1 or (x1 = y1 and x0 > y0) otherwise if x1 = y1 and x0 = y0 otherwise if x1 < y1 or (x1 = y1 and x0 < y0) otherwise y1 y0 x1x0 00 01 10 11 00 01 10 11 Introduction to Digital Systems 010 100 100 100 001 010 100 100 001 001 010 100 z2z1z0 001 001 001 010 2 { Speci cation of Combinational Systems Example 2.19 (cont) 46 Switching expressions: z2(x1; x0; y1; y0) = X m(4; 8; 9; 12; 13; 14) z1(x1; x0; y1; y0) = X m(0; 5; 10; 15) z0(x1; x0; y1; y0) = X m(1; 2; 3; 6; 7; 11) Introduction to Digital Systems 2 { Speci cation of Combinational Systems ...
View Full Document

This note was uploaded on 10/07/2011 for the course CS m51 taught by Professor Staff during the Spring '11 term at UCLA.

Ask a homework question - tutors are online