Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO.

Similar presentations


Presentation on theme: "1 Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO."— Presentation transcript:

1 1 Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO

2 2 Today’s topics Comparators Multiplier

3 3 Comparators A comparator compares a two n-bit binary values to determine which is greater or if they are equal Consider the simple 1-bit comparator to illustrate the design It is possible to extend the design for multi-bit numbers

4 4 Equality Comparator XNOR X Y Z X Y Z 0 0 1 0 1 0 1 0 0 1 1 1 Design a logic circuit which will compute F0 = (A = B)

5 5 2-bit Equal Comparator Truth Table b1b0a1a0F0 00001 00010 00100 00110 01000 01011 01100 01110 b1b0a1a0F0 10000 10010 10101 10110 11000 11010 11100 11111

6 6 Solution You can show,

7 7 N-bit Equal Comparator

8 8 Not Equal Comparator Design a logic circuit which will compute F = (A <> B) F = (A = B) i.e. Just invert our Equal Comparator circuit

9 9 Magnitude Comparator Design a logic circuit which will compute F2 = (A>B) F1 = (A<B) Let’s develop a truth table for 2-bits

10 10 2-bit Magnitude (unsigned) Comparator Truth Table b1b0a1a0F2F1 000000 000110 001010 001110 010001 010100 011010 011110 b1b0a1a0F2F1 100001 100101 101000 101110 110001 110101 111001 111100

11 11 You can show

12 12 1-bit Comparator x y x>yx=yx<y xy x>y x=y x<y CMP

13 13 8-bit comparator xy x>y x=y x<y CMP x n >y n x n =y n x n <y n

14 14 1 bit comparators X>Y only if Xi=1, Yi=0 X<Y only if Xi=0, Yi=1 X=Y only if Xi=Yi=0 or Xi=Yi=1

15 15 1 bit comparator with propagated inputs

16 16 N bit comparator If: X = Yin is active then the numbers are equal so far If X>Yin or X<Yin is active, that value is simply passed through; This corresponds to the case where we have checked the high-order bits and already know which value is larger.

17 17 Comparators (computer intelligence?) Let's build a comparator circuit for two 4-bit positive binary numbers. ENABLE A3 A2 A1 A0 B3 B2 B1 B0 A>B A=B A<B Nine inputs, three outputs (three 512 entries truth tables?)

18 18 Designing Comparators Functionally 1.Build a one-bit comparator A>B : AB' A=B : A'B' + AB A<B : A'B B 0 1 A 0 A=B A<B 1 A>B A=B OR What? A B A>B A=B A<B

19 19 Designing Comparators Functionally 2.Add an enable line A=B A B A>B Enable

20 20 Build a four-bit Comparator (from four one-bit ones) Not bad

21 21 Combinational Multiplier Basic Concept multiplicand multiplier 1101 (13) 1011 (11) 1101 0000 1101 * 10001111 (143) Partial products product of 2 4-bit numbers is an 8-bit number

22 22 Multiplication Example:

23 23 Multiplication Example:

24 24 Multiplication Example:

25 25 Multiplication Example:

26 26 Multiplication Example:

27 27 Multiplication Example: M x N-bit multiplication –Produce NM-bit partial products –Sum these to produce M+N-bit product

28 28 General Form Multiplicand: Y = (y M-1, y M-2, …, y 1, y 0 ) Multiplier: X = (x N-1, x N-2, …, x 1, x 0 ) Product:

29 29 16X16 Mult. Dot Diagram Each dot represents a bit

30 30 Combinational Multiplier Partial Product Accumulation A0 B0 A0 B0 A1 B1 A1 B0 A0 B1 A2 B2 A2 B0 A1 B1 A0 B2 A3 B3 A3 B0 A2 B1 A1 B2 A0 B3 A3 B1 A2 B2 A1 B3 A3 B2 A2 B3 A3 B3 S6 S5 S4 S3S2 S1S0 S7

31 31 Partial Product Accumulation Note use of parallel carry-outs to form higher order sums 12 Adders, if full adders, this is 6 gates each = 72 gates 16 gates form the partial products total = 88 gates!

32 32 Another Representation of the Circuit Building block: full adder + and 4 x 4 array of building blocks

33 33 Parallel Binary Multiplier + Y P C Y X CO PO X

34 34 X + Y PC Y X CO PO One-Bit Multiplier Cell

35 35 With J multiplier bits and K multiplicand bits – need JxK AND gates and (J-1) K-bit adders to produce J+K bits 2-bit by 2-bit Binary Multiplier

36 36 With J=3 (A 0 A 1 A 2 ) multiplier bits, K=4 (B 3 B 2 B 1 B 0 ) multiplicand bits – need 12 (JxK) AND gates, 2 (J-1) 4-bit(K-bit) adders to produce 7(J+K) bits 4-bit by 3-bit Binary Multiplier

37 37 Thank You!


Download ppt "1 Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO."

Similar presentations


Ads by Google