博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

数据再寄存器中的暂时保存

Posted on 2015-10-18 11:07  期待1991  阅读(601)  评论(0编辑  收藏  举报

1、如图是带有使能端和复位端的时钟同步8位寄存器组的逻辑和模块接口图

 

2、verilog程序

module register8(ena,clk,data,rst,out);

input ena,clk,rst;

input[7:0] data;

output[7:0] out;

reg[7:0] out;

always@(posedge clk)

  begin

    if(!rst)

      out<=0;

    else if(ena)

      out<=data;

    else ;

  end

endmodule

 


 

 

made by qidaiYMM, yout comment is appreciated.

email:1519882610@qq.com