베릴로그

Verilog 1주차 - 기본 작성법

aude_ 2025. 3. 3. 19:51

1. 작성법

기본 상태 :

 

`timescale 1ns / 1ps

 

module practice(

);   
 endmodule

 

 

 

 

괄호 안에 input, output을 정의

ex)

module practice(
    input a,input b, output y
    );
  
endmodule

 

이 때 input a 는 input wire a가 default로 생략된 것이라고 생각 가능.

 

 

괄호 밖에서는 input과 output의 관계를 정의해줌

ex)

module practice(
    input a,input b, output y
    );

assign y = a &b;

endmodule

 

여기서 assign은 wire를 연결해라 라는 의미

 

아래는 schematic 결과

 

'베릴로그' 카테고리의 다른 글

Verilog - 1bit Half Adder, Full Adder (인스턴스화)  (0) 2025.03.09
Verilog 1주차 - Testbench  (0) 2025.03.03