Board logo

标题: 转换命令应该怎么用?? [打印本页]

作者: qin    时间: 2003-8-29 15:08     标题: 转换命令应该怎么用??

library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_signed.all; use ieee.std_logic_arith.all; entity??am is port( a,b :in std_logic_vector(0 downto 0); c: out std_logic_vector(0 downto 0)??); end; architecture bh of am is variable?? x,y,z : integer; begin x<=conv_integer(a); y<=conv_integer(b); z<=x+y; c<=conv_std_logic_vector(z); end; 在这个简单的程序中, 为什么在编译时, C<=CONV_STD_LOGIC_VECTOR(Z) 在这里总是出错,但 x<=conv_integer(a); y<=conv_integer(b);都能通过, 这些转换命令应该怎么用?? TO_STD_LOGIC_VECTOR(); TO_BIT_VECTOR(); TO_STD_LOGIC; TO_BIT(); CONV_INTEGER(); CONV_UNSIGNED(); CONV_SIGNED(); CONV_STD_LOGIC_VECTOR();
作者: hstaii@163.net    时间: 2003-8-29 15:08

conv_std_logic_vector(z,n), n 是z的二进制位数,看看help即可




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0