reg与wire的用法,证明reg可以在右边,wire型在左边,来作组合逻辑处理。

1,RTL



module a(
clk,
 a,
 b,
 y,
 out
    );
input clk;
input a, b;
output wire y;
output reg out;

reg c, d;

always@(posedge clk)
    begin
        c <= a;
        d <= b;
    end

assign y = c + d;

always@(posedge clk)
    begin
        out <= y;
    end
    
endmodule

2,生成的原理图

reg与wire的用法,证明reg可以在右边,wire型在左边,来作组合逻辑处理。-LMLPHP

09-19 16:19