코드
`timescale 1ns / 1ps
module clk_generator;
reg clk;
always begin
#5 clk = ~clk; // 5ns // 0 1 0 1 0 1
end
initial begin // initial value
clk = 0;
end
endmodule
설명
`timescale 1ns / 1ps
1ns : #(delay) 이용시 사용하는 시간
ex) #5 : 5ns delay
1ps : precision(해상도) 의미함
따라서 단위가 1ps 이므로 1.111ns 가능함
#5 clk = ~clk
5ns 마다 0, 1, 0, 1 반복
initial문을 통해서 clk의 초기값을 0으로 할당해줌
'전자공학 > 디지털회로' 카테고리의 다른 글
[Verilog] Vector (0) | 2022.12.13 |
---|---|
[Verilog] Flip-Flop (0) | 2022.12.13 |
[Verilog] 기본 gate (0) | 2022.12.12 |
VLSI 요약 (0) | 2022.12.08 |
팹리스 반도체 설계 과정 (0) | 2022.09.10 |
댓글