People's Democratic Republic of Algeria
Ministry of Higher Education
National Polytechnic school of algiers
DIGITAL SYSTEMS
Home Work n°= 01
Comparison of two 4-bit binary numbers
This work was supervised by :
Mr. STIHI Omar
This work was done by :
ABID Abdelkader
1st group automatic engineering
October 10th 2023
Logic comparator of two 4-bit numbers:
A comparator is a fundamental digital circuit that compares two binary
numbers and determines their relative magnitudes (greater than, less than, or
equal). For this description, we'll design a logical model of a 4-bit binary
comparator that compares two 4-bit inputs, A and B.
Let's assume that A and B are 4-bit binary numbers represented as A 3A2A1A0
and B3B2B1B0 respectively, where Ai and Bi are binary digits (0 or 1) for each bit.
Operational mode :
1/Inputs: This comparator takes two 4-bit numbers as inputs , they are named as A and B
and divided to individual bits : A3,A2,A1,A0,B3,B2,B1,B0.
2/comparion: The 4-bit comparator compares each pair (Ai,Bi) [i=0,1,2,3] and
checks whether Ai is equal to Bi , greater than Bi or less Bi .
The output x>y is true if x is greater than x .
The output x<y is true if x is less than x .
The output x=y is true if x is equal to x .
The main logic gates that are used are AND and OR.