完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
|
本帖最后由 Huai_Xiang 于 2015-5-3 22:27 编辑
不能在同一进程中判断判断两个时钟沿,但是用两个进程是不是不能对同一输出dout赋值,求助,谢谢! library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity demo74160 is port (clk,rst,ld,ep,et:in std_logic; data:in std_logic_vector(3 downto 0); dout:out std_logic_vector(3 downto 0); cout:out std_logic ); end demo74160; architecture behav of demo74160 is shared variable Q:std_logic_vector(3 downto 0); begin process(clk,rst,ld,ep,et) begin if rst='0' then Q:=(others=>'0'); elsif (clk'event and clk='1') then if ld='0' then Q:=data; else if(ep='1' and et='1') then if Q<9 then Q:=Q+1; cout<='0'; end if; end if; end if; end if; if Q=9 then cout<='1'; else cout<='0'; end if; dout<=Q; end process; process(clk,rst,ld,ep,et) begin if rst='0' then Q:=(others=>'0'); else if(clk'event and clk='0') then if ld='1' then if(ep='0' and et='1') then Q:=Q; elsif(et='0') then Q:=Q; cout<='0'; end if; end if; end if; end if; if P=9 then cout<='1'; else cout<='0'; end if; dout<=Q; end process; end behav;
|
|
相关推荐
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
375 浏览 0 评论
NVMe over Fabrics 国产 IP:高性能网络存储解决方案
363 浏览 0 评论
130 浏览 0 评论
NVMe高速传输之摆脱XDMA设计54:如何测试队列管理功能2
397 浏览 0 评论
NVMe高速传输之摆脱XDMA设计53:如何测试队列管理功能
730 浏览 0 评论
4567 浏览 64 评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-14 01:56 , Processed in 0.532159 second(s), Total 71, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
11346