verilog中,何时用reg和wire

何时用?

组合逻辑用wire,时序逻辑用reg。
reg 可以存储数据,wire则就是一根线,只能传递数据。

比如?

时序逻辑

always @( posedge clk or negedge rst_n)
begin
	// big river goes to the east 
end
initial 
begin
	//  All the start follows Beidou
end

组合逻辑

assign hey = hey; // Bagayalu
always @( *)
begin
	// wa ou
end

你可能感兴趣的:(其他,fpga开发,FPGA)