Presentation is loading. Please wait.

Presentation is loading. Please wait.

순차로직 개요.

Similar presentations


Presentation on theme: "순차로직 개요."— Presentation transcript:

1 순차로직 개요

2 단원목차 1. 래치(Latches) 2. NAND/NOR 래치 3. 게이트 래치 4. 에지-트리거 D-플립플롭
5. 에지-트리거 JK-플립플롭 6. 에지-트리거 T-플립플롭 7. Timing Parameters

3 순차회로와 순차회로 요소 회로의 출력이 입력 값의 현재 조합뿐만 아니라 회로의 과거(history) 입력에도 의존하는 디지털 회로. 두 가지 기본적인 형태: - 래치(latch) - 플립플롭(flip-flop) 차이는 저장되는 비트를 변경시키는 조건에 따른다.

4 순차회로 입력과 출력 SET – 논리 값 ‘1’을 저장시키는 입력. RESET – 논리 값 ‘0’을 저장시키는 입력.
두 개의 보수출력, Q 와 /Q. 출력은 항상 반대 논리 값을 가진다.

5 SR 래치(active high inputs)
Fig. 7.1 Motor Start/Stop switch(application)

6 NAND 와 NOR 래치 NAND Latch NOR Latch
/S /R Action Forbidden condition SET RESET Output does not change from the previous state. NOR Latch S R Action Output does not change from the previous state RESET SET Forbidden condition.

7 NOR/NAND 래치 동작 두 가지 가능한 안정된 상태. 하나는 SET. 다른 하나는 RESET.
피드백은 래치를 안정된 상태로 유지시킨다. Fig. 7.6

8 NAND 래치의 WYSIWYG 합성 Synthesis report file nQ = LCELL(_EQ001 $ GND);
_EQ001 = !nR # !Q; Q = LCELL(_EQ002 $ GND); _EQ002 = !nS # !nQ; Q = /(nS) + /(nQ) nQ = /(nR) + /Q Equal path delay : /S to /Q vs. /R to Q Different path delay : /S to Q vs. /R to Q

9 RESET to SET Transition (Fig. 7.12, 7.13)
1 7.5ns 12.5ns

10 SET to RESET Transition (Fig. 7.14, 7.15)

11 Fig. 7.18 SET goes HIGH before RESET
n Fig RESET goes HIGH before SET

12 Fig. 7.20 NAND Latch Forbidden State
Fig SET and RESET go HIGH simultaneously t=0

13 MAX+PLUS II 에서의 실제적인 합성 (Normal style)
Fig 참조 Report file nQ = LCELL(_EQ001 $ VCC); _EQ001 = nR & Q; Q = LCELL(_EQ002 $ !nS); _EQ002 = nR & nS & Q; Q = (nR•nS•Q)  /(nS) nQ = (nR•Q)  1 = /(nR•Q) Equal path delay : SET to Q vs. RESET to Q

14 스위치 바운스(Switch Bounce)
스위치 접촉은 최종 접촉이 이루어지기 전에 기계적인 바운스가 발생한다. 스위치 접촉 시 논리회로에서 한 펄스 대신에 여러 펄스가 입력된다. Fig. 7.23

15 스위치 디바운스 회로 접촉된 단자가 래치의 활성레벨(active level )이 되도록 NAND 래치를 사용하라.
S=R=1 입력조건은 출력을 바꾸지 않으므로 바운스가 무시된다. Fig. 7.24 Ex. 7.3

16 게이트 SR 래치 SR 래치 상태의 변경은 ‘ENABLE’로 표시되는 제어신호에 의해 통제된다.
구동 게이트에 의해 제어되는 NAND 래치이다. Latch ENABLE Input - Used in two principal ways. - One, as an ON/OFF signal. - Two, as a synchronizing signal.

17 게이트 SR 래치의 기능표 EN S R Qt /Qt Function Qt /Qt No change RESET SET Forbidden X X Qt /Qt Inhibited.

18 Fig. 7.27

19 Gated D 또는 Transparent Latch
ENABLE 입력이 활성일 때, 래치의 출력이 데이터 입력을 따른다. ENABLE이 비활성일 때, 래치는 과거 ENABLE이 활성일 때 제시되었던 데이터를 저장한다. EN D Qt+1 /Qt Function x Qt /Qt No change RESET SET.

20 D-Latch 동작

21 MAX+PLUS II 에서의 D-래치 그래픽 설계 파일(.gdf)에서 프리미티브로 구현될 수 있다.
VHDL 파일에서 행위적(behavioral) 또는 구조적(structural) 기술로 구현될 수 있다.

22 프로세스 구문을 사용한 D-Latch VHDL code
A PROCESS statement is concurrent, but the statements inside the PROCESS are sequential. VHDL code for D-Latch -- d_lch.vhd -- D latch with active-HIGH level-sensitive enable ENTITY d_lch IS PORT( d, ena : IN BIT; q : OUT BIT); END d_lch; ARCHITECTURE a OF d_lch IS BEGIN PROCESS (d, ena) IF (ena = '1') THEN q <= d; ELSE NULL; END IF; END PROCESS; END a;

23 ALTERA Library와 maxplus2 Package를 사용한 래치 프리미티브의 사례화
COMPONENT LATCH PORT( d : IN STD_LOGIC; ena : IN_STD_LOGIC; q : OUT_STD_LOGIC); END COMPONENT;

24 ALTERA Library 와 maxplus2 패케이지를 사용한 D-Latch
-- lch_prim.vhd -- D latch with active-HIGH level-sensitive enable LIBRARY ieee; USE ieee.std_logic_1164.ALL; LIBRARY altera; USE altera.maxplus2.ALL; ENTITY lch_prim IS PORT( d_in, enable : IN STD_LOGIC; q_out : OUT STD_LOGIC); END lch_prim; ARCHITECTURE a OF lch_prim IS BEGIN -- Instantiate a latch from a MAX+PLUS II primitive latch_primitive : latch PORT MAP (d => d_in, ena => enable, q => q_out); END a;

25 VHDL Implementation of Latches with Multiple Inputs/Outputs and Common Enable
1. Use behavioral description with STD_LOGIC_VECTOR types. : Use STD_LOGIC_VECTOR types for D and Q, rather than STD_LOGIC for a single latch. 2. Use primitives – predefined components. : ALTERA recommends using a latch primitive, rather than creating your own latch structures. That is, use multiple LATCH primitives instantiated by a GERNERATE statement. 3. Use a latch component from Library of Parameterized Modules (LPM). : These components are specified in the lpm_components package in the lpm library.

26 4-bit Latch의 행위적 기술 -- ltch4bhv.vhd
-- D latch with active-HIGH level-sensitive enable LIBRARY ieee; USE ieee.std_logic_1164.ALL; ENTITY ltch4bhv IS PORT(d : IN STD_LOGIC_VECTOR(3 downto 0); enable : IN STD_LOGIC; q : OUT STD_LOGIC_VECTOR(3 downto 0)); END ltch4bhv; ARCHITECTURE a OF ltch4bhv IS BEGIN PROCESS (enable, d) IF (enable = '1') THEN q <= d; END IF; END PROCESS; END a;

27 4 LATCH 프리미티브와 GENERATE 문
-- ltch4prm.vhd -- D latch with active-HIGH level-sensitive enable LIBRARY ieee; USE ieee.std_logic_1164.ALL; LIBRARY altera; USE altera.maxplus2.ALL; ENTITY ltch4prm IS PORT( d_in : IN STD_LOGIC_VECTOR(3 downto 0); enable : IN STD_LOGIC; q_out : OUT STD_LOGIC_VECTOR(3 downto 0)); END ltch4prm; ARCHITECTURE a OF ltch4prm IS BEGIN -- Instantiate a latch from a MAX+PLUS II primitive latch4: FOR i IN 3 downto 0 GENERATE latch_primitive: latch PORT MAP (d => d_in(i), ena => enable, q => q_out(i)); END GENERATE; END a;

28 LPM 래치 -- ltch4lpm.vhd , 4-BIT D latch with active-HIGH level-sensitive enable -- Uses a latch component from the Library of Parameterized Modules (LPM) LIBRARY ieee; USE ieee.std_logic_1164.ALL; LIBRARY lpm; USE lpm.lpm_components.ALL; ENTITY ltch4lpm IS PORT( d_in : IN STD_LOGIC_VECTOR(3 downto 0); enable : IN STD_LOGIC; q_out : OUT STD_LOGIC_VECTOR(3 downto 0)); END ltch4lpm; ARCHITECTURE a OF ltch4lpm IS BEGIN -- Instantiate latch from an LPM component latch4: lpm_latch GENERIC MAP (LPM_WIDTH => 4) PORT MAP (data => d_in, gate => enable, q => q_out); END a;

29 Flip-Flop 정의 클록 입력을 가진 게이트 래치 순서회로 출력은 클록 입력이 에지를 검출할 때 변한다.
Edge-sensitive instead of level-sensitive. Fig. 7.37

30 Positive-Edge Triggered D Flip-Flop 기능표
CLK D Qt /Qt Function RESET SET X Qt /Qt Inhibited X Qt /Qt Inhibited X Qt /Qt Inhibited. [에지 검출기] 클럭 입력의 활성 에지를 짧은 활성-레벨 펄스로 변환시키는 회로. 게이트의 전파지연을 이용하여 생성된다. positive 나 negative edge가 될 수 있다. Fig. 7.40

31 Edge Detector Circuit Fig. 7.40

32 D Flip-Flop 동작

33 JK Flip-Flop Negative-Edge Triggered JK Flip-Flop Function Table
CLK J K Qt /Qt Function Qt /Qt No change RESET SET /Qt Qt Toggle.

34 Synchronous vs. Asynchronous Circuits
동기식 회로는 출력이 동일한 시점에서 변하는 순서요소를 가진다. 비동기식 회로는 출력이 상이한 시점에서 변하는 순서요소를 가진다. 비동기식 회로의 단점 - 동작을 해석하는 데 어렵다. - 설계 상에 원하지 않는 중간상태(Intermediate states)가 생성될 수 있다.

35 3-bit 비동기식 카운터 Intermediate states

36 3-bit 동기식 카운터

37 동기와 비동기 입력 플립플롭의 동기 입력(D, J, K 등)은 클록의 활성 에지에서 출력에 영향을 미치는 입력이다.
플립플롭의 비동기 입력은 출력을 즉각적으로 변경시킨다. 비동기 입력은 동기 입력보다 우선한다 플립플롭 비동기 입력 - /Preset – An asynchronous set function, usually designated as /PRE. - /Clear – An asynchronous reset function, usually designated as /CLR. - Active levels are usually LOW.

38 JK Flip-Flop Asynchronous Inputs Function Table
/PRE /CLR J K Qt+1 /Qt Function X X SET X X RESET X X Forbidden See normal function table operation.

39 마스터 리셋(Master Reset) 비동기 입력은 순서회로를 알려진 초기상태로 세트하기 위해 사용된다.
일반적으로 RESET은 모든 플립플롭의 CLR 입력에 연결된다. Fig. 7.57

40 T (Toggle) Flip-Flop 출력은 동기 입력이 활성일 때, 매 클록 펄스마다 토글된다. 동기입력은 ‘T’.
T Flip-Flop Function Table CLK T Qt Function Qt No change /Qt Toggle X Qt Inhibited X Qt Inhibited X Qt Inhibited.

41 T (Toggle) Flip-Flop Function

42 타이밍 파라미터(1) 입력 데이터에 대한 클록 타이밍 클록 타이밍 요구조건
Setup time (ts) – 클록 에지 전에 플립플롭의 동기입력이 안정하게 유지되도록 요구되는 시간. Hold time (th) – 클록 에지 후에 플립플롭의 동기입력이 안정하게 남아 있어야 할 시간. 클록 타이밍 요구조건 Pulse width(tw)는 CLK, /CLR 또는 /PRE 입력에 인가된 활성펄스에 요구되는 최소한의 지속시간이다. 시간은 펄스의 앞 모서리 중간에서 뒤 모서리의 중간 까지로 측정된다.

43 타이밍 파라미터(2) 플립플롭 전파지연시간 플립플롭 회복시간(trec)
입력의 변화 후 출력에서 변화가 일어나는 데 걸리는 시간 출력 천이의 방향에 따라 정의된다. 전파지연의 종류 - tPHL – 출력이 HIGH에서 LOW로 변할 때 측정되는 전파지연 - tPLH – 출력이 LOW에서 HIGH로 변할 때 측정되는 전파지연 플립플롭 회복시간(trec) /CLR 또는 /PRE 펄스의 꼬리 모서리에서 클록 에지까지의 최소시간. 비동기 펄스 입력 후 내부 논리 레벨이 안정된 상태로 도달하는 데 요구되는 시간.

44 Flip-Flop Timing Chart

45 SUMMARY A D Latch can be described in VHDL by an IF statement within a PROCESS. The PROCESS statement in VHDL is concurrent, but the statements inside the PROCESS are sequential. A D Latch can be also implemented in VHDL by instantiating a LATCH primitive as a component in a VHDL design entity or by instantiating a component called lpm_latch from the Library of Parameterized Modules(LPM). An LPM component is a standard component with certain properties, called parameters, that can be specified when the component is instantiated. The inputs and outputs of an LPM component are called ports. Parameter values are assigned in the generic map of a component instantiation statement. Component port names are associated with user port names in the port map of a component instantiation statement.


Download ppt "순차로직 개요."

Similar presentations


Ads by Google