Engineering How to Design a Circuit for Calculating Hamming Distance?

  • Thread starter Thread starter fazer2014
  • Start date Start date
  • Tags Tags
    Circuit Digital
Click For Summary
The discussion focuses on designing a circuit to calculate the Hamming distance between two 5-bit binary numbers using logic gates, specifically mentioning the use of AND, OR, NOT, XOR gates, and Full Adders. The main challenge is integrating Full Adders effectively, as the user finds them inefficient for simply determining bit differences. The user suggests that using XOR gates might be a more straightforward approach for identifying differing bits. Additionally, there is confusion about how to convert the output from the Full Adders into a binary representation of the Hamming distance. The conversation highlights the need for clarity in circuit design while addressing the specific requirements of the problem.
fazer2014
Messages
8
Reaction score
0

Homework Statement



You are to design a circuit that calculates Hamming distance between two 5-bit numbers. It takes two 5-bit binary numbers A4A3A2A1A0 and B4B3B2B1B0 as inputs and reurns the number of bits that are different between the two numbers as binary output O2O1O0.

For example:
If the two numbers were 10111 and 00001 then the output would be 011 as there are 3 bits different between them.

Design a circuit for the Hamming distance calculator. Your design can make use of AND, OR, NOT, XOR gates and Full Adders.

NB. There is a preceeding question 'draw a truth table for a Full Adder' implying that they want us to use Full Adders in the circuit design.

Homework Equations



Here is a link about Full Adders: http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/fulladd.html

The Attempt at a Solution



I have tried to do this question for a few hours now, and it seems easier to do without the Full Adders (though I don't have a solution yet without FAs either). The only way I can think of using the full adders is to ignore the Carry-in and Carry-out and just use the fact that when, for example, A4 and B4 are the same, the Sum output will be 0, and if they are different the Sum output will be 1. This seems pointless and a waste of using Full Adders (inefficient, could just use 2 XOR gates instead of the whole Full Adder)...
Just a it stuck I guess? Also even if I manage to get some kind of 5-bit output from the Full Adders eg 10001 where the 0's represent which bits are different, how to convert that into the binary number '3' (011)? Thankyou so much!
 
Physics news on Phys.org
Try using XOR gates for the first stage. Where could you go from there?
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
19K
Replies
6
Views
6K
  • · Replies 7 ·
Replies
7
Views
13K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 20 ·
Replies
20
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
5K
Replies
5
Views
2K