2019年12月26日 星期四

Verilog HDL Boolean F=(ab)'+ (c+d)

Verilog HDL Boolean F=(ab)'+ (c+d)


















module boolean_p77(I, F);

input  [3:0]I ; // I[3]...I[0] 4位元輸入
output F ;     // Output    1位元輸出

wire i1,i2;

nand(i1,I[3], I[2]);
or (i2,I[1], I[0]);
or (F,i1,i2);

endmodule


// 時間單位 100ns, 時間精確度100 ps
`timescale 100ns/100ps
module Test_bench;
reg [3:0]t_I = 4'b0000;  //  暫存器資料初值為‘0’
wire t_F;
integer i;

boolean_p77 DUT(.I(t_I),.F(t_F));
// initial程序結構區塊, 產生A、B輸入信號波形
initial begin
    $monitor(t_I,t_F);
    for (i=0; i<16; i=i+1) begin
        t_I = 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...