Language/Verilog & SV

[Verilog Problem] And gate

VIR&US 2024. 5. 24. 02:03
반응형

Problem description

  • module은 TOP이고 Input inA, inB Output out를 가지고 있습니다.
  • inA와 inB는 AND Gate를 통해 out으로 나갑니다.

Code

module TOP (
 input inA,
 input inB,
 output  out);

 assign out=inA&inB;

endmodule

Description

  • AND은 "&"로 처리할 수 있습니다.
  • "&"는 bit, "&&"는 논리 연산자 입니다.
  • Gate level에서는 cell를 instance해서 사용합니다.
  • 연속 할당은 오른쪽을 왼쪽에 연속적으로 할당하므로 RHS의 변경 사항이 LHS에 즉시 표시됩니다.
  • input, output의 wire 혹은 reg를 선언하지 않으면 wire를 기본으로 합니다.
728x90
반응형