---我是初学者,请大家帮忙。我想实现把16位计数器计数并入移位寄存器,程序如下: entity jsqyw is generic(width:integer:=16); Port ( clk : in STD_LOGIC; resetn : in STD_LOGIC; count_out : out STD_LOGIC_VECTOR(width-1 DOWNTO 0); shift_en : in STD_LOGIC; load : in STD_LOGIC; shift_out : out STD_LOGIC; d_in : in STD_LOGIC_VECTOR(width-1 DOWNTO 0)); end jsqyw; architecture Behavioral of jsqyw is begin signal count_outQ:std_logic_vector(width-1 downto 0); signal shift_red:std_logic_vector(width-1 downto 0); P0:process(clk,resetn) begin if (resetn='0') then count_outQ<=(others=>'0'); elsif(clk'event and clk='1') then count_outQ<=count_outQ+1; end if; count_out<=count_outQ; end process P0; p1:process(clk,resetn,count_out) begin d_in<=count_out; if resetn='0' then shift_red<=(others=>'0'); elsif clk'event and clk='1' then if load='1' then shift_red<=d_in; elsif shift_en='1' then shift_red<=shl(shift_red,"1"); shift_red(0)<='0'; end if; end if; end process P1; shift_out<=shift_red(width-1); end jsyw; end Behavioral; 可是这两个进程是并行的,无法把计数器的结果传入移位寄存器的输入,怎么样才能实现呢?谢谢!急!
[此贴子已经被作者于2007-7-7 22:10:42编辑过] |