完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
本帖最后由 一只耳朵怪 于 2018-6-6 11:32 编辑
libraryIEEE; useIEEE.STD_LOGIC_1164.ALL; useIEEE.STD_LOGIC_ARITH.ALL; useIEEE.STD_LOGIC_UNSIGNED.ALL; ----Uncomment the following library declaration if instantiating ----any Xilinx primitives in this code. --libraryUNISIM; --useUNISIM.VComponents.all; entitygold is Port ( clk : in STD_LOGIC; en : in STD_LOGIC; g_out : out STD_LOGIC); endgold; architectureBehavioral of GOLD is signal m1_out,m2_out: STD_LOGIC; begin process(clk,en) variable reg1: STD_LOGIC_VECTOR(9 downto 0):="0011011011"; variable temp1: STD_LOGIC_VECTOR (9 downto 0):="0000000000"; begin if clk'event and clk = '1' then---------组合电路特征---------- if en='1' then m1_out<=reg1(0); temp1(0):= reg1(0) xor reg1(7); reg1(8 downto 0):=reg1(9 downto 1); reg1(9):=temp1(0); end if; end if; end process; process (clk,en) variable reg2: STD_LOGIC_VECTOR (9 downto 0):="1010010011"; variable temp2: STD_LOGIC_VECTOR (9 downto 0):="0000000000"; begin if clk'event and clk = '1' then if en='1' then m2_out<= reg2(0); temp2(0):= reg2(0) xor reg2(1)xorreg2(2)xor reg2(4)xor reg2(7)xor reg2(8); reg2(8 downto 0):=reg2(9 downto 1); reg2(9):=temp2(0); end if; end if; end process; g_out<= m1_out xor m2_out; endBehavioral;
|
|
相关推荐
1个回答
|
|
你要先学习一下语言知识才可以
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1291 浏览 1 评论
Multisim14.2中CD4538高电平输出为什么只有5V?
4557 浏览 2 评论
9715 浏览 1 评论
17779 浏览 4 评论
为什么我的555和计时器共用一个电源就报错,单独使用都不会报错呢,麻烦大佬解答下
65219 浏览 4 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-3-28 21:46 , Processed in 0.842252 second(s), Total 72, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 深圳华秋电子有限公司
电子发烧友 (电路图) 粤公网安备 44030402000349 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号