【HDLBits刷题笔记】12 More Circuits

Rule90

第一次见这东西有点莫名其妙,但是其实看懂了之后就是左移和右移相异或,注意这里使用的是逻辑右移,会自动补零,不能使用算数左移<<<。

module top_module(
    input clk,
    input load,
    input [511:0] data,
    output reg[511:0] q ); 
    always@(posedge clk)
    begin
        if(load)
            q <= data;
        else begin
            q <= (q<<1)^(q>>1);
        end
    end
endmodule
hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » 12 More Circuits