首页 > 解决方案 > 我在计数器中定义“计数”的方式类型的 VHDL 错误

问题描述

我的代码有问题,我不知道为什么。它告诉我行中有错误。

    signal count : integer;

    begin
         sync:

我不确定在这里做什么。任何帮助都会很棒。艾伦。

    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;


    entity COUNTER is
    Port (   Reset      : in   STD_LOGIC;
             Clock      : in   STD_LOGIC;
             CountReset : in   STD_LOGIC;
             GC         : out  STD_LOGIC;
             AC         : out  STD_LOGIC;
             WC         :out  STD_LOGIC
                  );
    end COUNTER;


    architecture BEH of COUNTER is
    signal count : integer;

    begin
         sync:
         process (Reset,Clock)
         begin 
         count <= 0;
              if (Reset = '1') then
                    count <=0;
            elsif (CountReset = '1') then
                count <=0;
              elsif (rising_edge(Clock)) then
                    count <= count + 1;
              end if;
         end process sync;

         GC <= '1' when count = 500 else '0';
         AC <= '1' when count = 300 else '0';
         WC <= '1' when count = 500 else '0';
    end BEH;

标签: vhdl

解决方案


推荐阅读