verilog数字系统设计教程第5章例题.docVIP

  • 47
  • 0
  • 约1.12万字
  • 约 15页
  • 2021-07-09 发布于湖北
  • 举报
第五章 例题 例如: if(ab) out1 = int1; else out1 = int2; 例如: always @( some_event) //虚的字体表示块语句 begin if(ab) out1 = int1; else if (a==b) out1 = int2; else out1 = int3; end if(ab) begin out1=int1; out2=int2; end else begin out1=int2; out2=int1; end //有时begin_end块语句的不慎使用会改变逻辑行为。见下例: if(index0) for(scani=0;scaniindex;scani=scani+1) if(memory[scani]0) begin $display(...); memory[scani]=0; end else /*WRONG*/ $display(error-indexiszero); 尽管程序设计者把else写在与第一个if(外层if)同一列上,希望与第一个if对

文档评论(0)

1亿VIP精品文档

相关文档