【发布时间】:2018-10-24 22:51:37
【问题描述】:
感谢 FPGA 板上的 VGA 端口,我正在尝试在屏幕上显示动画图像。
所以,我有一个名为 sonic_digit 的实体,它允许发送我的图像:
sonic_digit0 : sonic_digit port map(
val => val2,
posX=> posXX,
posY =>conv_std_logic_vector(300,10),
rgbOut => rgb,
beamX=>beamX,
beamY=>beamY,
beamValid=>beamValid);
val 用于改变图像(要显示的精灵)。
首先,我想循环显示 3 个第一个精灵,并在它到达 x 中的第 550 个像素时停止它并显示第 4 个精灵。所以我必须有 val : 00, 01, 10, 00, 01, 10, 00 ........ 然后当 posXX 到达 550 时为 11。
所以,我厌倦了使用我的过程来管理两个图像之间的时间:
process (clk50) begin
if rising_edge(clk50) then
count <= count+1;
if count = conv_std_logic_vector(0,23) then
posXX <= posXX+1;
val2 <= val2+1;
if val2 = "11" then
val2 <= "00";
end if;
end if;
end if;
end process;
我的图像在 x 中正确移动,但它不断增加到 11,就像 if val2 = "11" 行不起作用... 我有 00, 01, 10, 11, 00, 01, 10, 11, ...
有人有想法吗? 感谢您的帮助
【问题讨论】:
-
感谢您的提议。但是,它仍然无法按预期工作。 if 不被尊重 ....
-
这看起来很正常。当
val2达到“11”时,您对它有什么期望? -
也许您需要检查
val2 = "10"而不是"11"。每当count = 0时,都会检查if。
标签: vhdl