1 / 58

타이밍 분석 및 설계

타이밍 분석 및 설계. Lecture #8. 학습목표. 타이밍 분석 (Timing Analysis) 에서는 기본적인 타이밍 특성인 Propagation Delay, Setup Time, Hold Time 의 개념을 이해 D 플립 플롭 , Shift Register, Counter 그리고 State Machine 의 타이밍 그림을 통해 기본적인 타이밍 특성을 깊이 이해

Download Presentation

타이밍 분석 및 설계

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 타이밍 분석 및 설계 Lecture #8

  2. 학습목표 • 타이밍 분석(Timing Analysis)에서는 기본적인 타이밍 특성인 Propagation Delay, Setup Time, Hold Time의 개념을 이해 • D 플립 플롭, Shift Register, Counter 그리고 State Machine 의 타이밍 그림을 통해 기본적인 타이밍 특성을 깊이 이해 • 타이밍 설계(Timing Design)에서는 특정한 타이밍 그림이 주어졌을 때, 주어진 타이밍 그림으로부터 논리회로를 설계하는 방법을 State Machine, Shift Register, Counter 등을 응용하여 설계하는 방식을 습득 • 다양한 디바이스의 데이터북상에 표현되어있는 타이밍 그림으로부터 디바이스를 제어하기 위한 심화된 지식을 배양 모바일컴퓨팅특강

  3. 강의순서 • 타이밍 분석(Timing Analysis) • 타이밍 설계(Timing Design) 모바일컴퓨팅특강

  4. Timing Analysis - 강의순서 • D Flipflop의 Timing Analysis • Propagation Delay • Setup Time • Hold Time • Shift Register의 Timing Analysis • Counter의 Timing Analysis • State Machine의 Timing Analysis 모바일컴퓨팅특강

  5. Timing Analysis – D-F/F library ieee; use ieee.std_logic_1164.all; entity dff_1 is port( d, clk, nclr : in std_logic; q : out std_logic ); end dff_1 ; architecture a of dff_1 is begin process(nclr,clk) begin if( nclr='0') then q <='0'; elsif(clk'event and clk='1') then q <= d; end if; end process; end a; D F/F을 시뮬레이션 해보고 파형으로부터 Propagation Delay, Setup time, Hold time 의 개념을 살펴보자. 모바일컴퓨팅특강

  6. Timing Analysis - D-F/F 시뮬레이션 전 시뮬레이션 결과 모바일컴퓨팅특강

  7. 확대 확대 4ns 4ns Timing Analysis – Propagation Delay Clk의 상승 edge중의 하나인 500ns에서 보면 입력신호는 1로 안정되어있다.그러므로 출력 q는 clk의 1주기 동안 1을 출력한다. Clk의 상승 edge를 기준으로 약 4ns 의 전파지연이 발생함 Clk의 상승 edge를 기준으로 약 4ns 의 전파지연이 발생함 모바일컴퓨팅특강

  8. 확대 1.1ns Timing Analysis – Setup Time(1) Clk의 상승 edge보다 입력신호 d 가 앞서 도달했다고 해도 정해진 시간(Setup time)보다 길지 못하면 D값을 출력으로 내보내지 못함. 1ns는 setup time 보다 작은 값이므로 출력 y는 그전의 상태인 0을 내보내고있음. 모바일컴퓨팅특강

  9. 확대 2.1ns Timing Analysis – Setup Time(2) Clk의 상승 edge를 기준으로 입력신호 d의 1값이 2.1ns는 앞서 발생되었다. 출력 y가 1을 내보내고있는 것으로 보아 setup time 을 만족. 모바일컴퓨팅특강

  10. Timing Analysis – Hold Time 입력신호 d 가 클럭의 상승 edge를 기준으로 Setup time과 Hold time을 만족하므로 출력이 입력 d의 값인 1을 출력함. -1.7ns Clk의 상승 edge를 기준으로 입력신호 d의 1값이 100ns는 앞서 발생되었다. 하지만 입력 d값이 Clk의 상승 edge를 기준으로 1로 유지되어야 하는 시간(hold time)보다 짧으므로 출력 y가 입력 d값인 ‘1’을 보내지 않음. 1.9ns 모바일컴퓨팅특강

  11. Timing Analysis - Shift Register library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity shiftreg is port( d, clk,nclr : in std_logic; qa,qb : out std_logic ); end shiftreg; architecture a of shiftreg is signal tqa,tqb : std_logic; begin process(nclr,clk) begin if( nclr='0') then tqa <='0'; tqb <='0'; elsif(clk'event and clk='1') then tqa <= d; tqb <= tqa; end if; end process; qa<=tqa; qb<=tqb; end a; Shift Register를 시뮬레이션 해보고 파형으로부터 Propagation Delay, Setup time, Hold time 의 개념을 좀더 깊게 살펴보자. 모바일컴퓨팅특강

  12. Timing Analysis - Shift Register 1. 아래와 같은 입력신호가 주어졌을 때 예상되는 출력 qa의 파형은? F/F의 출력 Waveform은 비동기 신호인 nclr이 0인 경우만을 제외하면 항상 Clk의 Rising Edge를 기준으로 입력 D를 고려하면 된다. D F/F의 시뮬레이션 파형과 Propagation Delay, Setup Time, Hold Time 의 개념을 완전히 이해하고 있으면 거의 모든 Timing Diagram은 그릴 수 있다. 모바일컴퓨팅특강

  13. Timing Analysis - Shift Register 2. Clk의 Rising Edge 300ns, 500ns, 700ns 지점에서 보면 입력신호 D가 모두 Setup Time과 Hold Time을 만족하므로 당연히 아래와 같이 출력 qa의 파형이 나온다. 3. 두 번째 F/F은 입력신호로 qa를 이용하는데, 예상되는 qb의 출력파형은 ? 모바일컴퓨팅특강

  14. Timing Analysis - Shift Register 500ns, 700ns, 900ns에서 모두 Setup time과 Hold time을 만족 확대 확대 확대 4ns 4ns 모바일컴퓨팅특강

  15. Timing Analysis - Counter : 74161 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity cnt161_4bits is port( d3,d2,d1,d0 : in std_logic; nld,ent,enp : in std_logic; clk,nclr : in std_logic; q3,q2,q1,q0 : out std_logic; rco : out std_logic); end cnt161_4bits; architecture a of cnt161_4bits is signal q : std_logic_vector( 3 downto 0); begin process(nclr,clk) variable d : std_logic_vector(3 downto 0); begin d := d3&d2&d1&d0; if( nclr='0') then q <="0000"; elsif(clk'event and clk='1') then if(nld='0') then q <= d; elsif(ent='1' and enp='1') then q <= q+'1'; end if; end if; end process; q3<=q(3); q2<=q(2); q1<=q(1); q0<=q(0); rco <= ent and q(3) and q(2) and q(1) and q(0); end a; Counter를 시뮬레이션 해보고 파형으로부터 Propagation Delay, Setup time, Hold time 의 개념을 좀더 깊게 살펴보자. 모바일컴퓨팅특강

  16. Timing Analysis - Counter : 74161 1.아래와 같은 입력신호가 주어졌을 때 예상되는 카운터의 출력파형은? D F/F의 시뮬레이션 파형과 Propagation Delay, Setup time, Hold time 의 개념을 완전히 이해하고 있으면 거의 모든 Timing Diagram은 그릴 수 있다. nclr의 우선순위가 가장 높음 : nclr=0이면 출력 q(3:0)=0000이 됨. nclr=1일때 모든 동작은 clk의 rising edge에 동기되어 처리됨. Nld=0이면 외부의 입력 d(3:0)이 출력 q(3:0)으로 출력됨. nld=1이면 ent,enp가 모두 1일 때만 출력 q(3:0)의 값이 하나씩 증가한다. Rco는 q(3:0)=15가 되면 1이 된다. 모바일컴퓨팅특강

  17. Timing Analysis - Counter : 74161 2.5us의 cllk rising edge에서 nld=0 이므로 외부의 입력 d(3:0)=12값이 출력 q(3:0)으로 출력됨. 1.5us, 1.9us의 cllk rising edge에서 각각 enp=0, ent=0 이므로 카운터 증가안함 카운터출력 q(3:0)은 15다음 0으로 변화됨. 또한 rco는 a15일 때 1이 됨. 모바일컴퓨팅특강

  18. F/F 과 마찬가지로 Clk의 상승 edge를 기준으로 출력 q[3:0]의 값의 변화가 약 4ns 의 전파지연 후에 발생함 Timing Analysis - Counter : 74161 4ns 4ns 모바일컴퓨팅특강

  19. 0/00 입력신호 : WindowAct S0 1/10 0/01 S1 1/00 WindowAct / RiseShot, FallShot 입력 / 출력1, 출력2 출력신호 상태출력 Timing Analysis –State Machine 1. 아래와 같은 상태도를 갖는 mealy machine에 대해 입력이 아래와 같이 주어졌을 때 예상되는 출력 y와 state의 출력파형은? 모바일컴퓨팅특강

  20. Timing Analysis –State Machine 상태는 초기에 s0로 있다가 입력신호 WindowAct가 0에서 1로 변하고 clk의 첫번째 rising edge에서 s0->s1으로 변하게 됨. S1->s0의 변환시기는 입력신호 WindowAct가 1에서 0으로 변하고 clk의 첫번째 rising edge임. 상태가 s1이면서 입력신호가 1->0으로 변하는 순간 출력 FallShot는 1로 변함. 파형에서 보면 S0=0, s1=1임. 상태가 s0이면서 입력신호가 0->1로 변하는 순간 출력 RisieShot는 1로 변함. 모바일컴퓨팅특강

  21. Timing Analysis –State Machine 4ns 500ns의 clk rising edge를 기준으로 보면 상태출력 state는 502ns에서 변화됨을 알 수 있음. 500ns의 clk rising edge를 기준으로 보면 출력 RiseShot는 502ns에서 변화되는 State보다 더 뒤에 변화 됨을 알 수 있음. 모바일컴퓨팅특강

  22. 0 S0 000 1 1 S1 010 0 1 S2 101 Timing Analysis –State Machine 1. 아래와 같은 상태도를 가지는 moore machine에 대한 입력이 아래와 같이 주어졌을 때 예상되는 출력 y와 state의 출력파형은? 출력신호 : y – 3bits신호 입력신호 : WindowAct 상태출력 모바일컴퓨팅특강

  23. Timing Analysis –State Machine Clk의 rising edge에서 입력신호 WindowAct가 1이며 상태가 s0->s1->s2->s0…로 반복해서 변화되므로 state변화를 예상할 수 있다. 입력신호 WindowAct=0이면 상태의 변화가 없음. 위의 파형에서 보면 실제 state의 값은 S0=00, S1=10, S2=01로 나타나고있다. 출력 y도 상태도와 같은 순서로 출력됨을 알 수 있다. 모바일컴퓨팅특강

  24. Timing Design - 강의순서 • State Machine 응용 • Shift Register 응용 • Counter 응용 1. 주어진 타이밍도로부터 회로를 설계하는 방법을 다양한 형태의 접근 을 통해 습득한다. 2. 각종 디바이스의 데이터 북상에 나타나는 타이밍 도의 이해를 위한 더욱 심화된 지식을 배양한다. 모바일컴퓨팅특강

  25. Timing Design – State Machine Application 1. 아래와 같은 Timing 입출력 파형을 갖는 회로를 설계해보자? 해석 : WindowAct신호가 0에서 1로 변하는 순간에 RiseShot을 1로 만들고, WindowAct신호가 0에서 1로 변하는 순간에 FallShot을 1로 만들어야 함. 모바일컴퓨팅특강

  26. 0/00 S0 1/10 0/01 S1 1/00 Timing Design – State Machine Application 2. 아래와 같은 상태도가 그려지는가?  VHDL 파일은 다음 쪽을 참조. WindowAct / RiseShot, FallShot 입력 / 출력1, 출력2 모바일컴퓨팅특강

  27. 0/00 상태도에서 입력에 따른 상태의 변화만을 기술 S0 1/10 0/01 S1 1/00 Timing Design – State Machine Application Library ieee; Use ieee.std_logic_1164.all; ENTITY RiseFallShot IS PORT( clk : IN STD_LOGIC; reset : IN STD_LOGIC; WindowAct : IN STD_LOGIC; RiseShot, FallShot : OUT STD_LOGIC); END RiseFallShot; ARCHITECTURE a OF RiseFallShot IS TYPE STATE_TYPE IS (s0, s1); SIGNAL state: STATE_TYPE; BEGIN PROCESS (clk, reset) BEGIN IF reset = '0' THEN state <= s0; ELSIF clk'EVENT AND clk = '1' THEN CASE state IS WHEN s0 => IF WindowAct='1' THEN state <= s1; ELSE state <= s0; END IF; WHEN others => IF WindowAct='0' THEN state <= s0; ELSE state <= s1; END IF; END CASE; END IF; END PROCESS; 모바일컴퓨팅특강

  28. 0/00 S0 1/10 0/01 S1 1/00 상태도에서 입력에 따른 출력의 변화만을 기술 Timing Design – State Machine Application PROCESS(reset, state, WindowAct) BEGIN if (reset=‘0’) then RiseShot<=‘0’; FallShot <='0'; else if( state= s0 and WindowAct='1') then RiseShot <='1'; else RiseShot <='0'; end if; if( state= s1 and WindowAct='0') then FallShot <='1'; else FallShot <='0'; end if; end if; END PROCESS; END a; 모바일컴퓨팅특강

  29. 1 3 4 2 1,3에서 RiseShot= WindowAct and not Q Q는 WindowAct를 D F/F으로 통과시킨 출력 2,4에서 FallShot= not WindowAct and Q Timing Design – State Machine Application 3. 상태도를 이용하지 않는 다른 방법은 ?  Timing 만을 고려한 설계. 모바일컴퓨팅특강

  30. Q는 WindowAct를 D F/F으로 통과시킨 출력 WindowAct and not Q Not WindowAct and Q Timing Design – State Machine Application 4. Timing 만을 고려한 설계방식은 아래그림과 같음.  VHDL 파일은 다음 쪽에 있음. not Q not WindowAct 모바일컴퓨팅특강

  31. 같은 회로 같은 회로 Timing Design – State Machine Application library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity RiseFallShot_time is port( WindowAct : in std_logic; clk,nclr : in std_logic; RiseShot,FallShot : out std_logic ); end RiseFallShot_time; architecture a of RiseFallShot_time is signal q : std_logic; signal RisingShotPules : std_logic; begin -- shift register 1bits process(nclr,clk) begin if( nclr='0') then q <='0'; elsif(clk'event and clk='1') then q <= WindowAct; end if; end process; -- rising shot pulse gen. RiseShot <= WindowAct and not q; FallShot <= not WindowAct and q; end a; 모바일컴퓨팅특강

  32. Timing Design – Shift Register Application • 아래와 같은 Timing 입출력 파형을 갖는 회로를 설계해보자? 입력신호 : reset, clk, WindowAct 출력신호 : y0, y1, y2, y3, y4, y5, y6 모바일컴퓨팅특강

  33. Timing Design – Shift Register Application 1. 먼저 아래의 회로를 만들어보자. 입력신호 : reset, clk, WindowAct 출력신호 : y0 어떤 방식으로 설계해야 하는가?  1차적으로 생각할 수 있는 방법은 Shift Register를 이용하는 방법 모바일컴퓨팅특강

  34. Y0 = Q1 and not Q2 Timing Design – Shift Register Application 출력신호 y0는 Q1가 1이되 는 부분과 Q2가 0이 되는 700-900ns부분에서 1이 된다. Y0=Q1 and not Q2 그림과 같은 Shift Register를 사용하게 되면 Q0, Q1, Q2의 타이밍을 예상할 수 있다. 모바일컴퓨팅특강

  35. Timing Design – Shift Register Application 2. 이번에는 y1을 만들어보자. 모바일컴퓨팅특강

  36. Timing Design – Shift Register Application Y0를 clk의 falling edge를 이용하여 시프트하면 반클럭 시프트된Y1을 만들 수 있다. 모바일컴퓨팅특강

  37. Timing Design – Shift Register Application 3. 이번에는 y2을 만들어보자. 모바일컴퓨팅특강

  38. Y2 = Y0 or Y1 Timing Design – Shift Register Application Y2는 Y0와 Y1을 OR 한 것임을 알 수 있다. Y2 = Y0 or Y1 모바일컴퓨팅특강

  39. Timing Design – Shift Register Application 4. 이번에는 y3을 만들어보자. 모바일컴퓨팅특강

  40. 11 bits Shift Register Y3는 11개의 shift register중에서 Q9가 1이면 Q10이 0인 구간에 1이 출력되는 신호. Timing Design – Shift Register Application 회로는 다음 쪽 참조 모바일컴퓨팅특강

  41. Y3는 11개의 shift register중에서 Q10과 Q9를 이용한 신호임. Y3 = Q9 and not Q10 Timing Design – Shift Register Application 모바일컴퓨팅특강

  42. Timing Design – Shift Register Application 5. 이번에는 y4을 만들어보자. 모바일컴퓨팅특강

  43. Y4는 Y1와 Y3을 OR 한 것임을 알 수 있다. Y4 = Y1 or Y3 Timing Design – Shift Register Application 모바일컴퓨팅특강

  44. Timing Design – Shift Register Application 6. 이번에는 y5을 만들어보자. 모바일컴퓨팅특강

  45. Timing Design – Shift Register Application Y5는 Q2가 1이며 Q10이 0인 구간에 1을 출력. 모바일컴퓨팅특강

  46. Timing Design – Shift Register Application 7. 이번에는 y6을 만들어보자. 모바일컴퓨팅특강

  47. Timing Design – Shift Register Application Y6p는 Q1이 1이며 Q9가 0인 구간에 1을 출력. Y6는 Y6p를 Clk의 Falling Edge를 이용하여 반 클럭 밀어준 신호임. 모바일컴퓨팅특강

  48. 동일회로 동일회로 Timing Design – Shift Register Application library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity shift_app2 is port( clk,nclr,WindowAct : in std_logic; y : buffer std_logic_vector(0 to 6)); end shift_app2; architecture a of shift_app2 is signal q : std_logic_vector(0 to 10); signal y6p : std_logic; begin ShiftRegster : process(nclr,clk) begin if( nclr='0') then q<="00000000000"; elsif(clk'event and clk='1') then q(0)<= WindowAct; for i in 0 to 9 loop q(i+1) <= q(i); end loop; end if; end process; y(0) <= q(1) and not q(2); 모바일컴퓨팅특강

  49. 동일회로 동일회로 동일회로 Timing Design – Shift Register Application process(nclr,clk) begin if( nclr='0') then y(1)<='0'; elsif(clk'event and clk='0') then y(1)<=y(0); end if; end process; y(2) <= y(0) or y(1); y(3) <= q(9) and not q(10); y(4) <= y(1) or y(3); y(5) <= q(2) and not q(10); y6p <= q(1) and not q(9); process(nclr,clk) begin if( nclr='0') then y(6)<='0'; elsif(clk'event and clk='0') then y(6)<=y6p; end if; end process; end a; 모바일컴퓨팅특강

  50. Timing Design – Counter Application • 아래와 같은 Timing 입출력 파형을 갖는 회로를 Shift Register가 아닌 다른 방식(Counter응용)으로 설계해보자. 입력신호 : reset, clk, WindowAct 출력신호 : y0, y1, y2, y3, y4, y5, y6 모바일컴퓨팅특강

More Related