new in vhdl - a little question

ee1

Joined
Mar 26, 2011
Messages
1
Reaction score
0
hey, i am new to vhdl, and i wrote a code for a register (the inpute size should be generic).
the register should have datain, enable, reset, and data out
my question is, how can i know if what i wrote works? i mean i compiled it and did not got errors, but how can i know if its functually works?
i uses modelsim.
here is my code:

library IEEE;
use IEEE.std_logic_1164.all;

entity register is
generic(DATA_WIDTH : integer := 8 );
port(clk, reset, load : in std_logic;
data_in : in std_logic_vector(DATA_WIDTH-1 downto 0);
data_out : out std_logic_vector(DATA_WIDTH-1 downto 0));
end register;

architecture arc_register of register is
begin
process(reset,clk)
begin
if (reset='1') then
data_out <=(others=>'0');
elsif(clk'event and clk='1')then
if(load = '1') then
data_out<=data_in;
end if;
end if;
end process;
end arc_register;

configuration cfg_register of register is
for arc_register
end for;
end cfg_register;

thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top