【发布时间】:2020-08-06 14:28:14
【问题描述】:
我必须在 nexys 4 上实现我的设计。在我的设计中,我有 4 个整数数据类型的输入。 vivado 默认的整数数据长度为 32 位,同时板卡 nexys 4 只能处理最大数据长度为 16 位的整数在 GPIO 端口中设置。所以我想知道如何将整数的数据长度从32位减少到16位,你能帮帮我吗?谢谢
【问题讨论】:
-
不使用实体中的“整数”类型,而是使用 std_logic_vector(SIZE-1 downto 0)?
-
从整数创建自己的子类型并使用它
subtype my_integer is integer range 0 to 65535;然后input_1 : IN my_integer; -
范围 0 到 65535 消除了不是 16 位整数的负值