/////////////////////////////////////////////////////////////////
// Testfixture for Verilog model for the 3-Input logic circuit
/////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////
// Set timescales
//////////////////////////////////////////////////////////

`timescale 1ns / 1ps

//////////////////////////////////////////////////////////
// Define testfixture module
//////////////////////////////////////////////////////////

module testfixture();

///////////////////////////////
// Inputs and Output
///////////////////////////////

   reg A;
   reg B;
   reg C;
   reg D;

   wire OUT;

///////////////////////////////
// Instantiate the UUT
///////////////////////////////

gates UUT (.A(A), .B(B), .C(C), .C(C), .D(D), .OUT(OUT));

/////////////////////////////////////////////////////
// Initialize Inputs and set end of simulation time
/////////////////////////////////////////////////////

initial 

begin

$write("\n\nStarting simulation run at time ...", $time, "\n\n");

$write("\t\t\tTime\tA\tB\tC\tD\tOUT\n\n");

A = 1'b0; B = 1'b0; C = 1'b0; D = 1'b0;

#160 $write("\n\nCompleting simulation run at time ...", $time, "\n\n");

$finish;

end

////////////////////////////////////////////////
// Stimulus as clocks using 'always' statement
////////////////////////////////////////////////

always # 10 D = ~D; always # 20 C = ~C;

always # 40 B = ~B; always # 80 A = ~A;

always #5 $write($time, "\t", A, "\t", B, "\t", C, "\t", D, "\t",OUT, "\n");

endmodule

//////////////////////////////////////////////////////////
// End of File
//////////////////////////////////////////////////////////
