You are on page 1of 34

Introduction to Digital VLSI

Lecture 13
Dr. Shaeen Kalathil
Comparators
Comparators
• 0’s detector: A = 00…000
• 1’s detector: A = 11…111
• Equality comparator: A=B
1’s & 0’s Detectors
• 1’s detector: N-input AND gate
• 0’s detector: NOTs + 1’s detector (N-input NOR)

A7
A6
A5
A4 A3
allones
A3 A2
A2 allzeros
A1
A1
A0 A0
Equality Comparator
• To compare two binary strings (or binary words) to determine
if they are exactly equal.
•Truth table for a comparator:

What is the Boolean


A B A=B
expression for this truth
0 0 1 table?

0 1 0
Can you draw the
1 0 0 circuit for basic
comparator?
1 1 1

5
Equality Comparator
• Comparing two binary strings (or binary words) to determine
if they are exactly equal.
•Truth table for a comparator:
1-bit comparator

A B A=B
0 0 1
0 1 0
1 0 0 A=B is same as
output for Ex-NOR
1 1 1 gate

6
Basic Equality Comparator Operation

7
Shifters
Shifters
• Logical Shift:
• Shifts number left or right and fills with 0’s
• 1011 LSR 1 = ____ 1011 LSL1 = ____
• Arithmetic Shift:
• Shifts number left or right. Rt shift sign extends
• 1011 ASR1 = ____ 1011 ASL1 = ____
• Rotate:
• Shifts number left or right and fills with lost bits
• 1011 ROR1 = ____ 1011 ROL1 = ____
Shifters
• Logical Shift:
• Shifts number left or right and fills with 0’s
• 1011 LSR 1 = 0101 1011 LSL1 = 0110
• Rotate:
• Shifts number left or right and fills with lost bits
• 1011 ROR1 = 1101 1011 ROL1 = 0111
BARREL SHIFTER
outputs

inputs
Shift 0

High voltage at gate turns


on transistors
Shift 0

= I3

= I2

= I1

= I0

High voltage at gate turns


on transistors
Shift 1
Shift 1

= I2

= I1

= I0

= I3
Shift 2
= I1

= I0

= I3

= I2
Shift 3
All green transistors are
turned ON
Multiplication
1100 : 1210
• Example: 0101 : 510
Multiplication
1100 : 1210
• Example: 0101 : 510
1100
Multiplication
1100 : 1210
• Example: 0101 : 510
1100
0000
Multiplication
1100 : 1210
• Example: 0101 : 510
1100
0000
1100
Multiplication
1100 : 1210
• Example: 0101 : 510
1100
0000
1100
0000
Multiplication
1100 : 1210
• Example: 0101 : 510
1100
0000
1100
0000
00111100 : 6010
Multiplication
1100 : 1210 multiplicand
• Example: 0101 : 510 multiplier
1100
0000 partial
1100 products
0000
00111100 : 6010 product

• M x N-bit multiplication
• Produce N M-bit partial products
• Sum these to produce M+N-bit product
General Form
• Multiplicand: Y = (yM-1, yM-2, …, y1, y0)
• Multiplier: X = (xN-1, xN-2, …,Mx−11, x0) N −1
    N −1 M −1
P =   y j 2 j    xi 2i  =   xi y j 2i + j
 j =0   i =0  i =0 j =0
• Product:
y5 y4 y3 y2 y1 y0 multiplicand
x5 x4 x3 x2 x1 x0 multiplier
x0y5 x0y4 x0y3 x0y2 x0y1 x0y0
x1y5 x1y4 x1y3 x1y2 x1y1 x1y0
x2y5 x2y4 x2y3 x2y2 x2y1 x2y0 partial
x3y5 x3y4 x3y3 x3y2 x3y1 x3y0 products
x4y5 x4y4 x4y3 x4y2 x4y1 x4y0
x5y5 x5y4 x5y3 x5y2 x5y1 x5y0
p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0 product
Summary
Comparators
Study logic diagrams of 0’s detector, 1’s detector and equality comparator.
Shifters
Logical Shift
Rotate Shift
Study the Concept
Barrel Shifter
Learn the circuit diagram and truth table.
Learn which transistors are turned ON for a particular shift.
Multipliers
Learn the multiplication process
Obtaining partial products and final product.
Learn the logic diagram of 4 bit x 4 bit array multiplier (slide 32and 33)

You might also like