0% found this document useful (0 votes)
9 views7 pages

4-Bit Magnitude Comparator Design Report

The project report details the design of a 4-bit Magnitude Comparator that compares two 4-bit binary numbers and produces outputs indicating whether one number is greater than, equal to, or less than the other. The circuit utilizes various integrated circuits (ICs) and logic gates to implement the comparison logic. Simulation results demonstrate the functionality of the comparator with specific input examples.

Uploaded by

Purnendu Bhowmik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views7 pages

4-Bit Magnitude Comparator Design Report

The project report details the design of a 4-bit Magnitude Comparator that compares two 4-bit binary numbers and produces outputs indicating whether one number is greater than, equal to, or less than the other. The circuit utilizes various integrated circuits (ICs) and logic gates to implement the comparison logic. Simulation results demonstrate the functionality of the comparator with specific input examples.

Uploaded by

Purnendu Bhowmik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Project Report

Project Name: 4-bit Magnitude Comparator

Course Title: Digital Logic Design

Course Code: CSE345

Semester: Summer 2025

Section: 7

Submitted by:

Name ID

Nusrat Jahan Tithi 2023-1-60-206

Tazrin Binte Atik 2023-1-60-188

Sumiaya Sharif 2023-1-60-048

Purnendu Bhowmik Shuvro 2023-1-60-085

Submitted to:
Nishat Tasnim
Lecturer
Department of Computer Science & Engineering
Date of Submission: 01.09.2025
Problem Statement:
The 4-bit Magnitude comparator project is to design a combinational digital circuit that
takes two 4-bit binary numbers A and B. A (A3, A2, A1, A0) and
B (B3, B2, B1, B0), as inputs and produces three outputs: A > B, A = B, A < B. The
circuit needs to analyse which binary number is larger while producing a logic high (1)
output line for the condition that A > B, A = B, and A < B. The comparator circuit
implements the logic to determine which of these conditions holds for any given pair
of 4-bit input numbers.

Design Details:
● Inputs: Two 4-bit binary numbers (A3, A2, A1, A0) and (B3, B2, B1, B0).
● Outputs: Three comparison results (A > B, A = B, A < B)
● Used ICs:
IC 7404 NOT gate (2)
IC 7408 AND gate (3)
IC 7402 NOR gate (1)
IC 7421 AND gate (2)
IC 7411 AND gate (1)
IC 4072 OR gate (1)
• Connection: Jumper Wires (Male-Male, Male-Female, Female-Female)
● Equality comparison (A=B)

A = A3A2A1A0
B = B3B2B1B0

The equality of each pair of bits (Ai, Bi) is expressed using XNOR.

𝑥ᵢ = 𝐴ᵢ𝐵ᵢ + 𝐴ᵢ′𝐵ᵢ′

The binary variable is 1 if and only if 𝑥𝑖 variables are 1. From the AND operation of xi
variables, we get,
(𝐴 = 𝐵) = 𝑥₃𝑥₂𝑥₁𝑥₀

● Inequality comparison (A > B) & (A < B)

(𝐴 > 𝐵) = 𝐴₃𝐵₃′ + 𝑥₃𝐴₂𝐵₂′ + 𝑥₃𝑥₂𝐴₁𝐵₁′ + 𝑥₃𝑥₂𝑥₁𝐴₀𝐵₀′

In a 4-bit comparator, the condition of A > B can be possible in the following four
cases.
1. If A3 = 1 and B3 = 0
2. If A3 = B3 and A2 = 1 and B2 = 0
3. If A3 = B3, A2 = B2 and A1 = 1 and B1 = 0
4. If A3 = B3, A2 = B2, A1 = B1 and A0 = 1 and B0 = 0
(𝐴 > 𝐵) = 𝐴₃′𝐵₃ + 𝑥₃𝐴₂′𝐵₂ + 𝑥₃𝑥₂𝐴₁′ 𝐵₁ + 𝑥₃𝑥₂𝑥₁𝐴₀′ 𝐵₀

Similarly, the condition for A<B can be possible in the following four cases.
1. If A3 = 0 and B3 = 1
2. If A3 = B3 and A2 = 0 and B2 = 1
3. If A3 = B3, A2 = B2 and A1 = 0 and B1 = 1
4. If A3 = B3, A2 = B2, A1 = B1 and A0 = 0 and B0 = 1

Truth table of 4-Bit Comparator

Comparing Inputs Output

A3, B3 A2, B2 A1, B1 A0, B0 A>B A<B A=B

A3 > B3 X X X H L L

A3 < B3 X X X L H L

A3 = B3 A2 > B2 X X H L L

A3 = B3 A2 < B2 X X L H L

A3 = B3 A2 = B2 A1 > B1 X H L L

A3 = B3 A2 = B2 A1 < B1 X L H L

A3 = B3 A2 = B2 A1 = B1 A0 > B0 H L L

A3 = B3 A2 = B2 A1 = B1 A0 < B0 L H L

A3 = B3 A2 = B2 A1 = B1 A0 = B0 H L L

A3 = B3 A2 = B2 A1 = B1 A0 = B0 L H L

A3 = B3 A2 = B2 A1 = B1 A0 = B0 L L H

H= High voltage level, L= Low voltage level , X= Don’t care


Diagram:

Circuit Diagram
Simulation Result:

Circuit Diagram
Input

Output

● A=B

Here, E is represented as A = B, where A = (0000)₂ = (0)₁₀ and B = (0000)₂ = (0)₁₀,


which means A = B or 0 = 0, Output, E = 1.
● A>B

Here, G is represented as A > B, where A = (1100)₂ = (12)₁₀ and B = (1010)₂ =


(10)₁₀,
which means A > B or 12 > 10, Output, G = 1.

● A<B

Here, L is represented as A < B, where A = (0111)₂ = (7)₁₀ and B = (1011)₂ = (13)₁₀,


which means A < B or 7 < 13, Output, G = 1.

You might also like