D
Daniel
Guest
I am learning VHDL.
I have a doubt with an entity.
My entity have : 2 input and 1 output.
entity despIzq is
Port ( entrada : in std_logic_vector(4 downto 0);
despl : in std_logic_vector(4 downto 0);
salida : inout std_logic_vector(4 downto 0));
end despIzq;
Their behavior is:
salida = entrada sll despl
for example:
entrada <= "00010";
despl <= "00010";
salida => "01000"
my code is:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Uncomment the following lines to use the declarations that are
-- provided for instantiating Xilinx primitive components.
--library UNISIM;
--use UNISIM.VComponents.all;
entity despIzq is
Port ( entrada : in std_logic_vector(4 downto 0);
despl : in std_logic_vector(4 downto 0);
salida : inout std_logic_vector(4 downto 0));
end despIzq;
architecture Behavioral of despIzq is
signal tmp : std_logic_vector (4 downto 0);
signal tmp_2 : std_logic_vector (9 downto 0);
signal tmp_3 : std_logic;
constant ZERO: std_logic_vector (4 downto 0):="00000";
begin
process(entrada,despl)
begin
tmp <= despl;
tmp_2<="0000000000";
while tmp > ZERO loop
tmp_3 <='1';
tmp_2 <= salida * "00010";
salida <= tmp_2(4 downto 0);
tmp<=tmp-1;
end loop;
end process;
end Behavioral;
tmp_3 is to see if the condition of the "while" is true.
the problem is that it never enters in loop statements.
tmp_3 never is 1
Somebody can help me, please!!!
Thank you very much.
I have a doubt with an entity.
My entity have : 2 input and 1 output.
entity despIzq is
Port ( entrada : in std_logic_vector(4 downto 0);
despl : in std_logic_vector(4 downto 0);
salida : inout std_logic_vector(4 downto 0));
end despIzq;
Their behavior is:
salida = entrada sll despl
for example:
entrada <= "00010";
despl <= "00010";
salida => "01000"
my code is:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Uncomment the following lines to use the declarations that are
-- provided for instantiating Xilinx primitive components.
--library UNISIM;
--use UNISIM.VComponents.all;
entity despIzq is
Port ( entrada : in std_logic_vector(4 downto 0);
despl : in std_logic_vector(4 downto 0);
salida : inout std_logic_vector(4 downto 0));
end despIzq;
architecture Behavioral of despIzq is
signal tmp : std_logic_vector (4 downto 0);
signal tmp_2 : std_logic_vector (9 downto 0);
signal tmp_3 : std_logic;
constant ZERO: std_logic_vector (4 downto 0):="00000";
begin
process(entrada,despl)
begin
tmp <= despl;
tmp_2<="0000000000";
while tmp > ZERO loop
tmp_3 <='1';
tmp_2 <= salida * "00010";
salida <= tmp_2(4 downto 0);
tmp<=tmp-1;
end loop;
end process;
end Behavioral;
tmp_3 is to see if the condition of the "while" is true.
the problem is that it never enters in loop statements.
tmp_3 never is 1
Somebody can help me, please!!!
Thank you very much.