Hamming distance X51732


Statement
 

pdf   zip   verilog

html

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.

Specification

module hamming3(a, b, distance); input [2:0] a, b; output [1:0] distance;

Input

  • a and b are the two 3-bit inputs.

Output

  • distance represents the Hamming distance of the two input numbers.
Information
Author
Jordi Cortadella
Language
English
Official solutions
Unknown. This problem is being checked.
User solutions
Verilog