Joh*_*amp 2 concatenation vhdl shift
假设我有2个std_logic_vectors:
inputA : std_logic_vector(31 downto 0)
inputB: std_logic_vector(31 downto 0)
Run Code Online (Sandbox Code Playgroud)
如何转向inputA通过inputB使用串联?
我知道如何向左或向右移动1个位置,但无法弄清楚如何将N个位置向右(或左)移动.注意:这是一个无时钟电路,不能使用标准的vhdl移位运算符.
除了连接之外的其他技术或想法也将被理解.
最简单的方法是这样的:
library ieee;
use ieee.numeric_std.all;
...
output <= std_logic_vector(unsigned(inputA) srl to_integer(unsigned(inputB)));
Run Code Online (Sandbox Code Playgroud)
(顺便说一句,作为一个无时钟电路与能否使用移位运算符无关.决定数据类型的是什么.这个移位操作将由合成器转换为相同的逻辑,如果你写了更多的东西案例陈述的复杂性全部由手工扩展.)