首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

[求助]请高手帮忙!谢谢!在线等!--已解决

[求助]请高手帮忙!谢谢!在线等!--已解决

---我是初学者,请大家帮忙。我想实现把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编辑过]

返回列表