전자공학/디지털회로
[Verilog] Gate-Level에서 D Latch & D Flip-Flop
17Hyuk
2022. 12. 25. 19:39
D Latch
CLK = 0 : Q(t+1) = D
CLK = 1 : Q(t+1) = Q(t) <= 기존값 유지
`timescale 1ns / 1ps
module d_latch(
input D ,
input CLK ,
output Q ,
output n_Q
);
wire n_CLK;
wire nand0, nand1;
wire out0, out1;
assign nand0 = ~(D & CLK);
assign nand1 = ~(~D & CLK);
assign out0 = Q;
assign out1 = n_Q;
assign Q = ~(nand0 & n_Q);
assign n_Q = ~(nand1 & Q);
endmodule
d_latch.v
0.00MB
tb_d_latch.v
0.00MB
4Nand, 1Inverter
※ Nand 1개당 Transistor 4개, Inverter 1개당 Transistor 2개 따라서 18Transistor 필요
D Flip-Flop
CLK = ↑ (Rising Edge) : Q(t+1) = D
CLK = 그외 : Q(t+1) = Q(t) <= 기존값 유지
`timescale 1ns / 1ps
module d_ff(
input D ,
input CLK ,
output Q ,
output n_Q
);
wire Q0;
d_latch u_d_latch0(
. D (D),
. CLK (~CLK),
. Q (Q0),
. n_Q ()
);
d_latch u_d_latch1(
. D (Q0),
. CLK (CLK),
. Q (Q),
. n_Q (n_Q)
);
endmodule
d_ff.v
0.00MB
tb_d_ff.v
0.00MB
D Latch가 2개 사용되므로 8Nand, 2Inverter
※ 36Transistor
출처
https://m.blog.naver.com/study_together_/221277740243
[대학교 디지털시스템] 래치(Latch)/플립플롭(Flip-flop)
By 루두두 안녕하세요, 루두두입니다. 여러분 오랜만이에요!! 언제나 그렇듯 공부, 또 공부합시다. 오늘은...
blog.naver.com
http://www.ktword.co.kr/test/view/view.php?m_temp1=4712
D 플립플롭
D Flip-flop, Data Flip-flop, Delay Flip-flop D 플립플롭(2022-08-16)
www.ktword.co.kr