小弟初学
FPGA,以前做实验用过,现在自学发现quartus11.0不能
仿真了,我习惯边学边仿真,只能依葫芦画瓢写了个testbench,但我没啥基础,写完发现输入一直是高阻态,求各位前辈帮忙解答解答,万分感谢~源码:
module test(clk,a,b);
input clk,a;
output b;
reg b = 0;
always@(posedge clk)
begin
b <= a;
end
endmodule
测试:
`
timescale 1 ns/ 1 ps
module test_vlg_tst();
reg a;
reg clk;
wire b;
test i1 (
.a(a),
.b(b),
.clk(clk)
);
initial begin
a = 1;
forever
#20 a = ~a;
end
initial begin
clk = 0;
forever
#10 clk = ~clk;
end
endmodule
仿真结果:
clk,a一直是高阻态,b是0。
initial
begin
clk=0;
a=1;
forever #20 a=~a;
end
initial
begin
clk=0;
a=1;
forever #20 a=~a;
end
sampleofbus sampleofbus(.a(a),
一周热门 更多>