2019年12月26日 星期四

P84_Boolean ch3 ex15 F=(ab) xnor (a'b)

P84_Boolean ch3 ex15  F=(ab) xnor (a'b)






module ch3_ex15_p85(A,B, F);

input  A,B ; // A, B  1位元輸入
output F ;     // Output    1位元輸出

wire w1,w2,w3;

not(w1,A);
and (w2,A,B);
and (w3,w1,B);
xnor(F,w2,w3);

endmodule

=================================

// 時間單位 100ns, 時間精確度100 ps
`timescale 100ns/100ps
module Test_bench;
reg t_A = 1'b0;   //  暫存器資料初值為‘0’
reg t_B = 1'b0;   //  暫存器資料初值為‘0’
wire t_F;

integer i;

ch3_ex15_p85 DUT(.A(t_A),.B(t_B),.F(t_F));
// initial程序結構區塊, 產生A、B輸入信號波形
initial begin
    $monitor(t_A,t_B,t_F);
    for (i=0; i<4; i=i+1) begin
        {t_A,t_B} = i;
        #20;
    end
end

initial
begin
  #100;   // 模擬終止時間  400 ns
    $stop;
end

endmodule


沒有留言:

張貼留言

1-out-of-4 脈衝位置編碼 (PPM)

1-out-of-4 脈衝位置編碼 (PPM)  1-out-of-4 脈衝位置編碼 (PPM) ,主要概念是將一個訊號週期(Symbol)等分成 4 個時段(Slots)。根據資料數值(0, 1, 2, 或 3),脈衝會出現在對應的時段中。 import tkinter as ...