8422|0

151

帖子

0

TA的资源

一粒金砂(高级)

楼主
 

Xilinx FPGA的SRL16移位寄存器原理与使用 [复制链接]

字体: 小 中 大 | 打印 发表于: 2009-12-07 06:59    作者: qq1234    来源: 开源IP通吃岛
可以定义移位长度的移位寄存器。
就是用一个lut可以实现16位的移位寄存器。

SRL16  的是 16bit移位寄存器查找表  // 16-Bit Shift Register Look-Up-Table (LUT)

在一个LUT中可以实现16个FF移位的功能!
SSRL16 SRL16_inst (
.Q(Q), // SRL data output
.A0(A0), // Select[0] input
.A1(A1), // Select[1] input
.A2(A2), // Select[2] input
.A3(A3), // Select[3] input
.CLK(CLK), // Clock input
.D(D) // SRL data input
);

我也来说两句 查看全部回复 最新回复
  • qq1234 (2009-12-07 07:06:58)

    SRL16 is a shift register look up table (LUT). The inputs A3, A2, A1, and A0 select the output length of the shift register. The shift register may be of a fixed, static length or it may be dynamically adjusted.

    The shift register LUT contents are initialized by assigning a four-digit hexadecimal number to an INIT attribute. The first, or the left-most, hexadecimal digit is the most significant bit. If an INIT value is not specified, it defaults to a value of four zeros (0000) so that the shift register LUT is cleared during configuration.
    The data (D) is loaded into the first bit of the shift register during the Low-to-High clock (CLK) transition. During subsequent Low-to-High clock transitions data is shifted to the next highest bit position as new data is loaded. The data appears on the Q output when the shift register length determined by the address inputs is reached.

    这里说了几点,
    - 移位寄存器的初始值可以用INIT属性初始化;
    - 移位寄存器的长度由地址线的取值决定;
    - 移位数据从D端输入,Q端输出
    - 先移入的数据是MSB
  • qq1234 (2009-12-07 07:07:39)To get a fixed length shift register, drive the A3 through A0 inputs with static values. The length of the shift register can vary from 1 bit to 16 bits as determined from the following formula:

    Length = (8*A3) +(4*A2) + (2*A1) + A0 +1

    If A3, A2, A1, and A0 are all zeros (0000), the shift register is one bit long. If they are all ones (1111), it is 16 bits long.
  • qq1234 (2009-12-07 07:12:57)The length of the shift register can be changed dynamically by changing the values driving the A3 through A0 inputs. For example, if A2, A1, and A0 are all ones (111) and A3 toggles between a one (1) and a zero (0), the length of the shift register changes from 16 bits to 8 bits.

    Internally, the length of the shift register is always 16 bits and the input lines A3 through A0 select which of the 16 bits reach the output.

    Inputs
    Output
    Am
    CLK
    D
    Q
    Am
    X
    X
    Q(Am)
    Am

    D
    Q(Am-1)
    m= 0, 1, 2, 3


    这里提示了几个要点:

    - 移位寄存器是可变长度的
    - 长度的改变由地址线来指定
    - 内部的寄存器长度是不变的,只是截取的长度变了
    - 数据先移入到A0,然后到A1,以此类推,最后从指定长度的Am-1处输出,比如A=8,则数据从地址0输入,从地址7输出,这样有效的移位长度就为8。
  • qq1234 (2009-12-07 07:14:08)CODE:
    -- SRL16: 16-bit shift register LUT operating on posedge of clock
    --        All FPGAs
    -- Xilinx  HDL Libraries Guide version 7.1i

       SRL16_inst : SRL16
    -- The following generic declaration is only necessary if you wish to
    -- change the initial contents of the SRL to anything other than all
    -- zero's.
       generic map (
          INIT => X"0000")
       port map (
          Q => Q,       -- SRL data output
          A0 => A0,     -- Select[0] input
          A1 => A1,     -- Select[1] input
          A2 => A2,     -- Select[2] input
          A3 => A3,     -- Select[3] input
          CLK => CLK,   -- Clock input
          D => D        -- SRL data input
       );


    -- End of SRL16_inst instantiation
  • qq1234 (2009-12-07 07:15:09)CODE:

    -- SRL16: 16-bit shift register LUT operating on posedge of clock
    --        All FPGAs
    -- Xilinx  HDL Libraries Guide version 7.1i

       SSRL16 SRL16_inst (
          .Q(Q),       // SRL data output
          .A0(A0),     // Select[0] input
          .A1(A1),     // Select[1] input
          .A2(A2),     // Select[2] input
          .A3(A3),     // Select[3] input
          .CLK(CLK),   // Clock input
          .D(D)        // SRL data input
       );

    // The following defparam declaration is only necessary if you wish to
    // change the initial contents of the SRL to anything other than all
    // zero's.  If the instance name to the SRL is changed, that change
    // needs to be reflected in the defparam statements.

       defparam SRL16_inst.INIT = 16'h0000;


    // End of SRL16_inst instantiation
  • qq1234 (2009-12-07 07:17:34)一举攻克SRL16,留下此帖,与大家共享!
此帖出自FPGA/CPLD论坛
点赞 关注
 

回复
举报
您需要登录后才可以回帖 登录 | 注册

查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/7 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表