How to Design a Circuit for Calculating Hamming Distance?

  • Context: Engineering 
  • Thread starter Thread starter fazer2014
  • Start date Start date
  • Tags Tags
    Circuit Digital
Click For Summary
SUMMARY

The discussion focuses on designing a circuit to calculate the Hamming distance between two 5-bit binary numbers using logic gates, specifically AND, OR, NOT, XOR gates, and Full Adders. The circuit must output the number of differing bits as a 3-bit binary number. The participant suggests that using Full Adders may be inefficient for this task, as XOR gates could suffice to determine bit differences. The challenge lies in converting the output from the Full Adders into the final binary representation of the Hamming distance.

PREREQUISITES
  • Understanding of Hamming distance and its calculation
  • Knowledge of digital logic gates: AND, OR, NOT, XOR
  • Familiarity with Full Adders and their truth tables
  • Basic binary arithmetic and conversion techniques
NEXT STEPS
  • Research how to implement Hamming distance calculation using only XOR gates
  • Study the design and application of Full Adders in digital circuits
  • Learn about binary to decimal conversion methods
  • Explore circuit design software for simulating digital logic circuits
USEFUL FOR

Electrical engineering students, digital circuit designers, and anyone interested in learning about Hamming distance calculations and logic gate applications in circuit design.

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 3 ·
Replies
3
Views
1K
Replies
6
Views
6K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
13K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 20 ·
Replies
20
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 2 ·
Replies
2
Views
5K