习题数字集成电路设计习题4.docVIP

  • 13
  • 0
  • 约2.59千字
  • 约 7页
  • 2019-09-27 发布于江苏
  • 举报
习题3 三、写出下面Verilog程序的执行结果 下面程序执行完后,写出A,B,C,D,clk的结果 module adder_1(A,B,C,D,clk); input clk; input[7:0] A, B ; output[7:0] C , D ; reg[7:0] C, D ; initial begin A=8`B=8`clk=1 end always@(clk) begin C=A+B; If (A+B255) D[3]=1`b1; else D[3]=0; end endmodule 下面程序执行完后,写出count的结果 module counter(tempreg, count); input tempreg; output count; reg [7: 0] tempreg; reg [3: 0] count; initial begin count = 0; tempreg=8`b0111010 end while (tempreg) begin if (tempreg[ 0]) count = count + 1; tempreg = tempreg 1; end endmodule 下面程序执行完后,写出factorial的结果 module try_fac

文档评论(0)

1亿VIP精品文档

相关文档