2021年4月22日 星期四

HBLbits_Verilog Basic_Vector100r

 HBLbits_Verilog Basic_Vector100r

Given a 100-bit input vector [99:0], reverse its bit ordering.

A for loop (in a combinational always block or generate block) would be useful here. I would prefer a combinational always block in this case because module instantiations (which require generate blocks) aren't needed.


module top_module( 
    input [99:0] in,
    output [99:0] out
);
   integer i;
    always@(*)begin
        for(i=0;i<100;i=i+1)begin
             out[99-i] = in[i];
        end
    end
endmodule

沒有留言:

張貼留言

Node-Red --> MQTT --> Fuxa

Node-Red --> MQTT --> Fuxa      FUXA(一個開源的 Web HMI / SCADA 自動化監控軟體)的專案設定檔 。 這份設定檔完整定義了 HMI 監控畫面的 後端通訊(MQTT 連線、點位標籤) 與 前端網頁圖形介面(SVG 畫布...