Title: Tutorial: ITI1100
1Tutorial ITI1100
- Dewan Tanvir Ahmed
- SITE, UofO
2Todays topicsComparatorsMultiplier
3Comparators
- 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
4Equality Comparator
Design a logic circuit which will compute F0
(A B)
XNOR
X
Z
Y
52-bit Equal Comparator Truth Table
b1 b0 a1 a0 F0
0 0 0 0 1
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 1
0 1 1 0 0
0 1 1 1 0
b1 b0 a1 a0 F0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 1
1 0 1 1 0
1 1 0 0 0
1 1 0 1 0
1 1 1 0 0
1 1 1 1 1
6Solution
You can show,
7N-bit Equal Comparator
8Not Equal Comparator
- Design a logic circuit which will compute
- F (A ltgt B)
F (A B)
i.e. Just invert our Equal Comparator circuit
9Magnitude Comparator
- Design a logic circuit which will compute
- F2 (AgtB)
- F1 (AltB)
Lets develop a truth table for 2-bits
102-bit Magnitude (unsigned) Comparator Truth Table
b1 b0 a1 a0 F2 F1
1 0 0 0 0 1
1 0 0 1 0 1
1 0 1 0 0 0
1 0 1 1 1 0
1 1 0 0 0 1
1 1 0 1 0 1
1 1 1 0 0 1
1 1 1 1 0 0
b1 b0 a1 a0 F2 F1
0 0 0 0 0 0
0 0 0 1 1 0
0 0 1 0 1 0
0 0 1 1 1 0
0 1 0 0 0 1
0 1 0 1 0 0
0 1 1 0 1 0
0 1 1 1 1 0
11You can show
121-bit Comparator
138-bit comparator
141 bit comparators
- XgtY only if Xi1, Yi0
- XltY only if Xi0, Yi1
- XY only if XiYi0 or XiYi1
151 bit comparator with propagated inputs
16N bit comparator
- If X Yin is active then the numbers are equal
so far - If XgtYin or XltYin 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.
17Comparators (computer intelligence?)
- Let's build a comparator circuit for two 4-bit
positive binary numbers.
- Nine inputs, three outputs (three 512 entries
truth tables?)
18Designing Comparators Functionally
- 1. Build a one-bit comparator
AgtB AB' AB A'B' AB AltB
A'B
OR What?
19Designing Comparators Functionally
20Build a four-bit Comparator (from four one-bit
ones)
21Combinational Multiplier
Basic Concept
multiplicand multiplier
1101 (13) 1011 (11) 1101
product of 2 4-bit numbers is an 8-bit number
1101
Partial products
0000
1101
10001111
(143)
22Multiplication
23Multiplication
24Multiplication
25Multiplication
26Multiplication
27Multiplication
- Example
- M x N-bit multiplication
- Produce NM-bit partial products
- Sum these to produce MN-bit product
28General Form
- Multiplicand Y (yM-1, yM-2, , y1, y0)
- Multiplier X (xN-1, xN-2, , x1, x0)
- Product
2916X16 Mult. Dot Diagram
- Each dot represents a bit
30Combinational 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 B3
A3 B2 A2 B3
S6
S4
S7
S5
S3
S2
S1
S0
31Partial 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!
32Another Representation of the Circuit
Building block full adder and
4 x 4 array of building blocks
33Parallel Binary Multiplier
34One-Bit Multiplier Cell
X
352-bit by 2-bit Binary Multiplier
With J multiplier bits and K multiplicand bits
need JxK AND gates and (J-1) K-bit adders to
produce JK bits
364-bit by 3-bit Binary Multiplier
With J3 (A0A1A2) multiplier bits, K4 (B3B2B1B0)
multiplicand bits need 12 (JxK) AND gates, 2
(J-1) 4-bit(K-bit) adders to produce 7(JK) bits
37Thank You!