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


沒有留言:

張貼留言

Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --3

  Node-Red Dashboard UI Template + AngularJS 參考 AngularJS教學 --3 AngularJS 實例 <!DOCTYPE html> <html> <head> <meta charse...