Instructions
  • The Verilog module and testbench code are divided into colored code blocks for clarity.
  • Drag and drop the code blocks to arrange them in the correct order for the code to work.
  • Complete the partially filled code blocks by entering the required values in the input fields.
  • Click on Validate after arranging and completing the code blocks. If the code is correct, you will see the output truth table and a success/failure message.
  • Click on Reset to clear the workspace and start over.
Verilog Module
  • // Define module name, inputs and outputs

    module (

       ,

      input ,

      output

    );

  •  // Define the functionality of this module.

      assign        ;

  • // End of the module
    endmodule
Verilog Testbench
  • // Define Test Bench name

    module ;

  • // Declare the input and output variables

      reg ;

      reg ;

      wire ;

  •   // Instantiate the gate module

       uut (

         ,

         ,

         ) ;

  • // Initial Block

      initial begin

        // Defining the input waves A, B

        A = 0;
        B = 0;
        #1
        A = 0;
        B = 1;
        #1
        A = 1;
        B = 0;
        #1
        A = 1;
        B = 1;


        $finish;
      end

  • // End of the module
    endmodule
Observations