名称:基于FPGA的8位booth乘法器Verilog代码Quartus仿真
软件:Quartus
语言:Verilog
代码功能:8位booth乘法器
FPGA代码Verilog/VHDL代码资源下载:www.hdlcode.com
设计文档:
1. 工程文件
2. 程序文件
3. 程序编译
4. 资源占用
5. RTL图
6. 仿真文件
7. 仿真图
部分代码展示:
module Multiplier_8bit(mult_A, mult_B, mult_product);
parameter width=8;
input [width-1:0] mult_A;
input [width-1:0] mult_B;
output [width+width-1:0] mult_product;
reg [width+width-1:0] mult_product;
integer Count;
reg [width+width:0] PA,right;
always @ (mult_A or mult_B)
begin
PA[width+width:0]={16'b0,mult_A,1'b0}; //{mult_product, mult_A, 1'b0}
for(Count=0;Count<width;Count=Count+1)
begin
case(PA[1:0])
2'b10://
begin
//PA=PA-mult_B ;
PA[width+width:width+1]=PA[width+width:width+1] - mult_B[width-1:0];
rightsh1(PA,right);
end
2'b01:
begin
//PA=PA+mult_B
PA[width+width:width+1]=PA[width+width:width+1] + mult_B[width-1:0];
rightsh1(PA,right);
end
点击链接获取代码文件:http://www.hdlcode.com/index.php?m=home&c=View&a=index&aid=674
阅读全文
313