Description

Hamming Distance Matrix

Design a hardware module that computes the Hamming distance between all pairs of bit vectors. The Hamming distance is the number of positions at which the corresponding bits differ. Output a matrix where element (i,j) contains the Hamming distance between vectors i and j.

Example: For vectors [[0b1010], [0b1100], [0b0011]], the output matrix should be [[0,2,3], [2,0,3], [3,3,0]].

Input

vectors

Stream of 32-bit Unsigned Integer
Input bit vectors.

Output

2D Array of 6-bit Unsigned Integer
Distance matrix.