VHDL _ TO_INTEGER [英] VHDL _ TO_INTEGER

查看:1229
本文介绍了VHDL _ TO_INTEGER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对VHDL中的问题感到困惑.

I'm confused about a problem I have in VHDL.

我做一个VGA_display_ characters,所以我想用to_integer无符号将一些std_logic_vectors转换成整数,然后我想恢复健康, 这样,我无法同时使用这些库.

I make one VGA_display_ characters, so I wanna convert some std_logic_vectors into integer by to_integer unsigned, then I wanna recuperate, in this way I can't use those libraries in the same time.

ieee.std_logic_arith.allieee.numeric_std.all quartus给出的错误:

ieee.std_logic_arith.all and ieee.numeric_std.all The error given by quartus:

(错误(10621):接口.vhd(34)上的VHDL使用子句错误:多个使用子句"导入了一个简单名称为"unsigned"的声明-这些声明都不是直接可见的 错误(10784):syn_arit.vhd(26)的HDL错误:请参见对象未签名"的声明 我的代码如下:

(Error (10621): VHDL Use Clause error at interface.vhd(34): more than one Use Clause imports a declaration of simple name "unsigned" -- none of the declarations are directly visible Error (10784): HDL error at syn_arit.vhd(26): see declaration for object "unsigned" bellow my code :

to_integer

conv_std_logic_vector

推荐答案

我的建议是:不要使用ieee.std_logic_arith.它是专有的(不是VHDL的正式组成部分),并且引起的问题远远超过其解决的问题.

My advice is: don't use ieee.std_logic_arith. It's proprietary (not officially part of VHDL) and causes far, far more problems than it solves.

仅使用numeric_std,您就可以做所需的一切:

Use only numeric_std and you can do everything you need:

to_integer(unsigned(X))to_integer(signed(X)),其中Xstd_logic_vector.

要向另一个方向转换:

std_logic_vector(to_unsigned(K, N))std_logic_vector(to_signed(K, N)),其中K是要转换的整数,N是位数.

std_logic_vector(to_unsigned(K, N)) and std_logic_vector(to_signed(K, N)) where K is the integer to convert and N is the number of bits.

这篇关于VHDL _ TO_INTEGER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆