Verilog

Verilog 1주차 - 기본 작성법

_KDE_ 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' 카테고리의 다른 글

Verilog - CLK divider  (0) 2025.03.20
Verilog - 4bit full adder testbench  (2) 2025.03.16
Verilog - 4bit full adder  (2) 2025.03.16
Verilog - 1bit Half Adder, Full Adder (인스턴스화)  (1) 2025.03.09
Verilog 1주차 - Testbench  (0) 2025.03.03