You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SystemVerilog两位乘3模块仿真输出为X的问题求助

SystemVerilog两位乘3模块仿真输出为X的问题求助

大家好,我最近在写SystemVerilog代码实现两位数字乘3并输出四位结果的功能,但仿真的时候输出一直显示X,我自己反复检查了写的模块,没发现具体问题,想请各位大佬帮忙看看哪里出问题了。

我的部分模块代码如下:

//////////////////////////////////////////////////////////////////////////////////
// Parinaz Jafaripourbaghali
//22201152
//Section 2
//////////////////////////////////////////////////////////////////////////////////
`timescale 1ns / 1ps
module half_adder(input wire a, b,
                   output wire s, c);
    assign s = a ^ b;
    assign c = a & b;
endmodule

module OR2input(input wire a, b,
                output wire y);
    assign y = a | b;
endmodule

module fulladder(input wire a, b, cin,
                  output wire s, c);
    wire n0, n1, n2;
    half_adder ha1(a, b, n0, n1);
    half_adder ha2(n0, cin, s, n2);
    OR2input or2in(n2, n1, c);
endmodule
module two_bitAdder(input wire a0, a1, b0, b1, cin,
 output wire s0, s1, c);
 wire c0;
 full...

补充说明一下:我是通过加法器来实现乘3的逻辑(毕竟x*3等于x加x再加x),但目前仿真时输出始终是未知态X,不确定是模块连接的问题,还是测试台的输入初始化有问题,或者是我没写完的two_bitAdder模块里有隐藏bug?

麻烦各位帮忙分析下可能的原因,谢谢大家!

备注:内容来源于stack exchange,提问作者parinaz jafarypour

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.17 11:14:36