2020年4月12日 星期日

1-2 DeMux 解多工器 (Gate Level)

1-2 DeMux 解多工器 (Gate Level)



//------------------------------------
// 1-2 DeMux (Gate Level)
// Filename: DeMux_1x2.v
//------------------------------------
module DeMux_1x2(D,S,Y);
input D,S;
output [1:0]Y;

wire s_bar;
not u1(s_bar,S);

and U2(Y[0],s_bar,D);
and U3(Y[1],S,D);

endmodule

//==================================

// 時間單位 100ns, 時間精確度100 ps
`timescale 100ns/100ps 
module TB;
/*
module DeMux_1x2(D,S,Y);
input D,S;
output [1:0]Y;
*/
reg D,S;
wire [1:0] Y;

integer i;
 
DeMux_1x2 UUT(D,S,Y);
 
initial begin  
   for ( i=0;i<=3;i=i+1) 
        begin
           {D,S}  = i;
            #1;
        end
end
endmodule

沒有留言:

張貼留言

ESP32-Flutter-MQTT-IoT-Controller

 ESP32-Flutter-MQTT-IoT-Controller 這套系統包含了 Flutter 跨平台 App 、 ESP32 韌體 與 MQTT 雲端傳輸機制 。 專案中採用的 功能命名原則與對應關係 整理如下: 1. 核心功能名稱對照表 功能區塊 Python / ...