vhdl - 将循环语句添加到每一位 VHDL
问题描述
大家好,我只是想问一下是否可以在这段代码上添加一个循环语句来打印每一位?如果可能怎么办?
这是代码。
library ieee;
use ieee.std_logic_1164.all;
entity T10_StdLogicTb is
end entity;
architecture sim of T10_StdLogicTb is
signal Signal1 : std_logic := '0'; --initial value of Signal1 is 0
signal Signal2 : std_logic;
signal Signal3 : std_logic;
begin
process is
begin
wait for 10 ns; --remember no process can be left without the wake statement
Signal1 <= not Signal1;
end process;
end architecture;
解决方案
您不能循环访问各个位Signal1
和。但是您可以将这三个转换为可以循环的 3 位。Signal2
Signal3
std_logic_vector
假设您所有的三位都在一个名为my_vector
. 使用report
语句打印值,带有类型的'image
属性std_logic
。
for i in my_vector'range loop
report std_logic'image( my_vector(i) );
end loop;
推荐阅读
- count - IF 重复超过 1 计为 1
- gitlab - GitLab 中的标签提要仅显示 20 个条目
- android - 如何在 reduce 函数中填充新列表 - Kotlin
- angular - 使用 Observable 在 Angular 中使用 Chart.JS 创建图表
- python - ModuleNotFoundError - Python3
- python - 在 numpy 二维数组中查找元素索引的最有效方法
- java - 为什么 Rstudio 与 JRI 引擎输出不同?
- omnet++ - 如何解决错误“const inet::MacHeaderBase' as 'this' argument discards qualifiers [-fpermissive]”
- ios - XCode 从模块继承选项被禁用
- c++ - Opencv如何通过GPU读取网络摄像头流?