You are on page 1of 10

# DIGITAL SYSTEMS WLE-103

DESIGN OF 4-BIT MAGNITUDE COMPARATOR

In this lecture you will learn about: Magnitude comparator How to design a 4-bit comparator .

 A>B  A=B  A<B . A and B.WHAT IS A MAGNITUDE COMPARATOR A magnitude comparator is a combinational circuit that compares: Two numbers. and then determines their relative magnitudes.

BASIC INTRODUCTION TO THE TOPIC Inputs First n-bit number A Second n-bit number B Outputs 3 output signals (GT. EQ = 1 IFF A = B 3. EQ. LT). where: 1. while the other 2 outputs are 0`s . LT = 1 IFF A < B Note: Exactly One of these 3 outputs equals 1. GT = 1 IFF A > B 2.

4-bit magnitude comparator Inputs: 8-bits (A ⇒4-bits . B ⇒4-bits) A and B are two 4-bit numbers Let A = A3A2A1A0 . and Let B = B3B2B1B0 Inputs have 28(256) possible combinations Not easy to design using conventional techniques .

4-BIT MAGNITUDE COMPARATOR Algorithm Consider two numbers. with four digits each: . A and B.

4-BIT MAGNITUDE COMPARATOR .

4-BIT MAGNITUDE COMPARATOR .

For example:  The “unequal” output can use the same gates that are needed to generate the “equal” output  This is a multi level implementation and it has a regular pattern .4-BIT MAGNITUDE COMPARATOR  Gate implementation for the three output variable shows a lot of logic circuitry being used repeatedly.

TOPIC ENDS HERE! .