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

沒有留言:

張貼留言

Galois LFSR

  在密碼學與數位訊號處理中, LFSR(線性回饋移位暫存器,Linear Feedback Shift Register) 是用來產生偽隨機序列(也就是串流加密中所需的金鑰流)最核心的硬體架構。 LFSR 主要分為兩種實現架構: Fibonacci(斐波那契) 與 Galo...