library IEEE; use IEEE.std_logic_1164.all; package P_alarm is subtype T_digital is integer range 0 to 7; subtype T_short is integer range 0 to 65535; type T_clock_time is array(3 downto 0) of T_digital; type T_display is array(3 downto 0) of Std_logic_vector(6 downto 0); type seg7 is array(0 to 7) of Std_logic_vector(6 downto 0); constant Seven_seg:seg7:=("0000000001",--0 "0000000010",--1 "0000000100",--2 "0000001000",--3 "0000010000",--4 "0000100000",--5 "0001000000",--6 "0010000000",--7 "0100000000",--8 "1000000000",--9); end P_alarm; 这是一个7段数码显示器的程序包,我感觉type和subtype部分的申明有问题,不过编译的时候也通不过,说最后一句end P_alarm这里的错误Error (10500): VHDL syntax error at P_alarm.vhd(19) near text "end"; expecting "(", or an identifier ("end" is a reserved keyword), or unary operator,我不清楚是什么情况,请谁帮我看一下问题在哪里,我实在找不到问题的出处。还有我想7段显示器能显示0~9一共10个数字,subtype T_digital is integer range 0 to 7那这里不应该是0 to 9么?type seg7 is array(0 to 7) of Std_logic_vector(6 downto 0);这里的array里面的范围不也应该是0 to 9么?为什么是0 to 7?我想不明白 他的目的这里想显示成这样的效果“19:22”这个样子,请谁帮我看一下我想的是不是正确的? |