2023-01-11 10:13:09 +00:00
|
|
|
/**
|
|
|
|
* And gate:
|
|
|
|
* out = 1 if (a == 1 and b == 1)
|
|
|
|
* 0 otherwise
|
|
|
|
*/
|
|
|
|
|
|
|
|
`default_nettype none
|
|
|
|
module And(
|
2024-10-17 18:36:58 +00:00
|
|
|
input a,
|
|
|
|
input b,
|
|
|
|
output out
|
2023-01-11 10:13:09 +00:00
|
|
|
);
|
|
|
|
|
2024-10-17 18:36:58 +00:00
|
|
|
// Put your code here:
|
|
|
|
wire nand1;
|
2023-01-11 10:13:09 +00:00
|
|
|
|
2024-10-17 18:36:58 +00:00
|
|
|
Nand NAND1(a, b, nand1);
|
|
|
|
Nand NAND2(nand1, nand1, out);
|
2023-01-11 10:13:09 +00:00
|
|
|
endmodule
|