Pegar un vector en otro de mayor tamaño en VHDL (Vivado 2020)

Actualmente estoy diseñando un convertidor de Binario de 7Bits a BCD de 4Bits para mostrarlos en un display de una FPGA (Hace parte de un sistema más grande que consiste en una banda caminadora), donde el binario el valor máximo que toma en decimal es 100 y el mínimo es de 10, la conversión la estoy realizando mediante el método de crear un vector del tamaño correspondiente a la suma de bits que contiene el número binario de entrada, y debido a que los valores siempre estarán entre 11 y 99, son necesarios 8 bits adicionales, 4 por cada dígito, por lo que la suma sería 7bits del Binario de entrada + 8bits de los 2 números bcd de salida, es decir 15bits, luego se inicializa todo el vector en 0 y se comienza a desplazar el MSL del Binario al LSB del BCD que corresponde a las unidades y cuando alguno de esos BCD tenga un valor mayor a 4, se le suma 3 a ese Bit mediante un sumador de 4bits ya que no pude hacerlo simplemente usando el operador +. El proceso se repite hasta realizar el número de desplazamientos igual al número de bits del binario de entrada, el programa en sí, se encuentra sin errores, el único gran problema que me encuentro es que, el resultado entregado por el sumador corresponde a una señal del tipo std_logic_vector (3 downto 0), y el valor de esta señal debe ser pegado en las posiciones (10 downto 7) de una VARIABLE del tipo std_logic_vector (14 downto 0). El problema es que cuando hago eso, las posiciones (10 downto 7) de la variable, en lugar de tomar el valor de la señal, toma el valor de "U" en las 4 posiciones donde debería estar la señal. Quisiera saber cómo solucionar esto, ya que no me permite pegar un vector en otro. Hice bastantes pruebas por lo que llegué a la conclusión de que el único error se presenta en ese punto. El código es el siguiente

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;


entity eBintoBCD is
Port (Num7Bit : in std_logic_vector (6 downto 0);
state: in std_logic;
BCDI0: out std_logic_vector (3 downto 0);
BCDI1: out std_logic_vector (3 downto 0);
BCDI2: out std_logic_vector (3 downto 0)
);
end eBintoBCD;

architecture aBintoBCD of eBintoBCD is

component eSumador4Bits is
Port ( A1 : in STD_LOGIC_VECTOR (3 downto 0);
B1 : in STD_LOGIC_VECTOR (3 downto 0);
Ci : in STD_LOGIC;
Co : out STD_LOGIC;
Z1 : out STD_LOGIC_VECTOR (3 downto 0));
end component;

signal TermA1,TermA2, Result1, Result2: std_logic_vector (3 downto 0);
signal CarryIn: std_logic;

begin

Adder1:eSumador4Bits port map (A1 => TermA1, B1 => "0011", Ci => CarryIn, Z1 => Result1);
Adder2:eSumador4Bits port map (A1 => TermA2, B1 => "0011", Ci => CarryIn, Z1 => Result2);

process (Num7Bit)
variable BCDConversor: std_logic_vector (14 downto 0);
begin

for i in 0 to 14 loop
BCDConversor(i) := '0';
end loop;

CarryIn <= '0';

if state = '1' then

if Num7Bit = "0001010" then
BCDI2 <= "1011";
BCDI1 <= "0001";
BCDI0 <= "0000";
elsif Num7Bit = "1100100" then
BCDI2 <= "0001";
BCDI1 <= "0000";
BCDI0 <= "0000";
elsif Num7Bit > "0001010" and Num7Bit < "1100100" then

BCDConversor(9 downto 3) := Num7Bit;
for i in 0 to 3 loop

if BCDConversor (10 downto 7) > "0100" then ES EN ESTOS 2 "IF" DONDE SE PEGA EL VALOR DE RESULT1 Y RESULT2 EN LAS POSICIONES DE LA
TermA1 <= BCDConversor (10 downto 7); VARIABLE BCDConversor, Dichos valores se convierten en "U" cuando son pegados en el vector
BCDConversor (10 downto 7) := Result1;
end if;

if BCDConversor (14 downto 11) > "0100" then
TermA2 <= BCDConversor (14 downto 11);
BCDConversor (14 downto 11) := Result2;
end if;

BCDConversor(14 downto 1):= BCDConversor(13 downto 0);
end loop;


BCDI2 <= "1011";
BCDI1 <= BCDConversor(14 downto 11);
BCDI0 <= BCDConversor(10 downto 7);
end if;
else
BCDI2 <= "1011";
BCDI1 <= "1011";
BCDI0 <= "1011";
end if;
end process;

end aBintoBCD;

El código del sumador de 4bits es el siguiente

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity eSumador4Bits is
Port ( A1 : in STD_LOGIC_VECTOR (3 downto 0);
B1 : in STD_LOGIC_VECTOR (3 downto 0);
Ci : in STD_LOGIC;
Co : out STD_LOGIC;
Z1 : out STD_LOGIC_VECTOR (3 downto 0));

end eSumador4Bits;

architecture aSumador4Bits of eSumador4Bits is

component eSumador1Bit is

Port ( A0 : in STD_LOGIC;
B0 : in STD_LOGIC;
Ci : in STD_LOGIC;
Z0 : out STD_LOGIC;
Co : out STD_LOGIC);

end component;

signal Ci1, Ci2, Ci3 : STD_LOGIC;

begin

i0_eSumador1Bit:eSumador1Bit port map(A0 => A1(0),B0 => B1(0),Ci => Ci, Z0 => Z1(0),Co => Ci1);
i1_eSumador1Bit:eSumador1Bit port map(A0 => A1(1),B0 => B1(1),Ci => Ci1, Z0 => Z1(1),Co => Ci2);
i2_eSumador1Bit:eSumador1Bit port map(A0 => A1(2),B0 => B1(2),Ci => Ci2, Z0 => Z1(2),Co => Ci3);
i3_eSumador1Bit:eSumador1Bit port map(A0 => A1(3),B0 => B1(3),Ci => Ci3, Z0 => Z1(3),Co => Co);

end aSumador4Bits;

Luego, el código del sumador de 1bit es el siguiente

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity eSumador1Bit is
Port ( A0 : in STD_LOGIC;
B0 : in STD_LOGIC;
Ci : in STD_LOGIC;
Z0 : out STD_LOGIC;
Co : out STD_LOGIC);
end eSumador1Bit;

architecture aSumador1Bit of eSumador1Bit is

begin

Z0 <= (A0 xor B0) xor Ci;

Co <= (Ci and (A0 xor B0)) or (A0 and B0);

end aSumador1Bit;
 
Atrás
Arriba