기본적인 문제라서 그냥 한번에 하기로 했다
지난번에 한 NOT 까지 합치면
NOT / AND / NOR / XNOR 순으로 문제가 나와있다.
Bitwise 연산자와 Logical 연산자는 비슷하지만 다름!
Bitwise(Bit 연산)
NOT: b = ~a
AND: c = a & b
OR: c = a | b
XOR: c = a ^ b
Logical(True, False)
NOT: b = !a
AND: c = a && b
OR: c = a || b
XOR: 없음
이번엔 a 와 b의 입력을 AND gate로 묶어서 out으로 출력하는 문제
module top_module(
input a,
input b,
output out
);
assign out = a & b;
endmodule
a, b 입력을 NOR gate로 묶어서 out으로 출력
module top_module(
input a,
input b,
output out
);
assign out = ~(a | b);
endmodule
a, b 입력을 XNOR gate로 묶어서 out으로 출력
module top_module(
input a,
input b,
output out
);
assign out = ~(a ^ b);
endmodule