vhdl - # ** 致命:(vsim-3807)端口的组件和实体之间的类型不匹配
问题描述
我的 VHDL 文件有一些问题:
我想乘以 14 位值。为此,我只是使用了 Quartus prime 中提供的模板并稍作修改。
编译我的代码工作正常,但如果我尝试使用 .vwf 文件模拟它,我总是会得到Error (vsim-3807)
.
这是我的代码:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity MultiplierAndCut is
port
(
a : in signed (13 downto 0);
b : in signed (13 downto 0);
clk : in std_logic;
clear : in std_logic;
result : out signed (27 downto 0)
);
end entity;
architecture rtl of MultiplierAndCut is
-- Declare I/O registers
signal a_reg, b_reg : signed (13 downto 0);
signal out_reg : signed (27 downto 0);
begin
process (clk, clear)
begin
if (clear = '1') then
-- Reset all register data to 0
a_reg <= (others => '0');
b_reg <= (others => '0');
out_reg <= (others => '0');
elsif (rising_edge(clk)) then
-- Store input and output values in registers
a_reg <= a;
b_reg <= b;
out_reg <= a_reg * b_reg;
end if;
end process;
-- Output multiplication result
result <= out_reg;
end rtl;
对于我使用的模拟a = [0 0 0 0 0 0 0 1 0 0 0 0 0 0]
(在我的系统中应该代表小数点 1)和b = [0 0 0 0 0 0 0 0 0 1 0 0 0 0]
(应该代表小数点 0.25)
我在 .vwf 文件中的模拟如下所示:
预先感谢您的帮助。
解决方案
推荐阅读
- javascript - 单击 HTML 按钮运行 JSX 脚本
- c++ - 为模板类创建两个指针并使用当前选择的可能?
- r - 使用 if & 语句
- reactjs - 反应本机,无效尝试传播非无误实例
- c# - DropDownList 未在 MVC Razor .net 中显示 SelectedValue
- google-apps-script - 如何解决谷歌脚本的错误“getLastRow”?
- java - 如何摆脱 - “java.io.IOException:系统找不到指定的路径”
- r - 在 dplyr 1.0 中使用 tidyeval 一次汇总多个函数
- sql - 列名“total_counted”无效
- reactjs - 如何使用 GraphQL 查询 Wordpress 关系字段?