使用循环为多个输入门编写VHDL代码

使用循环为多个输入门编写VHDL代码,vhdl,quartus,circuit,digital,Vhdl,Quartus,Circuit,Digital,我一直在使用Quartus为以下VHDL实现编写程序: 一个多级停车指示器,其中我有6层(楼层),每层有5个停车位。在入口处,有两个LED,绿色和红色;当每层楼的所有空间都填满时,红色LED亮起,绿色LED熄灭。如果有空间,则绿色LED亮起,红色LED熄灭。 这是我编写的代码,它模拟时没有任何错误: library IEEE; use IEEE.std_logic_1164.all; entity parking is port ( space

我一直在使用Quartus为以下VHDL实现编写程序:

一个多级停车指示器,其中我有6层(楼层),每层有5个停车位。在入口处,有两个LED,绿色和红色;当每层楼的所有空间都填满时,红色LED亮起,绿色LED熄灭。如果有空间,则绿色LED亮起,红色LED熄灭。 这是我编写的代码,它模拟时没有任何错误:

    library IEEE;
    use IEEE.std_logic_1164.all;
    
    entity parking is 
    port ( space      : in std_logic_vector (4 downto 0) ;
             level    : buffer std_logic_vector (1 downto 0);
             LEDR      : out std_logic;
             LEDG      : out std_logic );
    end parking;

    architecture behavioral of parking is

begin 

        level(0) <= not(space(0) and space(1) and space(2) and space(3) and space(4));
        level(1) <= not(space(0) and space(1) and space(2) and space(3) and space(4));
        LEDR    <= not((level(0)) and (level(1)));
        LEDG    <=    (level(0)) and (level(1));
end behavioral;
IEEE库;
使用IEEE.std_logic_1164.all;
实体停车场是
端口(空间:标准逻辑向量(4到0);
级别:缓冲器标准逻辑向量(1到0);
LEDR:输出标准逻辑;
LEDG:输出标准逻辑);
末端停车;
停车场的建筑是
开始
级别(0)