完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
|
library ieee;
use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity pdiv is port( clk : in std_logic; p : in std_logic_vector(4 downto 0); k_xor : out std_logic; k1 : out std_logic; k2 : out std_logic ); end pdiv; architecture rtl of pdiv is signal m1 : std_logic; signal m2 : std_logic; signal c0 : std_logic_vector(4 downto 0); signal c1 : std_logic_vector(4 downto 0); signal c2 : std_logic_vector(4 downto 0); signal c3 : std_logic_vector(4 downto 0); begin c0<=p + p; c3 <=p + 1; process(clk,c1) begin if rising_edge(clk)then if(c1=c0)then c1<="00000"; else c1<=c1+1; end if; if(c1="00000")then m1<=not m1; elsif(c1=c3)then m1<=not m1; end if; end if; end process; process(clk,c2) begin if rising_edge(clk)then if(c2=c0)then c2<="00000"; else c2<=c2+1; end if; if(c2="00000")then m2<=not m2; elsif(c2=p)then m2<=not m2; end if; end if; end process; k1<=m1; k2<=m2; k_xor<=m1 xor m2; end rtl; |
|
相关推荐
2个回答
|
|
|
|
|
|
|
|
|
你想要什么效果,直接写不就行了吗
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
NVMe高速传输之摆脱XDMA设计50:主要功能测试结果与分析2 nvmePCIe高速存储
252 浏览 0 评论
NVMe高速传输之摆脱XDMA设计49:主要功能测试结果与分析1
1501 浏览 0 评论
907 浏览 0 评论
855 浏览 0 评论
658 浏览 0 评论
4427 浏览 63 评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 13:23 , Processed in 0.647733 second(s), Total 72, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
7731