当前位置:首页 > 技术心得 > 正文内容

带锁存移位寄存器(verilog)

xjtudll10年前 (2016-05-20)技术心得12270

带锁存的移位寄存器

rclk——锁存时钟

sclk——移位时钟

din——输入数据

dout——输出数据

[shiftBitNumbers——移位寄存器位数

dc9edc45-6afa-4fbe-9dbe-9b03f76464dc[7]

module shifter_latch(rclk,reset_n,sclk,din,dout);

    parameter shiftBitNumbers  = 32;

    input din,sclk,reset_n,rclk;

    output reg[shiftBitNumbers-1:0] dout;

    reg[shiftBitNumbers-1:0] dout_temp;

    always @(posedge sclk)

    begin

      dout_temp <= dout_temp << 1; //输出信号左移一位

      dout_temp[0] <= din; //输入信号补充到输出信号的最低位

    end

    always @(posedge rclk or negedge reset_n)

    begin

      if (!reset_n)

       dout = 0;

      else if(rclk)

       dout = dout_temp; //输出8位信号

    end

endmodule


扫描二维码推送至手机访问。

版权声明:本文由鸟的天空发布,如需转载请注明出处。

本文链接:http://xjtudll.cn/Exp/403/

标签: Verilog
分享给朋友:

“带锁存移位寄存器(verilog)” 的相关文章

穆斯林祈祷时间定义

穆斯林每天祈祷五次,时间有规定,需要在一个特定的时间段。五次祈祷分别是:晨礼、晌礼、晡(bū)礼、昏礼和宵礼。如下表所示: 名 称...

SensorTag编译错误Error[e16]: Segment ISTACK (size: 0xc0 align: 0) is too long for segment definition.

SensorTag编译错误Error[e16]: Segment ISTACK (size: 0xc0 align: 0) is too long for segment definition.

问题: IAR 8051 8.302,编译TI的BLE-CC254x-1.4.0的SensorTag工程,对此工程没有进行任何改动,直接编译,出现如下错误: 分析: 参考TI技术论坛【http://www.deyisupport.com/question_answer/wireless_conne...

ios5越狱及其注意事项

ios最新已经是ios5.0.1了,其实升级系统也没啥大好处,新系统一般要过一段时间才能越狱。当然,ios5.0.1越狱已经很成熟了。 ios5个人感觉有两个比较大的更新 1、iCloud功能,但是个人认为有泄露个人隐私的可能 2、通知栏有比较大的改变,现在搞的有点像And...

Android:default activity not found

Android:default activity not found

Android:default activity not found 顾名思义,没有默认的activity 一般是AndroidManifest.xml里少了几句话,如图所示: 注意红色框框中的区域...

OKI-如何卸载U8Devtool

OKI-如何卸载U8Devtool

有时候,U8Dev出了点问题,需要重新安装来解决。 卸载与安装一样,都是使用安装程序SetupU8Dev。如图所示: 双击后,弹出一个窗口,有Modify,Repair和Remove三个选项,选择Remove即可(如果之前未安装该软件,是没有Remove选项的)。  ...

android动态改变ActionBar中MenuItem的图标

先调用方法:invalidateOptionsMenu(); 然后系统会自动回调方法:onPrepareOptionsMenu 在onPrepareOptionsMenu中改变MenuItem的图标即可。 例如: MenuItem item = menu.findItem(R.id.share);...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。