Accumulator in VHDL

被刻印的时光 ゝ 提交于 2019-12-24 18:15:56

问题


this my code for an accumulator:

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity akkumulator is
    generic (N : natural:=1);
    port(rst: in bit;
         clk: in bit;
         B : in  natural range 0 to N-1;
         A : out natural range 0 to N-1);
end akkumulator;

architecture verhalten of akkumulator is
begin
    p1: process(rst, clk)
       variable ergebnis : natural range 0 to N-1;
    begin
       if (rst = '1') then
           ergebnis := 0;
       elseif (clk'event and clk = '1') then
           ergebnis := ergebnis + B;
       end if;
       A <= ergebnis;
    end process;
end verhalten;

When i compile i get these error messages:

** Error: C:/Modeltech_pe_edu_10.4a/examples/akkumulator.vhd(20): near "then": (vcom-1576) expecting == or '+' or '-' or '&'.

** Error: C:/Modeltech_pe_edu_10.4a/examples/akkumulator.vhd(25): VHDL Compiler exiting

Why?

来源:https://stackoverflow.com/questions/48171924/accumulator-in-vhdl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!