完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
|
本帖最后由 威凌天下 于 2013-5-17 21:01 编辑
本人刚刚学习FPGA 用vhdl写了一个递减锯齿波 但波形失真 波形仿真如下 源码library ieee;use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity signal2 is port(clk,reset:in std_logic; q:out std_logic_vector(7 downto 0)); end signal2; architecture a of signal2 is begin process(clk,reset) variable tmp:std_logic_vector(7 downto 0); begin if reset = '1'then tmp:="11111111"; elsif rising_edge(clk)then if tmp="00000000"then tmp:="11111111"; else tmp:=tmp-5; end if; end if; q<=tmp; end process ; end a;
|
|
相关推荐
1个回答
|
|
|
源码library ieee;use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity signal2 is port(clk,reset:in std_logic; q:out std_logic_vector(7 downto 0)); end signal2; architecture a of signal2 is begin process(clk,reset) variable tmp:std_logic_vector(7 downto 0); begin if reset = '1'then tmp:="11111111"; elsif rising_edge(clk)then if tmp="00000000"then tmp:="11111111"; else tmp:=tmp-5; end if; end if; q<=tmp; end process ; end a; |
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
470 浏览 0 评论
532 浏览 0 评论
660 浏览 0 评论
822 浏览 0 评论
RT-Thread与英飞凌(infineon)合作得板子PSOC 6 板子学习
758 浏览 0 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
17034 浏览 31 评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-13 18:31 , Processed in 0.718957 second(s), Total 73, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2422