【发布时间】:2017-01-10 11:16:15
【问题描述】:
library ieee;
use ieee.std_logic_1164.all;
entity basic_shift_register_with_multiple_taps is
generic
(
DATA_WIDTH : natural := 8
);
port
(
clk : in std_logic;
enable : in std_logic;
sr_one : in std_logic_vector((DATA_WIDTH-1) downto 0);
sr_two : in std_logic_vector((DATA_WIDTH-1) downto 0);
sr_out : out std_logic_vector(2*(DATA_WIDTH-1) downto 0)
);
end entity ;
architecture rtl of basic_shift_register_with_multiple_taps is
signal sig_out :std_logic_vector(2*(DATA_WIDTH-1) downto 0);
variable count : integer := 0;
variable count1 : integer := 0;
begin
process (clk,enable,sr_one,sr_two,sig_out)
begin
if(enable = '0' or count = 16) then
count := 0;
count1 := 0;
else if (clk'event and clk='1') then
sig_out(count) <= sr_one(count1);
count := count + 1;
else --if (clk'event and clk='0') then--
sig_out(count) <= sr_two(count1);
count := count + 1;
end if;
count1 := count1 + 1;
(54) end process;
sr_out <= sig_out;
(58) end rtl;
错误:
错误 (10500):teste.vhd(54) 靠近文本“进程”的 VHDL 语法错误;期待“如果”
错误 (10500):在 teste.vhd(58) 文本“rtl”附近出现 VHDL 语法错误;期待“如果”
【问题讨论】:
-
它抱怨缺少“end if”。我的猜测是你手边没有 VHDL 语法指南,所以你猜到了如何拼写“elsif”而错过了。
标签: vhdl