i'm using hard decision, my problem is in coding part how to write the code to compare my recievede code with state output and calculate the ham distance , for now I need to solve how to write the code to calculate the hamming distance this the code i write to start up for branchmetric
LIBRARY IEEE;
USE IEEE.std_logic_1164.all;
USE IEEE.std_logic_unsigned.all;
entity branchmetric IS
generic (
Bit_Width : integer := 3;
BM_Width : integer := 4);
port (
input0 : IN std_logic_vector (Bit_Width - 1 downto 0);
input1 : IN std_logic_vector (Bit_Width - 1 downto 0);
bm00 : OUT std_logic_vector(BM_Width - 1 DOWNTO 0);
bm01 : OUT std_logic_vector(BM_Width - 1 DOWNTO 0);
bm10 : OUT std_logic_vector(BM_Width - 1 DOWNTO 0);
bm11 : OUT std_logic_vector(BM_Width - 1 DOWNTO 0)
);
end branchmetric ;
architecture brm of branchmetric is
SIGNAL bm00_0 : std_logic_vector(Bit_Width - 1 DOWNTO 0);
SIGNAL bm00_1 : std_logic_vector(Bit_Width - 1 DOWNTO 0);
SIGNAL bm01_0 : std_logic_vector(Bit_Width - 1 DOWNTO 0);
SIGNAL bm01_1 : std_logic_vector(Bit_Width - 1 DOWNTO 0);
SIGNAL bm10_0 : std_logic_vector(Bit_Width - 1 DOWNTO 0);
SIGNAL bm10_1 : std_logic_vector(Bit_Width - 1 DOWNTO 0);
SIGNAL bm11_0 : std_logic_vector(Bit_Width - 1 DOWNTO 0);
SIGNAL bm11_1 : std_logic_vector(Bit_Width - 1 DOWNTO 0);