vhdl - 为什么在这种情况下索引非法?
问题描述
以下是在总线上发送串行数据。COUNT 在时钟的上升沿递增。在不同的过程中,如果同步信号为高,则索引 COUNT 是什么。为什么像 23 - COUNT 这样的索引值被标记为非法
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity XYZ is
port( reset : in std_logic;
clock : in std_logic;
DATA_IN : in std_logic;
SYNC_SIG : in std_logic;
DATA_OUT : out std_logic_vector(23 downto 0));
end XYZ;
architecture rtl of XYZ is
signal COUNT : integer range 0 to 45 := 0;
begin
COUNTER: process(RESET, CLOCK)
BEGIN
If reset = '1' then
COUNT <= 0;
elsif rising_edge(clock) then
COUNT <= COUNT + 1;
if COUNT = 45 then
COUNT <= 0;
end if;
end if;
end process counter;
INC: process(SYNC_SIG, COUNT)
begin
if (SYNC_SIG = '1') then
DATA_OUT(23 - COUNT) <= DATA_IN;
end if;
end process INC;
end rtl;
解决方案
推荐阅读
- mongodb - 聚合 MongoDB 后重命名字段
- python-3.x - dask collect 上的 streamz 异常
- ab-testing - 消除原始内容的 VWO Flash (FOOC)
- tensorflow - 双向 RNN 单元 - 是否共享?
- angular-formly - 如何布置依赖于主字段的子字段?
- macos - Unity3D 2018.2 在 Macbook Pro 上的播放模式下运行异常缓慢
- vba - 如何阻止循环在多列用户表单列表框中显示相同的字符串?
- css - Bootstrap - 复选框左侧的标签
- django - Kubernetes 不返回端点 Django Rest-Framework
- c - 通过将 void 指针转换为不同的结构指针来访问它的内容