完善资料让更多小伙伴认识你,还能领取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个回答
|
|
|
你要先学习一下语言知识才可以
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1353 浏览 0 评论
3699 浏览 0 评论
9164 浏览 0 评论
18194 浏览 1 评论
各位大神,为什么这个multsim14中电压表测出的电压值不对?需要设置哪里吗?
24646 浏览 4 评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-9 08:00 , Processed in 1.520017 second(s), Total 75, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
3299