$display 显示意外的高阻抗“z"输出 [英] $display shows unexpected high impedance 'z' output

查看:23
本文介绍了$display 显示意外的高阻抗“z"输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

module hi (
input wire clk,
output wire [6:0] a
);

wire [7:0] b; 
assign b= 8'd24;
assign a[6:0]   = b[7:1];

initial $display ("%d", a);

endmodule

我得到一个高阻抗z"输出.我哪里出错了?

I get a high impedance 'z' output. Where am i going wrong?

推荐答案

您没有为 assign 语句提供在线路上传播值的机会.initial 块首先执行.在 $display 之前添加一个延迟,或者使用 $strobe 代替.

You didn't give the assign statement a chance to propagate the values on the wires. The initial block executes first. Add a delay before the $display, or use $strobe instead.

这篇关于$display 显示意外的高阻抗“z"输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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