【问题标题】:Invalid module instantiation无效的模块实例化
【发布时间】:2020-12-04 11:31:25
【问题描述】:

我正在尝试获取浮点输入并将其拆分为符号、尾数和指数值。在第 7 行和第 8 行,我的编译器(我使用的是 Icarus Verilog)给出了错误:

无效的模块实例化

即使我没有在这里实例化任何模块。

module test(Input, exp, sign, mant);
  input [31:0]Input;
  output [7:0]exp;
  output sign;
  output [22:0]mant;

  mant = Input[22:0];
  exp = Input[30:23];
  sign = Input[31];
endmodule

【问题讨论】:

    标签: verilog iverilog


    【解决方案1】:

    你需要使用assign关键字进行连续赋值:

    module test(Input, exp, sign, mant);
      input [31:0]Input;
      output [7:0]exp;
      output sign;
      output [22:0]mant;
    
      assign mant = Input[22:0];
      assign exp = Input[30:23];
      assign sign = Input[31];
    endmodule
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-21
      • 2014-05-30
      • 2014-06-04
      • 2016-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多