- 1、本文档共8页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Verilog_HDL_四位移位乘法器
实验五 四位移位乘法器
实验代码:(led显示)
module mult(mul,a,b);
output [7:0] mul;
//input ckl;
input [3:0] a,b;
reg [7:0] mul;
wire [3:0] out1,out2,out3,out4;
//wire [3:0] out2;
//wire [3:0] out3;
//wire [3:0] out4;
//如果always快里有问题,用clk进行延时接受,确保无问题
reg [7:0] temp=8b0;
reg [7:0] temp_mul=8b0;
multply cheng1(out1,a,b[3]);
multply cheng2(out2,a,b[2]);
multply cheng3(out3,a,b[1]);
multply cheng4(out4,a,b[0]);
always@ (a or b)
begin
temp={4b0,out1};
temp_mul=temp1;
temp={4b0,out2};
temp_mul=temp_mul+temp;
temp_mul=temp_mul1;
temp={4b0,out3};
temp_mul=temp_mul+temp;
temp_mul=temp_mul1;
temp={4b0,out4};
mul=temp_mul+temp;
end
endmodule
module multply(out,mul4,mul1);
output [3:0] out;
input [3:0] mul4;
input mul1;
reg [3:0] out;
reg [3:0] tem;
always@ (mul4 or mul1)
begin
case(mul1)
1b0: tem=4b0;
default: tem=mul44b1111;
endcase
out=tem;
end
endmodule
管脚配置:
通过拨动输入:
a[0] input PIN_200
a[1] input PIN_202
a[2] input PIN_203
a[3] input PIN_204
b[0] input PIN_205
b[1] input PIN_206
b[2] input PIN_207
b[3] input PIN_208
led灯输出:
mul[0] output PIN_191
mul[1] output PIN_192
mul[2] output PIN_193
mul[3] output PIN_195
mul[4] output PIN_196
mul[5] output PIN_197
mul[6] output PIN_198
mul[7] output PIN_199
实验连线:
通过拨动输入:
K1-K8:11-18
Led灯显示连线:
L1-L8:3-10
电路工作原理
手动拨动,开关k1-k8,根据Led灯的显示,亮表示1,不亮表示0来看结果。
实验问题
当用八段译码显示管,利用十六进制来表示结果时,遇到一些问题,无法操作成功。总是要么同时选通但只显示一个,要么就是只选通一个。
八段译码显示管显示:
module mult(mul,outa,outb,a,b,clk);
output [7:0] mul;
output outa,outb;
input clk;
input [3:0] a,b;
reg outa;
reg outb;
reg [7:0] mul;
reg te;
wire [3:0] out1,out2,out3,out4;
reg [7:0] temp=8b0;
reg [7:0] temp_mul=8b0;
multply cheng1(out1,a,b[3]);
multply cheng2(out2,a,b[2]);
multply cheng3(out3,a,b[1]);
multply cheng4(out4,a,b[0]);
/*
always@(posedge clk)
begin
if(te==0)
begin
outb=~outb;
outa=~outa;
te=te+1;
end
end
always@(posedge clk)
begin
if(te==30)
begin outa=outb; outb=~outb; te=te+1; end
else if(te==60)
begin out
您可能关注的文档
- PCCAD自定义标题栏教程.doc
- Photoshop增强海景照片的光感及清晰度.doc
- Photoshop快速加强图层的层次感和清晰度.doc
- PHP语句.doc
- PowerDesign通过SQL语句生成PDM文件.doc
- PPK的含义.doc
- PROTEL操作一览.doc
- PS2接口定义.doc
- PS处理照片清晰度1.doc
- ps彩色发光圆环.doc
- 国际标准 IEC 60939-2-2:2004 EN_D Complete filter units for radio interference suppression - Part 2-2: Blank detail specification - Passive filter uits for electromagnetic interference suppression - Filters for which safety tests are required (safety.pdf
- 国际标准 IEC 60670-23:2006 EN-FR Boxes and enclosures for electrical accessories for household and similar fixed electrical installations - Part 23: Particular requirements for floor boxes and enclosures 家用和类似固定电气安装用电器配件的盒子与封闭装置——第23部分:地板箱和封闭装置的要求.pdf
- 国际标准 IEC 60670-23:2006 EN-FR 家用和类似固定电气安装用电器配件的盒子与封闭装置——第23部分:地板箱和封闭装置的要求 Boxes and enclosures for electrical accessories for household and similar fixed electrical installations - Part 23: Particular requirements for floor boxes and enclosures.pdf
- 2024版完整的货物运输合同书.doc
- 2024版无财产的离婚协议书书模板.doc
- 2024版委托融资租赁合同书书.doc
- 2024版汪怡的离婚协议书书.doc
- 2024版委托活动代理服务协议书书.doc
- 2024版挖掘机租赁合同书范本最新.doc
- 2024版退款协议书书.doc
最近下载
- 2022-2023学年湖北省鄂州市七年级下学期期末数学试卷(含答案解析).docx
- 成都市七中育才学校初一新生分班(摸底)语文考试模拟试卷(10套试卷带答案解析).pdf VIP
- 玄隐遗密(含黄帝内经).docx
- 幼儿园区域环境—语言区环境创设(幼儿园环境创设课件).pptx VIP
- 整体租赁底商运营方案(技术方案).docx
- 脑梗塞后遗症病人护理查房ppt课件.pptx
- 【上海市】医疗服务收费标准.pdf
- 灭菌方法和无菌操作.ppt
- 华中农业大学2020-2021学年《植物生理学》期末考试试卷(A卷)含参考答案.docx
- 华中农业大学2021-2022学年《植物生理学》期末考试试卷(A卷)含参考答案.docx
文档评论(0)