重學Verilog(1)
阿新 • • 發佈:2018-09-28
並行 tab ... 寄存器變量 module src begin 9.png join
1.線與、線或功能
wor
1 module WO(A, B, C, D, WireOR) 2 input A,B,C,D; 3 output WireOr; 4 wor WireOr; 5 assign WireOr = A^B; 6 assign WireOr = C&D; 7 endmodule
2.三態門
assign WireTri = (En) ? 1‘bZ : (A^V)
3.assign 和 deassign : 在過程語塊中對寄存器變量強制賦值和放開;
force 和 release : 在過程語塊中對寄存器和線網強制賦值和放開;
moduleDEF(D, Clr, Clk, Q) input D, Clr, Clk; output Q; reg Q; always @ (Clr) begin if (!Clr) assign Q = 0; else deassign Q; end always @ (negedge Clk) Q <= D; endmodule
4.fork..join...
並行語句,內部並行執行
initial fork DataBin = 0; # 6 DataBin = 0; # 4 DataBin = 1; # 2 DataBin = 0; join
重學Verilog(1)