Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VHDL code for hamming distance calculation

Status
Not open for further replies.

K.S.GANESH KUMAR

Newbie level 3
Joined
Sep 5, 2013
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Tamilnadu
Activity points
30
hi,
can anyone send VHDL code for calculating hamming distance between two test vectors.
example :v1=1010100011 and v2=0101000111.
the hammindg distance is 6.
i need VHDL code for this hamming distance calculation.

Thanks.
 

Fresh out of hamming distance code. In fact, I am fresh out of ham. Guess it's time for groceries.

So I will do my own groceries, while you do your own homework. Okay then, sounds like a plan.
 
you can actually do this with a for loop. eg:
Code:
--pseudocode
d := 0;
for idx in v1'range loop
  if v1(idx) /= v2(idx) then
    d := d + 1;
  end if;
end loop;

If you use XST, you should see that it infers an adder tree in the synthesis report.
 
thanks sir..,suppose we have don't care bit(X) in the test vectors like v1=XX0011 and v2=X01001 means the operator(/=) not gives correct output sir.am doing xor operation sir..can u tell others methods sir.. and we have more vectors sir.(upto v20)
thanks sir.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top