没有合适的资源?快使用搜索试试~ 我知道了~
华莱士乘法器的代码
4星 · 超过85%的资源 需积分: 38 40 下载量 165 浏览量
2012-04-24
21:07:32
上传
评论 2
收藏 13KB TXT 举报
温馨提示
试读
8页
华莱士乘法器的代码,八位乘法的输入,十六位输出
资源推荐
资源详情
资源评论
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// //
// Create Date: 00:53:03 03/16/2008
// Design Name: Multiplier
// Module Name: wallace_multiplier
// Project Name: MULTIPLIERS
// Tool versions: DC 2007.03
// Description: Wallace tree multiplier built using full adders and
// half adders
//
// Dependencies: FULL_ADDER verilog code
//
// Revision:
//
//////////////////////////////////////////////////////////////////////////////////
module wallace_multiplier(output reg [15:0] product, input [7:0] multiplicand, multiplier, input clock, clear);
integer i, j ;
wire [63:0] s ,c ; // -- the signals which will carry the intermediate values
reg p [7:0][7:0]; // -- array which stores the partial products
always@(multiplier, multiplicand)
begin
// creating the partial products.
//////////////////////////////////////////////////////////////////////////////////
// //
// Create Date: 00:53:03 03/16/2008
// Design Name: Multiplier
// Module Name: wallace_multiplier
// Project Name: MULTIPLIERS
// Tool versions: DC 2007.03
// Description: Wallace tree multiplier built using full adders and
// half adders
//
// Dependencies: FULL_ADDER verilog code
//
// Revision:
//
//////////////////////////////////////////////////////////////////////////////////
module wallace_multiplier(output reg [15:0] product, input [7:0] multiplicand, multiplier, input clock, clear);
integer i, j ;
wire [63:0] s ,c ; // -- the signals which will carry the intermediate values
reg p [7:0][7:0]; // -- array which stores the partial products
always@(multiplier, multiplicand)
begin
// creating the partial products.
for (i = 0; i <= 7; i = i + 1)
for (j = 0; j <= 7; j = j + 1)
p[j][i] <= multiplicand[j] & multiplier[i];
/* all the partial products have been obtained and stored in a array of 8 X 8 matrix.
-- a7 a6 a5 a4 a3 a2 a1 a0
-- b7 b6 b5 b4 b3 b2 b1 b0
-----------------------------
-- a7b0 a6b0 a5b0 a4b0 a3b0 a2b0 a1b0 a0b0 --
-- a7b1 a6b1 a5b1 a4b1 a3b1 a2b1 a1b1 a0b1 |
-- a7b2 a6b2 a5b2 a4b2 a3b2 a2b2 a1b2 a0b2 |
-- a7b3 a6b3 a5b3 a4b3 a3b3 a2b3 a1b3 a0b3 |
-- a7b4 a6b4 a5b4 a4b4 a3b4 a2b4 a1b4 a0b4 |-- Stored in array p
-- a7b5 a6b5 a5b5 a4b5 a3b5 a2b5 a1b5 a0b5 |
-- a7b6 a6b6 a5b6 a4b6 a3b6 a2b6 a1b6 a0b6 |
-- a7b7 a6b7 a5b7 a4b7 a3b7 a2b7 a1b7 a0b7 __|
--------------------------------------------------------------------------------------
*/
end
/*-- first stage of wallace tree multiplier, first set of three rows are identified
-- a7b0 a6b0 a5b0 a4b0 a3b0 a2b0 a1b0 a0b0
-- a7b1 a6b1 a5b1 a4b1 a3b1 a2b1 a1b1 a0b1
-- a7b2 a6b2 a5b2 a4b2 a3b2 a2b2 a1b2 a0b2
---------------------------------------------------------------------------------
-- a7b2 s(7) s(6) s(5) s(4) s(3) s(2) s(1) s(0) a0b0( which is stored in p(0)(0)
-- c(7) c(6) c(5) c(4) c(3) c(2) c(1) c(0)
---------------------------------------------------------------------------------
for (j = 0; j <= 7; j = j + 1)
p[j][i] <= multiplicand[j] & multiplier[i];
/* all the partial products have been obtained and stored in a array of 8 X 8 matrix.
-- a7 a6 a5 a4 a3 a2 a1 a0
-- b7 b6 b5 b4 b3 b2 b1 b0
-----------------------------
-- a7b0 a6b0 a5b0 a4b0 a3b0 a2b0 a1b0 a0b0 --
-- a7b1 a6b1 a5b1 a4b1 a3b1 a2b1 a1b1 a0b1 |
-- a7b2 a6b2 a5b2 a4b2 a3b2 a2b2 a1b2 a0b2 |
-- a7b3 a6b3 a5b3 a4b3 a3b3 a2b3 a1b3 a0b3 |
-- a7b4 a6b4 a5b4 a4b4 a3b4 a2b4 a1b4 a0b4 |-- Stored in array p
-- a7b5 a6b5 a5b5 a4b5 a3b5 a2b5 a1b5 a0b5 |
-- a7b6 a6b6 a5b6 a4b6 a3b6 a2b6 a1b6 a0b6 |
-- a7b7 a6b7 a5b7 a4b7 a3b7 a2b7 a1b7 a0b7 __|
--------------------------------------------------------------------------------------
*/
end
/*-- first stage of wallace tree multiplier, first set of three rows are identified
-- a7b0 a6b0 a5b0 a4b0 a3b0 a2b0 a1b0 a0b0
-- a7b1 a6b1 a5b1 a4b1 a3b1 a2b1 a1b1 a0b1
-- a7b2 a6b2 a5b2 a4b2 a3b2 a2b2 a1b2 a0b2
---------------------------------------------------------------------------------
-- a7b2 s(7) s(6) s(5) s(4) s(3) s(2) s(1) s(0) a0b0( which is stored in p(0)(0)
-- c(7) c(6) c(5) c(4) c(3) c(2) c(1) c(0)
---------------------------------------------------------------------------------
剩余7页未读,继续阅读
资源评论
- song09272013-01-12可以综合的,还没仿真,但好像有一个信号线没使用
bingjie12345
- 粉丝: 0
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于keras+fasterRCNN,在VOC格式的口罩数据集上训练,检测人群中有无戴口罩python源码+模型
- 基于opencv+qt5机器视觉的传统缺陷检测, 即采用标准图片和待测图片进行pixel to pixel的XOR操作源码+文档
- 管道内检测缺陷数据库管理系统源码+文档说明+sln
- 毕业设计-低功耗STM32F411开发板(原理图+PCB源文件+官方例程+驱动等)源码+文档说明+截图
- 基于yolov5-tensorRT检测+发动机缸体内壁缺陷检测系统源码+文档说明
- 基于C++实现的锂电池缺陷检测源码+文档说明
- push_version
- 软件自制图像批量压缩工具
- 经典缺陷检测算法源码整理包含PaDiM(2020ICPR)、PatchCore(2022CVPR)、SimpleNet+文档说明
- 基于深度学习的抗梯度噪声的缺陷检测器python源码+文档说明+模型的预训练
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功