第9章verilog_HDL_程序设计
(1)级连加法器 8×8并行乘法器的门级综合原理图 (2)移位相加乘法器 移位相加乘法器将乘法变为加法实现,其设计思路是:乘法通过逐次移位相加实现,每次判断乘数的最低位,若为1则将被乘数移位相加。 (3)加法树乘法器 【例9.7】 8位加法树乘法器 module add_tree(out,a,b,clk); input[7:0] a,b; input clk; output wire[15:0] out; wire[14:0] out1,c1; wire[12:0] out2; wire[10:0] out3,c2; wire[8:0] out4; reg[14:0] temp0; reg[13:0] temp1; reg[12:0] temp2; reg[11:0] temp3; reg[10:0] temp4; reg[9:0] temp5; reg[8:0] temp6; reg[7:0] temp7; function[7:0] mult8x1; //该函数实现8×1乘法 input[7:0] operand; input sel; begin mult8x1=(sel)?(operand):8 end endfunction always @(posedge clk) //调用函数实现操作数b各位与操作数a的相乘 begin temp7=
原创力文档

文档评论(0)