S
smu
Guest
I am new in the VHDL world. I have a question that a lot
of people among you will be able to answer? I use often
the following description but with different bus width.
But I am obliged to declare the whole, each time I change
the bus width. My question is: Does there exist a way to
code the entity with the bus width as a parameter ?
Thank in advance
smu
---------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity fd14ce is
Port ( ce : in std_logic;
clk : in std_logic;
clr : in std_logic;
d : in std_logic_vector(13 downto 0);
q : out std_logic_vector(13 downto 0));
end fd14ce;
architecture fd14ce_a of fd14ce is
begin
process (clk, clr) begin
if ( clr = '1') then
q <= (others => '0');
elsif ( rising_edge( clk) and ce='1') then
q <= d;
end if;
end process;
end fd14ce_a;
of people among you will be able to answer? I use often
the following description but with different bus width.
But I am obliged to declare the whole, each time I change
the bus width. My question is: Does there exist a way to
code the entity with the bus width as a parameter ?
Thank in advance
smu
---------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity fd14ce is
Port ( ce : in std_logic;
clk : in std_logic;
clr : in std_logic;
d : in std_logic_vector(13 downto 0);
q : out std_logic_vector(13 downto 0));
end fd14ce;
architecture fd14ce_a of fd14ce is
begin
process (clk, clr) begin
if ( clr = '1') then
q <= (others => '0');
elsif ( rising_edge( clk) and ce='1') then
q <= d;
end if;
end process;
end fd14ce_a;