• 沒有找到結果。

11.6 J-K Flip-Flop 11.7 T Flip-Flop

N/A
N/A
Protected

Academic year: 2022

Share "11.6 J-K Flip-Flop 11.7 T Flip-Flop"

Copied!
18
0
0

加載中.... (立即查看全文)

全文

(1)

1

Unit 11 Latches and Flip-Flops 1

Latches and Flip-Flops

11.1 Introduction 11.2 Set-Reset Latch 11.3 Gated D Latch

11.4 Edge-Triggered D Flip-Flop 11.5 S-R Flip-Flop

11.6 J-K Flip-Flop 11.7 T Flip-Flop

11.8 Flip-Flops with additional Inputs

Unit 11 Latches and Flip-Flops 2

Edge-Triggered D Flip-Flop 邊緣觸發D型正反器

„ D型正反器有2個輸入:

‰

D(資料)和

‰

Ck(時脈)。

‰

正反器的輸出只對時脈有反應,與D的變化無關。

(2)

Unit 11 Latches and Flip-Flops 3

Edge-Triggered

„ active edge(作用邊緣):

‰

指觸發正反器讓狀態改變的時脈邊緣

„

rising edge(上緣)或

„

falling edge(下緣)。

„ Rising Edge-Triggered上升邊緣(正緣)觸發:

‰

如果輸出變化對時脈輸入從0到1轉換有反應,稱此 正反器被時脈的上升邊緣觸發。

„ Falling Edge-Triggered下降邊緣(負緣)觸發:

‰

如果輸出變化只對時脈輸入從1到0的轉換有反應,

稱此正反器被時脈的下降邊緣觸發。

Timing for D Flip-Flop (Falling-Edge Trigger)

„ D型正反器的時序:

(3)

3

Unit 11 Latches and Flip-Flops 5

D Flip-Flop

(Rising-Edge Trigger)

„ 上升邊緣觸發D型正反器:

‰

用2個gated D latches和一個inverter組成。

Unit 11 Latches and Flip-Flops 6

„ 當 CLK = 0,G

1

=1,

‰ 第1個latch直接穿透,所以輸出

P

緊跟著

D

輸入。

‰ 因為G2=0,第2個latch維持

Q

目前的值。

„ 當 CLK 變成1,

‰ G1變成0,

D

目前的值儲存在第1個latch中。

‰ 因為G2=1,

P

的值流經第2個latch到達輸出

Q

„ 當 CLK 變回成0,

‰ 第2個latch取得

P

的值並保存該值,

‰ 接著第1個latch開始再次跟隨

D

的輸入。

‰ 如果第1個latch在第2個latch取得P的值之前跟隨

D

的輸入,

則正反器的功能不正確。

(4)

Unit 11 Latches and Flip-Flops 7

Review Question

„ 【習題11.5】 (page 311):

‰ What change must be made to Figure 11-15(a) to implement a falling-edge triggered D flip-flop?

‰ Complete the following timing diagram for the modified flip-flop

.

Setup and Hold Times

„ 正反器只在時脈觸發邊緣改變狀態,

‰ 正反器的傳播延遲是時脈觸發邊緣到輸出改變之間的時間。

‰ 為了能正常動作,邊緣觸發正反器的

D

輸入在時脈作用邊緣前

後一段時間內必須維持定值。

„ setup time ( t su ) :在觸發邊緣之前 D 必須穩定的時間。

„ hold time ( t h ):在觸發邊緣之後 D 必須維持的時間。

(5)

5

Unit 11 Latches and Flip-Flops 9

Determination of Minimum Clock Period

„ 不違反時序限制的最小時脈週期。

„ EX:假設

‰ inverter的傳播延遲為2

ns

‰ 同時假設flip-flop的傳播延遲為5

ns

‰ setup time為3

ns

(hold time不影響計算)。

‰ 若時脈週期為9

ns

, 則flip-flop也許無法取得 正確的值。

Unit 11 Latches and Flip-Flops 10

Determination of Minimum Clock Period (Cont’d)

„ 若時脈週期為15 ns ,則 flip-flop 能正常動作。

„ 10 ns 是電路能動作的最小時脈週期。

(6)

Unit 11 Latches and Flip-Flops 11

Latches and Flip-Flops

11.1 Introduction 11.2 Set-Reset Latch 11.3 Gated D Latch

11.4 Edge-Triggered D Flip-Flop 11.5 S-R Flip-Flop

11.6 J-K Flip-Flop 11.7 T Flip-Flop

11.8 Flip-Flops with additional Inputs

S-R Flip-Flop

„ S-R正反器:

(7)

7

Unit 11 Latches and Flip-Flops 13

S-R Flip-Flop implementation

„ 2個 S-R latch和邏輯閘組成的 S-R flip-flop (主從式正 反器):

‰ 當

CLK = 0, S

R

輸入將master的輸出設成適當的值,而 slave維持之前的

Q

值。

‰ 當時脈從0變成1,

P

的值保留在master ,且此值轉送到 slave 。

‰ 當

CLK = 1,

master維持

P

的值,也因此

Q

不會改變。

‰ 當時脈從1變成0,

Q

的值被鎖在slave ,讓master可以處理 新的輸入。

master slave

Unit 11 Latches and Flip-Flops 14

Timing for S-R Flip-Flop

„ 主從式正反器之時序:

(8)

Unit 11 Latches and Flip-Flops 15

Review Question

„ 【習題11.6】 (page 311):

A reset-dominant flip-flop behaves like an S-R flip- flop, except that the input S=R=1 is allowed, and the flip-flop is reset when S=R=1.

‰ Derive the characteristic equation for a reset-dominant flip- flop

‰ Show how a reset-dominant flip-flop can be constructed by adding gate(s) to an S-R flip-flop.

Latches and Flip-Flops

11.1 Introduction 11.2 Set-Reset Latch 11.3 Gated D Latch

11.4 Edge-Triggered D Flip-Flop 11.5 S-R Flip-Flop

11.6 J-K Flip-Flop 11.7 T Flip-Flop

11.8 Flip-Flops with additional Inputs

(9)

9

Unit 11 Latches and Flip-Flops 17

J-K Flip-Flop

„ J-K正反器:

‰

J-K正反器有三個輸入,J、K和時脈(CK)。

‰

J輸入對應到S,K對應到R。

Unit 11 Latches and Flip-Flops 18

J-K Flip-Flop Timing

„ J-K正反器的時序:

Q changes on

the rising edge

(10)

Unit 11 Latches and Flip-Flops 19

Master-Slave J-K Flip-flop

„ 利用2個 S-R latch 聯結成圖11-21所示的主-從 ( master-slave )式架構,實現 J-K flip-flop 。

master

slave

Review Question

„ 【習題11.7】 (page 311):

Complete the following timing diagram for the flip-

flop of Figure 11-20(a).

(11)

11

Unit 11 Latches and Flip-Flops 21

Latches and Flip-Flops

11.1 Introduction 11.2 Set-Reset Latch 11.3 Gated D Latch

11.4 Edge-Triggered D Flip-Flop 11.5 S-R Flip-Flop

11.6 J-K Flip-Flop 11.7 T Flip-Flop

11.8 Flip-Flops with additional Inputs

Unit 11 Latches and Flip-Flops 22

T Flip-Flop

„ T型正反器(切換( toggle )正反器):

‰

有1個 T 輸入和1個時脈輸入。

‰

當 T = 1時,正反器在時脈觸發邊緣之後改變狀態。

‰

當 T = 0時,不會發生狀態改變。

(12)

Unit 11 Latches and Flip-Flops 23

Timing Diagram for T Flip-flop

„ T型正反器的時序: falling edge trigger

Implementation of T Flip-flop

„ 利用

1) J-K正反器、

2) D型正反器和XOR閘 實現 T flip-flop 。

(13)

13

Unit 11 Latches and Flip-Flops 25

Latches and Flip-Flops

11.1 Introduction 11.2 Set-Reset Latch 11.3 Gated D Latch

11.4 Edge-Triggered D Flip-Flop 11.5 S-R Flip-Flop

11.6 J-K Flip-Flop 11.7 T Flip-Flop

11.8 Flip-Flops with additional Inputs

Unit 11 Latches and Flip-Flops 26

Flip-Flops with additional Inputs 具有額外輸入的正反器

„ 正反器通常具有額外的輸入,可以用來設置與 時脈無關的正反器初始狀態。

‰

clear (ClrN) and preset (PreN)

(14)

Unit 11 Latches and Flip-Flops 27

Timing Diagram for D Flip-Flop with Asynchronous Clear and Preset

„ 具有非同步清除和預置輸入動作的D型正反器 時序圖。

Review Question

„ 【習題11.9】 (page 312):

a)

Complete the following timing diagram for a J-K flip-flop with a falling-edge trigger and asynchronous ClrNand

PreN

inputs.

(15)

15

Unit 11 Latches and Flip-Flops 29

Review Question

„ 【習題11.9】 (page 312):

b)

Complete the timing diagram for the following circuit. Note that the Ck inputs on the two flip-flops are different.

Unit 11 Latches and Flip-Flops 30

D Flip-Flop with Clock Enable

„ 欲設計同步數位系統(synchronous) 當即使正反器的資料輸入有變化,

我們仍希望某些正反器能維持現在的資料 --利用閘控時脈(gating the clock)。

‰

當 En = 0時,正反器的時脈輸入為0, Q 不會改變。

(16)

Unit 11 Latches and Flip-Flops 31

Two Potential Problems

„ 使用閘控時脈的缺點:

‰

首先,閘控延遲會讓時脈在不同的時間抵達不同的 正反器,造成同步性的缺失。

‰

其次,若 En 在錯誤的時間點改變,正反器也許會因 En 改變而被觸發,而非因時脈的改變,再一次導致 同步性的缺失。

„ 改善方式:

‰

採用具有 時脈致能( CE )的正反器。

D Flip-flop with Clock Enable

„ D-CE flip-flop :具有時脈致能的D型正反器

‰

當 CE = 0時,時脈被禁能,不會發生狀態變化,所

以Q + =Q。

‰

當 CE = 1時,正反器的動作像一般的 D 正反器,所 以Q + =D。

‰

因此特性方程式為Q + = Q•CE’ + D•CE。

(17)

17

Unit 11 Latches and Flip-Flops 33

Review Question

„ 【習題11.8】 (page 312):

Complete the following diagrams for the falling- edge triggered D-CE flip-flop of Figure 11-27(c).

Assume Q begins at 1.

a)

First draw Q based on your understanding of the behavior of a D flip-flop with clock enable.

b)

Now draw the internal signal D from Figure 11-27(c), and confirm that this gives the same Q as in a).

Unit 11 Latches and Flip-Flops 34

Summary (總結)

„ 正反器的特性( next state )方程式可以推導如下:

‰ 首先,製作一個真值表,

„ 表中

next state

(Q+)為

current state

(Q)和輸入之函數,

„ 任何不合規定的輸入組合則用不理會項來處理。

‰ 接著繪出Q+的圖,從圖中導出特性方程式。

„ 特性方程式適用於閂和正反器,但是兩者的解釋方式 不同。

‰ 例如,對

gated D latch

而言,Q+代表

latch

在某個輸入改

變短暫時間之後的狀態。

‰ 但是對

D flip-flop

而言,Q+代表

flip-flop

在時脈觸發邊緣

短暫時間之後的狀態。

(18)

Unit 11 Latches and Flip-Flops 35

Characteristic Equations

„ latches 與 flip-flops 的特性方程式:

Review Question

„ 【習題11.10】 (page 313):

Covert by adding external:

a)

a D flip-flop to a J-K flip-flop.

b)

a T flip-flop to a D flip-flop.

c)

a T flip-flop to a D flip-flop with clock enable.

參考文獻

相關文件

So we check derivative of f and g, the small one would correspond to graph (b) and the other to (c)(i.e.. Moreover, f is

11[] If a and b are fixed numbers, find parametric equations for the curve that consists of all possible positions of the point P in the figure, using the angle (J as the

We conclude this section with the following theorem concerning the relation between Galois extension, normal extension and splitting fields.

Con- cerning the complexity of the k-power domination problem, we first show that deciding whether a graph admits a k-power dominating set of size at most t is NP-complete for

D) radioactive cleavage E) radioactive merge Answer: B.. 5) The chart below shows the mass of a decaying nuclide versus time.. 47) The following is part of a

The reduction of the tunnel magnetoresistance ratio for the low annealing temperature 共200 °C兲 may be caused by the spin flip scattering at oxide ion, rather than by the change

The Hilbert space of an orbifold field theory [6] is decomposed into twisted sectors H g , that are labelled by the conjugacy classes [g] of the orbifold group, in our case

In this paper, we define various means associated with Lorentz cones (also known as second-order cones), which are new concepts and natural extensions of traditional arithmetic