打印

请教VHDL中程序包体封装问题

[复制链接]
2759|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
worrior_1|  楼主 | 2009-3-18 15:21 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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”这个样子,请谁帮我看一下我想的是不是正确的?

相关帖子

沙发
hbsun2007| | 2009-3-28 16:33 | 只看该作者

"1000000000",--9);貌似没有逗号吧?

使用特权

评论回复
板凳
worrior_1|  楼主 | 2009-3-28 21:20 | 只看该作者

这个问题我已经解决了,不好意思

这个问题我已经解决了,不好意思忘了说了。
那个包体封装的时候"1000000000",--9);
不能直接在,后面跟"--"标注符号,如果跟了的话,9和);全部都变成标注了。
粗心大意了,希望各位新手引以为戒

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

13

主题

49

帖子

0

粉丝