2019年12月26日 星期四

P85_Boolean ch3 EX16-1 F=(ab) ' xnor (c+d)

P85_Boolean ch3 EX16-1 F=(ab) '  xnor (c+d)









module ch3_p85_16_1(A,B,C,D, F);

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

wire w1,w2;

nand(w1,A,B);
or (w2,C,D);
xnor(F,w2,w1);

endmodule

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

wire t_F;

integer i;

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

initial
begin
  #400;   // 模擬終止時間  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...