library IEEE;<br />use IEEE.std_logic_1164.all;<br />package P_alarm is<br /> subtype T_digital is integer range 0 to 7;<br /> subtype T_short is integer range 0 to 65535;<br /> type T_clock_time is array(3 downto 0) of T_digital;<br /> type T_display is array(3 downto 0) of Std_logic_vector(6 downto 0);<br /> type seg7 is array(0 to 7) of Std_logic_vector(6 downto 0);<br /> constant Seven_seg:seg7:=("0000000001",--0<br /> "0000000010",--1<br /> "0000000100",--2<br /> "0000001000",--3<br /> "0000010000",--4<br /> "0000100000",--5<br /> "0001000000",--6<br /> "0010000000",--7<br /> "0100000000",--8<br /> "1000000000",--9);<br />end P_alarm;<br />这是一个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?我想不明白<br />他的目的这里想显示成这样的效果“19:22”这个样子,请谁帮我看一下我想的是不是正确的? |
|