vhdl在fpga上实现流水灯程序有问题,请高手帮忙

vhdl在fpga上实现流水灯程序有问题,请高手帮忙,第1张

process(clk)

begin

if(rising_edge(clk)) then

count<=count+'1'

end if

if(count(30)='1') then

led<=num

count<=(others=>'0')

num<=num(6 downto 0) &num(7) --循环移位

end if

end process

你的第一个程序,下面一个if并没有在敏感列孙桐物表的clk下。其实相当于2个进程:

process(clk)

begin

if(rising_edge(clk)) then

count<=count+'1'

end if

end process

process

if(count(30)='1') then

led<=num

count<=(others=>'0')

num<=num(6 downto 0) &num(7) --循环移位

end if

end process

这样就不能在边进行触发了。所以写程序的时候还是严格一点比较好。按照下面的格式,所有的逻辑关系要写在--your logic 的则液位置。

process(clk,rst)

begin

if rst = '1' then

elsif rising_edge(clk) then

--your logic

end if

end process

这样一个格轮腊式才和verilog中的

always @ (posedge clk or posedge rst) begin

if (rst) begin

end

else begin

//your logic

end

end

相同。

variable aa:std_logic

variable bb:std_logic

variable cc:std_logic

variable dd:std_logic

variable ee:std_logic

variable ff:std_logic

variable gg:std_logic这部分如老要放到渣孝升process的慎友外部的.

之前做拿皮御过,但是程序找不到了。提供一个思路,将汉字用字符软件转成HEX数据,存在ROM中,然后FPGA从ROM中读出送到点阵上,滚动其实就是将点阵的地址左移或右移。很简单的。建议你自己动手做一下,比拿别握洞人的程序跑更有意义消岩。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/12551723.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-26
下一篇 2023-05-26

发表评论

登录后才能评论

评论列表(0条)

保存