Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- uart 통신
- ring counter
- i2c 통신
- Edge Detector
- dataflow modeling
- stop watch
- java
- LED
- D Flip Flop
- vivado
- test bench
- pwm
- half adder
- Recursion
- soc 설계
- FND
- hc-sr04
- prescaling
- KEYPAD
- BASYS3
- verilog
- Algorithm
- gpio
- ATMEGA128A
- Pspice
- Linked List
- structural modeling
- behavioral modeling
- DHT11
- atmega 128a
Archives
- Today
- Total
거북이처럼 천천히
비동기식 카운터 (Asynchronous counter) 본문
1. Asynchronous MOD 16 up counter, T Flip-Flop
< Source code >
// Behavioral modeling of T Flip Flop
module t_flip_flop (
input t,
input clk, enable, reset,
output reg q );
always @(negedge clk or posedge reset) begin
if(reset) q = 0;
else if(enable) q = (t)? ~q : q;
else q = q;
end
endmodule
// Asynchronous up counter MOD 10
module Asynchronous_Up_Counter_MOD_10_T_Flip_Flop(
input clk, enable, reset,
output [3:0] result );
t_flip_flop t_flip_flop_0 (1, clk, enable, reset, result[0]);
t_flip_flop t_flip_flop_1 (1, result[0], enable, reset, result[1]);
t_flip_flop t_flip_flop_2 (1, result[1], enable, reset, result[2]);
t_flip_flop t_flip_flop_3 (1, result[2], enable, reset, result[3]);
endmodule
< Simulation >
< RTL analysis >
< Synthnesis >
2. Asynchronous MOD 16 down counter, T Flip-Flop
< Source code >
// Behavioral modeling of T Flip Flop
module t_flip_flop (
input t,
input clk, enable, reset,
output reg q );
always @(posedge clk or posedge reset) begin
if(reset) q = 0;
else if(enable) q = (t)? ~q : q;
else q = q;
end
endmodule
// Asynchronous MOD 16 Down counter
module Asynchronous_Down_Counter_MOD_16__T_Flip_Flop(
input clk, enable, reset,
output [3:0] result );
t_flip_flop t_flip_flop_0 (1, clk, enable, reset, result[0]);
t_flip_flop t_flip_flop_1 (1, result[0], enable, reset, result[1]);
t_flip_flop t_flip_flop_2 (1, result[1], enable, reset, result[2]);
t_flip_flop t_flip_flop_3 (1, result[2], enable, reset, result[3]);
endmodule
< Simulation >
< RTL analysis >
< Synthnesis >
'RTL Design > Verilog 연습' 카테고리의 다른 글
Advanced Clock (0) | 2024.08.06 |
---|---|
Normal Clock (0) | 2024.08.04 |
T Flip Flop (0) | 2024.07.11 |
JK Flip Flop (0) | 2024.07.11 |
SR Latch / D Latch / D Flip Flop (0) | 2024.07.10 |