|
技术交流 | 电路欣赏 | 工控天地 | 数字广电 | 通信技术 | 电源技术 | 测控之家 | EMC技术 | ARM技术 | EDA技术 | PCB技术 | 嵌入式系统 驱动编程 | 集成电路 | 器件替换 | 模拟技术 | 新手园地 | 单 片 机 | DSP技术 | MCU技术 | IC 设计 | IC 产业 | CAN-bus/DeviceNe |
请高手看看这段VHDL的错误 |
作者:sdnd2000 栏目:EDA技术 |
用VHDL写的8位比较器,麻烦大家帮小弟找找错误,用MAXPLUS2编译的,好像应该是数据类型不对吧,但我不会改,大家看看吧 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity compare is PORT( a,b: in std_logic_vector( 7 downto 0); d,e,f: out integer range 1 downto 0); end entity compare; architecture behave of compare is begin PROCESS(a,b) variable m: integer range 7 downto 0; variable n: integer range 7 downto 0; begin m:= conv_integer(a); n:= conv_integer(b); if m=n then d<='1'; elsif m>n then e<='1'; elsif n>m then f<='1'; end if; end PROCESS; end architecture behave; |
2楼: | >>参与讨论 |
作者: picklas 于 2007/5/12 17:33:00 发布:
re 因为没看到具体的错误提示,只能猜测了 1 conv_integer是不是实现 std_logic_vector向integer的转化,我记不清了 2 conv_integer两边的数据范围不匹配 8bit std_logic_vector的数据范围-128~+128 或 0-256 ,0-7的范围不够。 |
|
|
Copyright © 1998-2006 tgdrjb.cn 浙ICP证030469号 |