模块一
module multiplier ( product,a0,a1 );
parameter a0_width=8;
parameter a1_width=8; //localparam product_width=a0_width+a1_width;
output [ product_width-1:0 ] product;
input [ a0_width-1:0 ] a0;
input [ a1_width-1:0 ] a1;
generate
if ( a0_width<8 ) || ( a1_width<8 )
cal_multiplier # ( a0_width,a1_width ) m0 ( product,a0,a1 );
else
tree_multiplier # ( a0_width,a1_width ) m0 ( product,a0,a1 );
endgenerate
endmodule
模块二:
module adder ( co,sum,a0,a1,ci );
parameter N=4;
output [ N-1:0 ] sum;
output co;
input [ N-1:0 ] a0,a1;
input ci;
generate
case ( N )
1:adder_1bit adder1 ( co,sum,a0,a1,ci );
2:adder_2bit adder2 ( co,sum,a0,a1,ci );
default : adder_cla # ( N ) adder3 ( co,sum,a0,a1,ci );
endcase
endgenerate
endmodule
请问两个模块里的生成块含义是什么,谢谢
|