首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

转换命令应该怎么用??

转换命令应该怎么用??

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();
conv_std_logic_vector(z,n), n 是z的二进制位数,看看help即可
返回列表