Prev Problem
Next Problem

4. NOT Gate

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

Using the NOT unary operand "~" with the input on the RHS in a continuous assignment, that will assign the NOT result to y on the LHS.

 

Code

/* NOT Gate
 * Inputs: a (1-bit)
 * Output: y (1-bit)
 * Truth Table
 *  a | y
 * ----------
 *  0 | 1
 *  1 | 0
 */

module top_module (
    input a,
    output y
);
    assign y = ~ a;

endmodule

 

Was this helpful?
Upvote
Downvote