首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >参数化长度的Verilog移位寄存器

参数化长度的Verilog移位寄存器
EN

Stack Overflow用户
提问于 2016-05-06 09:05:23
回答 1查看 799关注 0票数 0

我是Verilog代码的新手。我必须用移位寄存器在verilog代码中做一个问题。我在问之前搜索了一下,但没有找到类似的东西。有人能帮我在Verilog中为这个寄存器创建代码吗?

谢谢!祝您今天愉快!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-05-06 09:34:11

也许这会让你:

代码语言:javascript
复制
module DW03_shft_reg #(
// the parameterisable length of the shift register needs to be a parameter
    parameter LENGTH = 1              
  )(
      input [LENGTH-1:0] p_in,
      input s_in, load_n, shift_n, clk, 
      // this needs to be a 'reg' so that it can be assigned to by the 'always' block
      output reg [LENGTH-1:0] p_out     
  );

    // the template for sequential code with no asynchronous reset
    always @(posedge clk)               
        begin
          // implement the behaviour from the truth table here
          // the { , } (concatenation) operator is useful for shift registers
        end

endmodule
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37068397

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档