2020年5月5日 星期二

以Verilog 設計一個數位電路 (12)--- Shift Rotate

以Verilog 設計一個數位電路 (12)--- Shift  Rotate


`timescale 1 ns/1 ns

module EX_112 (a, b, c, d);
input [7:0] a;
output [7:0] b, c, d;
wire [7:0] b, c, d;

assign b = { a[6:0], a[7] };

assign c = { a[0], a[7:1] };

assign d = { a[3:0], a[7:4] };


endmodule

`timescale 100 ns/1 ns

module testbench;
reg [7:0] a;
wire [7:0] b, c, d;

EX_112 UUT (
.a(a),
.b(b),
.c(c),
.d(d) );
initial
begin
 a   = 8'h0f; // Time = 0
 #50; // Time = 50
 a   = 8'h5a;
 #50
  $stop;
end
endmodule

沒有留言:

張貼留言

  清除項目編譯快取 執行 flutter clean 重新取得套件依賴 執行 flutter pub get 完整重新編譯並執行 flutter run 1. 新增專案套件 (pubspec.yaml) 在 Flutter 專案根目錄下的 pubspec.yaml 中,新增 ...