- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
位乘法器
8位乘法器
一:8位乘法器的源程序:
module mult8( p, a, b);
parameter size = 8;
input [size:1] a, b;
output [2* size:1] p;
reg [2* size:1] p;
always @( a or b)
Begin:mult
integer index;
p = 0;
for(index=1; index=size; index=index+1)
if (b[index]==1)
p = p + (a(index));
end
endmodule
二:8位乘法器的测试代码:
`timescale 1ns/1ns
`include mult8.v
module tb_mult8;
reg[8:1] ina,inb;
wire[16:1] p;
mult8 tb_mult8(p,ina,inb);
initial
begin
#10 ina={$random}%255;inb={$random}%255;
#10 ina={$random}%255;inb={$random}%255;
#10 ina={$random}%255;inb={$random}%255;
#10 $finish;
end
initial $monitor($time,,,%d*%d=%d,ina,inb,p);
endmodule
三:Transcript显示结果:
# Reading D:/altera/91/modelsim_ase/tcl/vsim/pref.tcl
# Loading project adder
# reading D:\altera\91\modelsim_ase\win32aloem/../modelsim.ini
# Loading project mult
# reading D:\altera\91\modelsim_ase\win32aloem/../modelsim.ini
# Loading project mult
# Compile of mult8.v was successful.
# Compile of tb_mult8.v failed with 1 errors.
# 2 compiles, 1 failed with 1 error.
# Compile of tb_mult8.v was successful.
# Compile of mult8.v was successful.
# Compile of tb_mult8.v was successful.
# 2 compiles, 0 failed with no errors.
vsim work.tb_mult8
# vsim work.tb_mult8
# Loading work.tb_mult8
# ** Error: (vsim-3033) E:/mult/tb_mult8.v(11): Instantiation of initial$monitor failed. The design unit was not found.
# Region: /tb_mult8
# Searched libraries:
# E:\mult\work
# Error loading design
# Compile of mult8.v was successful.
# Compile of tb_mult8.v was successful.
# 2 compiles, 0 failed with no errors.
vsim work.tb_mult8
# vsim work.tb_mult8
# Loading work.tb_mult8
# ** Error: (vsim-3033) E:/mult/tb_mult8.v(11): Instantiation of initial$monitor failed. The design unit was not found.
# Region: /tb_mult8
# Searched libraries:
# E:\mult\work
# Error loading design
# Compile of mult8.v was successful.
# Compile of mult8.v was successful.
您可能关注的文档
- 交通管理控制复习.doc
- 交流伺服运动控制系统的典型案例分析.doc
- 产品批次管理制度A.doc
- 产品的标识和可追溯性的控制程序.doc
- 产品的标识和可追溯性控制程序.doc
- 产品几何性能检测.doc
- 人体生理学任务1.doc
- 交通信号控制的研究性学习和创新.doc
- 人工关无菌性松动动物模型的建立.doc
- 人力级过关必做习题集之人力资源规划(精解)[].doc
- 两条直线的位置关系课件-高二上学期数学人教A版选择性.pptx
- 历史和人民的选择高考政治一轮复习讲练测新教材新高考教案.docx
- Unit3Integration1课件译林版七年级英语上册.pptx
- AU4知识点学生版.docx
- Unit4ExploringpoetryGrammarandusage课件-高中英语译林版选择性.pptx
- 二元一次方程组及其解法(第2课时)(课件)沪科版七年级数学上册.pptx
- Unit1YouandMeSectionB2a-2b课件人教版七年级英语上册.pptx
- Unit5WhatdoyoulikeaboutfarmsPeriod2(课件)-沪教牛津版(深圳用)英语二年级上册.pptx
- 第三讲读后续写基础篇学生讲义.docx
- 2025天津市公安局面向退役特战士兵特殊招录公安特警10人备考题库附答案.docx
原创力文档


文档评论(0)