K
krby_xtrm
Guest
i'm creating a n_by_m encoder such that m = log2
so that it will be set based only on 'n' inside generic...
see skeleton code below:
----------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use ieee.math_complex.all;
entity encoder is
generic( n : integer := 8);
port(
x : in STD_LOGIC_VECTOR(n-1 downto 0);
y : out STD_LOGIC_VECTOR(log2-1 downto 0) -- << here <<
);
end encoder;
--}} End of automatically maintained section
architecture encoder of encoder is
begin
-- enter your statements here --
end encoder;
----------------------------------------------------
so that it will be set based only on 'n' inside generic...
see skeleton code below:
----------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use ieee.math_complex.all;
entity encoder is
generic( n : integer := 8);
port(
x : in STD_LOGIC_VECTOR(n-1 downto 0);
y : out STD_LOGIC_VECTOR(log2-1 downto 0) -- << here <<
);
end encoder;
--}} End of automatically maintained section
architecture encoder of encoder is
begin
-- enter your statements here --
end encoder;
----------------------------------------------------