gpt4 book ai didi

syntax - 如何在VHDL中odt_prehh std_logic_vector?

转载 作者:行者123 更新时间:2023-12-03 23:23:28 25 4
gpt4 key购买 nike

我正在VHDL中开发一个小东西,这是一个相当新的东西。我在弄清楚如何将较大的std_logic_vector切成较小的std_logic_vector时遇到麻烦。

例如,我有3个信号:

signal allparts: std_logic_vector(15 downto 0);
signal firstpart: std_logic_vector(7 downto 0);
signal secondpart: std_logic_vector(7 downto 0);

基本上,我想要将第15到8位分配给 secondpart,将第7到0位分配给 firstpart。在不分配单个位的情况下,我如何精确地“ slice ”这样的 vector

最佳答案

您可以直接为其分配:

firstpart <= allparts(15 downto 8);
secondpart <= allparts(7 downto 0);

...或者如果firstpart和secondpart是引用allparts信号一部分的简单替代方法,则可能要使用别名:
alias firstpart is allparts(15 downto 8);
alias secondpart is allparts(7 downto 0);

关于syntax - 如何在VHDL中odt_prehh std_logic_vector?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10375858/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com