无法确定运算符"/"的定义-找到0个可能的定义 [英] can't determine definition of operator ""/"" -- found 0 possible definitions

查看:116
本文介绍了无法确定运算符"/"的定义-找到0个可能的定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;


port (
  clk, rst : in std_logic;
  data_in : in  std_logic_vector(7 downto 0);
  data_out : out std_logic_vector(7 downto 0)
 );


signal div : std_logic_vector(7 downto 0);

如何解决此行上的以下错误:

How can I solve the following error on this line:

div <= data_in / "00001011";

错误:无法确定运算符"/"的定义-找到0可能的定义

error : can't determine definition of operator ""/"" -- found 0 possible definitions

推荐答案

如果您确实要进行这种划分(这是资源密集型的),请使用:

If you really want to do this division (it's resource-intensive) use:

div <= std_logic_vector(unsigned(data_in)/unsigned'("00001011"));

VHDL是强类型的,因此您必须在单位之间进行显式转换.有些行的结尾可能会很长!

VHDL is strongly typed and you must therefore explicitly convert between units. Some lines can end up rather long!

这篇关于无法确定运算符"/"的定义-找到0个可能的定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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