ch2 - SPECIFICATION OF COMBINATIONAL SYSTEMS High-level and...

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 High-level and binary-level speci cations. 1 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. , , symbols. not and or nor xor , , , and xnor switching functions and their representation. Gate 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: Combinational system. Introduction to Digital Systems 2 { Speci cation of Combinational Systems Binary level 3 z b = Fb(xb) High-level specification F x Coding C xb n Binary specification Fb zb m z Decoding D Figure 2.2: High-level and binary-level speci cation. Introduction to Digital Systems 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 x 0 1 2 3 4 5 6 7 8 9 z = F (x) 0 1 2 0 1 2 0 1 2 0 or by the arithmetic expression Function: F is described by the following table 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 6 fup fx j (5 Examples of vectors down left right fire g x 104) and (x mod 3 = 0)g Example x = (7 0 6 3) Vector type Digit x = (xn;1 xn;2 : : : x0) xi 2 f0 1 2 : : : 9g Character c = (cn;1 cn;2 : : : c0) Set Bit 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 c = (B O O K ) Introduction to Digital Systems 2 { Speci cation of Combinational Systems Input-output function 1. Table 7 A B C D E 2. Arithmetic expression x z 65 66 67 68 69 z = 3x + 2y ; 2 3. Conditional expression a+b z = a;b 0 Introduction to Digital Systems 8 > > > < > > > : if if if c>d c=d c<d 2 { Speci cation of Combinational Systems Input-output function (cont.) 4. Logical expression 8 z = (switch1 = closed ) and ( switch2 = open ) or ( switch3 = closed) 5. Composition of simpler functions greater: max (v w x y) = greater(v greater greater (w greater (x y))) in which (a b) = a if a > b b otherwise 8 > < > : Introduction to Digital Systems 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: 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) 8 > < > : Introduction to Digital Systems 2 { Speci cation of Combinational Systems Data representation and coding 10 fAl Bert Dave Jerry Len g Fixed-length Variable-length Code 1 Code 2 Code 3 Al 000 0110 01 Bert 010 0101 001 Dave 100 0011 0001 Jerry 110 1001 00001 Len 111 1111 000001 Introduction to Digital Systems 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) digit xi in f0 1 : : : r ; 1g, r { the radix nX1 i ; x = i=0 xir 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 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) 14 d0 0 1 d1d0 00 01 10 11 d2d1d0 d3d2d1d0 000 001 010 011 100 101 110 111 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Binary-code representation of a digit-vector 15 5 6 3 0 1 0 1 1 1 0 0 1 1 0 0 0 Introduction to Digital Systems 2 { Speci cation of Combinational Systems 4-bit Gray code Digit Gray code 0 0000 1 0001 2 0011 3 0010 4 0110 5 0111 6 0101 7 0100 8 1100 9 1101 10 1111 11 1110 12 1010 13 1011 14 1001 15 1000 Introduction to Digital Systems 16 2 { Speci cation of Combinational Systems Gray-code bit-vector representation of a digit-vector 17 9 8 7 6 1 1 0 1 1 1 0 0 0 1 0 0 0 1 0 1 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Codes for Decimal Digits 18 Digit Value 0 1 2 3 4 5 6 7 8 9 BCD 8421 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 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 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Binary-level speci cation of C - systems Switching functions 19 xn;1 xn;2 x1 x0 - Combinational system -zm;1 -zm;2 - z1 - z0 - f0 1g f0 1g3 000XXXX XXX z0 001@ > 010Z@@ Z 011HHZ@@ HZZ@ HHZ@ 100 HR ~ Z j H1 101 : 110 111 (a) Figure 2.7: a) Binary combinational system b) a switching function for n = 3 (b) Introduction to Digital Systems 2 { Speci cation of Combinational Systems Tabular representation of switching functions 20 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 x4x3 000 001 010 011 100 101 110 111 00 01 10 11 0 0 1 0 0 1 1 1 1 1 0 0 1 1 1 1 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 x2x1x0 f Introduction to Digital Systems 2 { Speci cation of Combinational Systems Important switching functions 21 Table 2.4: Switching functions of one variable 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 f0 f1 f2 f3 Introduction to Digital Systems 2 { Speci cation of Combinational Systems 22 Table 2.5: 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 01 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 x1x0 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 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Incomplete switching functions 23 xyz 000 001 010 011 100 101 110 111 or f 0 1 0 { 1 0 { 1 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 24 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 25 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: precedes which precedes 0 Well-formed switching expressions are: x0 whereas (x1 0 x1 x2x3 0 1 0(x y ) x2 )x3 and \This is a switching expression" are not. 2 { Speci cation of Combinational Systems Introduction to Digital Systems Switching algebra and expression evaluation 26 Switching algebra: two elements 0 and 1 operations , , and 0 0 1 0 0 1 1 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 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 27 E (x2 x1 x0) = x2 x02x1 x1x00 represents f : x2x1x0 f 000 001 010 011 100 101 110 111 0 0 1 1 1 1 1 1 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 2 variables x0 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 28 Gate type NOT Symbol Switching expression x x x1 x0 x1 x0 x1 x0 x1 x0 x1 x0 x1 x0 or z z z z = x' AND z = x1x0 OR z z = x 1+ x 0 NAND z z = ( x 1 x 0 )' NOR z z = ( x 1+ x 0 )' XOR z z = x 1x ' + x ' x 0 0 1 = x1 + x0 z = x1 x ' + x 1x 0 ' 0 XNOR z Figure 2.8: Gate symbols 2 { Speci cation of Combinational Systems Introduction to Digital Systems 29 Gate type Symbol Switching expression AND x n-1 x n-2 x0 x n-1 x n-2 z z = x n-1 x n-2 .... x 0 OR z x0 Figure 2.9: z = x n-1 + x n-2 ....+x 0 n-input and and or gate symbols Introduction to Digital Systems 2 { Speci cation of Combinational Systems Equivalent switching expressions 30 W and Z switching expressions are equivalent W = x1x0 x01 Z = x01 x0 The corresponding switching functions are x1x0 W Z 00 01 10 11 1 1 0 1 1 1 0 1 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Equivalence Classes 31 Set of switching functions Set of switching expressions Equivalent expressions Figure 2.10: Correspondence among switching functions and switching expressions Introduction to Digital Systems 2 { Speci cation of Combinational Systems Algebraic method of obtaining equivalent expressions The principal identities of Boolean algebra 1. a b =b a ab = ba 2. a (bc) = (a b)(a c) a(b c) = (ab) (ac) 3. a (b c) = (a b) c a(bc) = (ab)c =a b c = abc 4. a a =a aa = a 5. a a0 = 1 aa0 = 0 6. 1 a =1 0a = 0 7. 0 a =a 1a = a 8. (a0)0 = a 9. a ab = a a(a b) = a 10. a a0b = a b a(a0 b) = ab 11. (a b)0 = a0b0 (ab)0 = a0 b0 Commutativity Distributivity Associativity Idempotency Complement 32 Identity Involution Absorption Simpli cation DeMorgan's Law Introduction to Digital Systems 2 { Speci cation of Combinational Systems Example Show that E1 and E2 are equivalent: 33 E1(x2 x1 x0) = x2x1 x2x01 x2x0 E2(x2 x1 x0) = x2 x2x1 x2x01 x2x0 = x2(x1 x01) x2x0 = x2 1 x2x0 = x2(1 x0) = x2 1 = x2 using ab ac = a(b c) using a a0 = 1 using ab ac = a(b c) using 1 a = 1 using a 1 = a Introduction to Digital Systems 2 { Speci cation of Combinational Systems Sum of products and sum of minterms Literals x, y , z 0 , x0 Product terms x0, x2x1, x3x1x00 Sum of products x02 x3x01 x03x01x0 x0 x3 x1 z = x 3 x 1x'0 34 (a) x2 x3 x1 x1 x0 x'2 z = x'2 + x'3x 1 + x'3x'1x 0 x'3x 1 x'3x'1x 0 (b) Figure 2.11: 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 35 Minterm mj , j integer xi ! 1 x0i ! 0 Example: minterm x3x02x01x0 denoted m9 because 1001 = 9 mj (a) = 1 0 8 > < > : if a = j otherwise Example: m11 = x3x02x1x0 { has value 1 only for a = (1 0 1 1) a = iX ai2i =0 n;1 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Minterm functions 36 x2x1x0 000 001 010 011 100 101 110 111 m0 m1 m2 m3 m4 m5 m6 m7 x02x01x00 x02x01x0 x02x1x00 x02x1x0 x2x01x00 x2x01x0 x2x1x00 x2x1x0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Example 37 x1 x2 x0 x0 x1 x2 x1 Figure 2.12: m1 m2 z = m(1,2,6) m6 Gate network corresponding to E (x2 x1 x0) = P m(1 2 6). Introduction to Digital Systems 2 { Speci cation of Combinational Systems Example 2.12: Table ! sum of minterms 38 j x2 x1 x0 0 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111 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 39 Sum terms x0, x2 x1, x3 x1 x00 Product of sums (x02 x3 x01)(x03 x1)x0 x4 x2 x1 (a) z = x 4 + x'2 + x 1 x3 x2 x1 x2 x0 x 2 + x'3 Figure 2.13: x'3+ x'2 + x 1 z = x 0( x 2 + x'3 )( x'3+ x'2 + x 1) (b) Product of sums and or-and gate network. a) Sum term. b) Product of sums. Introduction to Digital Systems 2 { Speci cation of Combinational Systems Maxterm Notation 40 xi ! 0 Maxterm Mj , j integer x0i ! 1 Example: maxterm x3 x02 x1 x00 denoted M5 because 0101 = 5 Mj (a) = 0 if a = j 1 otherwise Example: M5 = x3 x02 x1 x00 { has value 0 only for assignment 0101 8 > < > : Introduction to Digital Systems 2 { Speci cation of Combinational Systems 41 x1 x2 x0 x1 x2 x0 x1 M0 M5 z = M(0,5,6) x0 Figure 2.14: M6 Gate network corresponding to E (x2 x1 x0 ) = M (0 Q 5 6). Introduction to Digital Systems 2 { Speci cation of Combinational Systems Example 2.15: Table ! product of sums 42 j 0 1 2 3 4 5 6 7 x2x1x0 000 001 010 011 100 101 110 111 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 Sum of minterms ! one-set Product of maxterms ! zero-set ) conversion straightforward X 43 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 Inputs: x y 2 f0 1 2 3g Output: z 2 fG,E,Sg 44 G if x > y Function: z = E if x = y S if x < y y 0 1 x2 3 0 E G G G 1 S E G G 2 S S E G 3 S S S E 8 > > > < > > > : z Introduction to Digital Systems 2 { Speci cation of Combinational Systems Example 2.19 (cont.) Coding: 45 x = 2x1 + x0 and y = 2y1 + y0 G 100 E 010 S 001 z z2z1z0 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Binary speci cation: 46 z2 = 1 0 z1 = 1 0 1 z0 = 0 8 > < > : 8 > < > : 8 > < > : 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 x1x0 00 01 10 11 00 01 10 11 010 100 100 100 001 010 100 100 001 001 010 100 y1 y0 z2z1z0 001 001 001 010 Introduction to Digital Systems 2 { Speci cation of Combinational Systems Example 2.19 (cont) Switching expressions: 47 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 04/14/2008 for the course CS M51A taught by Professor Ercegovac during the Fall '07 term at UCLA.

Ask a homework question - tutors are online