The Hamming distance between two bit-vectors is defined as the number of bit locations in which the two vectors differ. For example, the Hamming distance of the vectors 00110 and 10100 is 2. Design a circuit that calculates the Hamming distance of two 3-bit vectors. The distance should be represented with a 2-bit number.
module hamming3(a, b, distance);
input [2:0] a, b;
output [1:0] distance;a and b are the two 3-bit
inputs.
distance represents the Hamming distance of the two
input numbers.