- 1、本文档共48页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Verilog 设计优化课件
第十章 设计方法与设计优化;教学重点;10.1 设计的可综合性;Verilog基本元素与硬件电路元件间的映射; 不使用initial、延时描述和forever、while、repeat
尽量采用同步方式
建议采用行为语句
always描述组合逻辑,敏感信号列出所有输入信号
尽量使用器件的全局复位端和时钟端
任务和函数通常被综合成组合逻辑;10.1.2 可综合的verilog结构;√;√;Verilog结构;Verilog结构;Verilog结构;10.2 流水线设计技术;【例10.1】非流水线 8位全加器
module adder8( cout, sum, ina, inb, cin, clk );
output[7:0] sum;
output cout;
input[7:0] ina, inb;
input cin, clk;
reg[7:0] tempa, tempb, sum;
reg cout;
reg tempc;;always @( posedge clk )
begin
tempa = ina;
tempb = inb;
tempc = cin;
end
always @( posedge clk )
begin
{ cout, sum } = tempa + tempb + tempc;
end
endmodule;普通8位全加器RTL图;时序分析 Tools | Timing Analyzer Tool
目标器件 FLEX10K EPF10K10TC144-3;【例10.2】4级流水??? 8位全加器
module pipeline( cout, sum, ina, inb, cin, clk );
output[7:0] sum;
output cout;
input[7:0] ina, inb;
input cin, clk;
reg[7:0] tempa, tempb, sum;
reg tempci, firstco, secondco, thirdco, cout;
reg[1:0] firsts, thirda, thirdb;
reg[3:0] seconda, secondb, seconds;
reg[5:0] firsta, firstb, thirds;;always @( posedge clk )
begin tempa = ina; tempb = inb; tempci = cin; end
always @( posedge clk ) // 第一级加(低2位)
begin
{ firstco, firsts } = tempa[1:0] + tempb[1:0] + tempci;
firsta = tempa[7:2]; firstb = tempb[7:2];
end
always @( posedge clk ) // 第二级加(第2 、3位相加)
begin
{ secondco, seconds } = { firsta[1:0]+firstb[1:0]+firstco, firsts };
seconda = firsta[5:2]; secondb = firstb[5:2];
end;always @( posedge clk ) // 第三级加(第4、5位相加)
begin
{ thirdco, thirds } = { seconda[1:0] + secondb[1:0]
+ secondco, seconds };
thirda = seconda[3:2];
thirdb = secondb[3:2];
end
always @( posedge clk ) // 第四级加(高两位相加)
begin
{ cout, sum } = { thirda[1:0] + thirdb[1:0]
+ thirdco, thirds };
end
endmodule;4级流水线8位全加器;10.3 资源共享;【例10.3】2个加法器和1个选择器
module resource1( sum, a, b, c, d, sel );
parameter size = 4;
output[size:0] sum;
input sel;
input[size-1:0] a, b, c, d;
reg[size:0] sum;
always @( a or b or c or d or sel )
begin
if( sel )
您可能关注的文档
- Unit5 meetings课件.ppt
- Unit5 Enjoying novels课件.ppt
- Unit4+Revision课件.ppt
- unit5 Fame and Success课件.ppt
- Unit4Global warming- Warming up课件.ppt
- Unit5 Speech on Hitler课件.ppt
- unit5 theme parks book 4z课件.ppt
- unit5 first aid Warming up课件.ppt
- unit5 状语从句课件.ppt
- Unit5 Section Ⅰ Warming Up & Reading — Pre - reading课件.ppt
文档评论(0)