|
发表于 2015-10-9 13:56:24
|
显示全部楼层
- `timescale 1ns/1ps
- module test();
- reg a;
- reg d;
- wire b;
- wire c;
- wire e;
- reg clk;
- always #10 clk = ~clk;
- initial begin
- clk =1'b0;
- d = 1'bx;
- #100;
- a = 1'b1;
- #100;
- a = 1'b0;
- #100;
- d = 1'bz;
- #100;
- $finish;
- end
- pulldown(b);
- pulldown(c);
- pulldown(e);
- assign b = a;
- assign e = d;
- always@(posedge clk) begin
- $display("@%0t a = %b b = %b c= %b d = %b e = %b ",$realtime,a,b,c,d,e);
- end
- endmodule
复制代码
仿真的输出结果为:
- @10000 a = x b = x c= 0 d = x e = x
- @30000 a = x b = x c= 0 d = x e = x
- @50000 a = x b = x c= 0 d = x e = x
- @70000 a = x b = x c= 0 d = x e = x
- @90000 a = x b = x c= 0 d = x e = x
- @110000 a = 1 b = 1 c= 0 d = x e = x
- @130000 a = 1 b = 1 c= 0 d = x e = x
- @150000 a = 1 b = 1 c= 0 d = x e = x
- @170000 a = 1 b = 1 c= 0 d = x e = x
- @190000 a = 1 b = 1 c= 0 d = x e = x
- @210000 a = 0 b = 0 c= 0 d = x e = x
- @230000 a = 0 b = 0 c= 0 d = x e = x
- @250000 a = 0 b = 0 c= 0 d = x e = x
- @270000 a = 0 b = 0 c= 0 d = x e = x
- @290000 a = 0 b = 0 c= 0 d = x e = x
- @310000 a = 0 b = 0 c= 0 d = z e = 0
- @330000 a = 0 b = 0 c= 0 d = z e = 0
- @350000 a = 0 b = 0 c= 0 d = z e = 0
- @370000 a = 0 b = 0 c= 0 d = z e = 0
- @390000 a = 0 b = 0 c= 0 d = z e = 0
复制代码 |
|