LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; use ieee.std_logic_arith.all; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY YMQ IS PORT(AIN4 : IN STD_LOGIC_VECTOR(3 DOWNTO 0); DOUT7 :OUT STD_LOGIC_VECTOR(6 DOWNTO 0)); END YMQ; ARCHITECTURE ART OF YMQ IS BEGIN PROCESS(AIN4) BEGIN CASE AIN4 IS WHEN "0000"=>DOUT7<="1111110"; WHEN "0001"=>DOUT7<="0110000"; WHEN "0010"=>D0UT7<="1101101"; WHEN "0011"=>DOUT7<="1111001"; WHEN "0100"=>D0UT7<="0110011"; WHEN "0101"=>DOUT7<="1011011"; WHEN "0110"=>DOUT7<="1011111"; WHEN "0111"=>D0UT7<="1110000"; WHEN "1000"=>DOUT7<="1111111"; WHEN "1001"=>DOUT7<="1111011"; WHEN OTHERS=>DOUT7<="0000000"; END CASE; END PROCESS; END ART;
时间: 2023-07-06 15:41:07 浏览: 177
PID.rar_PID控制IEEE文章_VHDL PID_logic_pid vhdl
代码中存在一个拼写错误,将DOUT7写成了D0UT7。这个错误会导致CASE语句中的第三个和第五个分支的赋值语句出现错误,应该把D0UT7改成DOUT7。修改后的代码如下:
```
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY YMQ IS
PORT(AIN4 : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
DOUT7 : OUT STD_LOGIC_VECTOR(6 DOWNTO 0));
END YMQ;
ARCHITECTURE ART OF YMQ IS
BEGIN
PROCESS(AIN4)
BEGIN
CASE AIN4 IS
WHEN "0000" => DOUT7 <= "1111110";
WHEN "0001" => DOUT7 <= "0110000";
WHEN "0010" => DOUT7 <= "1101101";
WHEN "0011" => DOUT7 <= "1111001";
WHEN "0100" => DOUT7 <= "0110011";
WHEN "0101" => DOUT7 <= "1011011";
WHEN "0110" => DOUT7 <= "1011111";
WHEN "0111" => DOUT7 <= "1110000";
WHEN "1000" => DOUT7 <= "1111111";
WHEN "1001" => DOUT7 <= "1111011";
WHEN OTHERS => DOUT7 <= "0000000";
END CASE;
END PROCESS;
END ART;
```
经过修改后,代码中的语法错误已经被修正。
阅读全文