Vector VHDL标准逻辑向量移位寄存器
有人能告诉我,如何制作12位std_逻辑_向量项的移位寄存器吗 看看下面的例子。VECTOR_WIDTH是每个std_逻辑_向量中的位数(本例中为12)。FIFO_DEPTH是移位寄存器中需要的向量数Vector VHDL标准逻辑向量移位寄存器,vector,vhdl,shift-register,Vector,Vhdl,Shift Register,有人能告诉我,如何制作12位std_逻辑_向量项的移位寄存器吗 看看下面的例子。VECTOR_WIDTH是每个std_逻辑_向量中的位数(本例中为12)。FIFO_DEPTH是移位寄存器中需要的向量数 library ieee; use ieee.std_logic_1164.all; entity vectors_fifo is generic ( VECTOR_WIDTH: natural := 12; FIFO_DEPTH: natural :=
library ieee;
use ieee.std_logic_1164.all;
entity vectors_fifo is
generic (
VECTOR_WIDTH: natural := 12;
FIFO_DEPTH: natural := 100
);
port (
clock: in std_logic;
reset: in std_logic;
input_vector: in std_logic_vector(VECTOR_WIDTH-1 downto 0);
output_vector: out std_logic_vector(VECTOR_WIDTH-1 downto 0)
);
end;
architecture rtl of vectors_fifo is
type fifo_memory_type is array (natural range <>) of std_logic_vector;
signal fifo_memory: fifo_memory_type(0 to FIFO_DEPTH-1)(VECTOR_WIDTH-1 downto 0);
begin
process (clock, reset) begin
if reset then
fifo_memory <= (others => (others => '0'));
elsif rising_edge(clock) then
fifo_memory <= input_vector & fifo_memory(0 to FIFO_DEPTH-2);
end if;
end process;
output_vector <= fifo_memory(FIFO_DEPTH-1);
end;
ieee库;
使用ieee.std_logic_1164.all;
实体向量_fifo是
一般的(
矢量_宽度:自然:=12;
先进先出深度:自然深度:=100
);
港口(
时钟:标准逻辑;
复位:在标准逻辑中;
输入向量:标准逻辑向量(向量宽度-1到0);
输出向量:输出标准逻辑向量(向量宽度-1到0)
);
结束;
向量rtl的体系结构\u fifo是
类型fifo_内存_类型是标准逻辑_向量的数组(自然范围);
信号fifo_存储器:fifo_存储器类型(0至fifo_深度-1)(矢量_宽度-1至0);
开始
过程(时钟、复位)开始
如果重置,则
先进先出存储器(其他=>0');
elsif上升沿(时钟),然后
先进先出存储器