Chapter 9 Counters 計數器 Asynchronous Counter Operation 非同步式計數器的運作

Slides:



Advertisements
Similar presentations
Figure 8–1 A 2-bit asynchronous binary counter
Advertisements

Flip-Flops and Related Devices
Chapter 10 馬可夫鏈 緒言 如果讀者仔細觀察日常生活中所發生的 諸多事件,必然會發現有些事件的未來 發展或演變與該事件現階段的狀況全然 無關,這種事件稱為獨立試行過程 (process of independent trials) ;而另一些 事件則會受到該事件現階段的狀況影響。
: Arrange the Numbers ★★★☆☆ 題組: Contest Archive with Online Judge 題號: 11481: Arrange the Numbers 解題者:李重儀 解題日期: 2008 年 9 月 13 日 題意: 將數列 {1,2,3, …,N}
布林代數的應用--- 全及項(最小項)和全或項(最大項)展開式
第七章 抽樣與抽樣分配 蒐集統計資料最常見的方式是抽查。這 牽涉到兩個問題: 抽出的樣本是否具有代表性?是否能反應出母體的特徵?
: A-Sequence 星級 : ★★☆☆☆ 題組: Online-judge.uva.es PROBLEM SET Volume CIX 題號: Problem D : A-Sequence 解題者:薛祖淵 解題日期: 2006 年 2 月 21 日 題意:一開始先輸入一個.
:Word Morphing ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10508:word morphing 解題者:楊家豪 解題日期: 2006 年 5 月 21 日 題意: 第一行給你兩個正整數, 第一個代表下面會出現幾個字串,
Section 1.2 Describing Distributions with Numbers 用數字描述分配.
3Com Switch 4500 切VLAN教學.
指導教授:陳淑媛 學生:李宗叡 李卿輔.  利用下列三種方法 (Edge Detection 、 Local Binary Pattern 、 Structured Local Edge Pattern) 來判斷是否為場景變換,以方便使用者來 找出所要的片段。
Sequential Circuit - Counter -
1.1 線性方程式系統簡介 1.2 高斯消去法與高斯-喬登消去法 1.3 線性方程式系統的應用(-Skip-)
: Boxes ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11003: Boxes 解題者:蔡欣燁 解題日期: 2007 年 3 月 19 日.
1 Chapter 6 狀態機設計法 狀態機設計法的介紹 在圖形編輯器視窗下執行 在 Project Manager 視窗下執行.
: OPENING DOORS ? 題組: Problem Set Archive with Online Judge 題號: 10606: OPENING DOORS 解題者:侯沛彣 解題日期: 2006 年 6 月 11 日 題意: - 某間學校有 N 個學生,每個學生都有自己的衣物櫃.
Chapter 2 聯立線性方程式與矩陣 緒言 線性方程式組 (systems of linear equations) 出現 在多數線性模式 (linear model) 中。根據以往解 題的經驗,讀者們也許已發現方程式的解僅與 該方程式的係數有關,求解的過程也僅與係數 的運算有關,只要係數間的相關位置不改變,
STAT0_sampling Random Sampling  母體: Finite population & Infinity population  由一大小為 N 的有限母體中抽出一樣本數為 n 的樣 本,若每一樣本被抽出的機率是一樣的,這樣本稱 為隨機樣本 (random sample)
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 肆 資料分析與表達.
2009fallStat_samplec.i.1 Chap10 Sampling distribution (review) 樣本必須是隨機樣本 (random sample) ,才能代表母體 Sample mean 是一隨機變數,隨著每一次抽出來的 樣本值不同,它的值也不同,但會有規律性 為了要知道估計的精確性,必需要知道樣本平均數.
© The McGraw-Hill Companies, Inc., 2008 第 6 章 製造流程的選擇與設計.
第 1 章 PC 的基本構造. 本章提要 PC 系統簡介 80x86 系列 CPU 及其暫存器群 記憶體: Memory 80x86 的分節式記憶體管理 80x86 的 I/O 結構 學習組合語言的基本工具.
:Problem D: Bit-wise Sequence ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10232: Problem D: Bit-wise Sequence 解題者:李濟宇 解題日期: 2006 年 4 月 16.
: The largest Clique ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11324: The largest Clique 解題者:李重儀 解題日期: 2008 年 11 月 24 日 題意: 簡單來說,給你一個 directed.
: Happy Number ★ ? 題組: Problem Set Archive with Online Judge 題號: 10591: Happy Number 解題者:陳瀅文 解題日期: 2006 年 6 月 6 日 題意:判斷一個正整數 N 是否為 Happy Number.
: Fast and Easy Data Compressor ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10043: Fast and Easy Data Compressor 解題者:葉貫中 解題日期: 2007 年 3.
: Ahoy, Pirates! ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11402: Ahoy, Pirates! 解題者:李重儀 解題日期: 2008 年 8 月 26 日 題意:有一個海盜島有 N 個海盜,他們的編號 (id)
組合邏輯的函數 Functions of Combination Logic
: Multisets and Sequences ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11023: Multisets and Sequences 解題者:葉貫中 解題日期: 2007 年 4 月 24 日 題意:在這個題目中,我們要定義.
:Nuts for nuts..Nuts for nuts.. ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 10944:Nuts for nuts.. 解題者:楊家豪 解題日期: 2006 年 2 月 題意: 給定兩個正整數 x,y.
資料結構實習-一 參數傳遞.
第10章 移位暫存器 10-1 移位暫存器的基本功能 10-2 串列輸入/輸出移位暫存器 10-3 其他移位暫存器的線路型態
: Problem G e-Coins ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10306: Problem G e-Coins 解題者:陳瀅文 解題日期: 2006 年 5 月 2 日 題意:給定一個正整數 S (0
: Beautiful Numbers ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11472: Beautiful Numbers 解題者:邱經達 解題日期: 2011 年 5 月 5 日 題意: 若一個 N 進位的數用到該.
Section 4.2 Probability Models 機率模式. 由實驗看機率 實驗前先列出所有可能的實驗結果。 – 擲銅板:正面或反面。 – 擲骰子: 1~6 點。 – 擲骰子兩顆: (1,1),(1,2),(1,3),… 等 36 種。 決定每一個可能的實驗結果發生機率。 – 實驗後所有的實驗結果整理得到。
資料結構實習-二.
演算法 8-1 最大數及最小數找法 8-2 排序 8-3 二元搜尋法.
: Expect the Expected ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11427: Expect the Expected 解題者:李重儀 解題日期: 2008 年 9 月 21 日 題意:玩一種遊戲 (a game.
Chapter 3 Entropy : An Additional Balance Equation
845: Gas Station Numbers ★★★ 題組: Problem Set Archive with Online Judge 題號: 845: Gas Station Numbers. 解題者:張維珊 解題日期: 2006 年 2 月 題意: 將輸入的數字,經過重新排列組合或旋轉數字,得到比原先的數字大,
Chapter 10 m-way 搜尋樹與B-Tree
Probability Distribution 機率分配 汪群超 12/12. 目的:產生具均等分配的數值 (Data) ,並以 『直方圖』的功能計算出數值在不同範圍內出現 的頻率,及繪製數值的分配圖,以反應出該 機率分配的特性。
計算機概論 第6章 數位邏輯設計.
2005/7 Linear system-1 The Linear Equation System and Eliminations.
冷凍空調自動控制 - 系統性能分析 李達生. Focusing here … 概論 自動控制理論發展 自控系統設計實例 Laplace Transform 冷凍空調自動控制 控制系統範例 控制元件作動原理 控制系統除錯 自動控制理論 系統穩定度分析 系統性能分析 PID Controller 自動控制實務.
: Problem E Antimatter Ray Clearcutting ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11008: Problem E Antimatter Ray Clearcutting 解題者:林王智瑞.
第 6 章 迴圈結構 6-1 計數迴圈 6-1 計數迴圈 6-2 條件迴圈 6-2 條件迴圈 6-3 巢狀迴圈 6-3 巢狀迴圈 6-4 While/End While 迴圈 6-4 While/End While 迴圈 6-5 跳出迴圈 6-5 跳出迴圈 6-6 VB.NET 的錯誤處理 6-6 VB.NET.
Teacher : Ing-Jer Huang TA : Chien-Hung Chen 2015/6/30 Course Embedded Systems : Principles and Implementations Weekly Preview Question CH7.1~CH /12/26.
:Count the Trees ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10007:Count the Trees 解題者:楊家豪 解題日期: 2006 年 3 月 題意: 給 n 個點, 每一個點有自己的 Label,
數字系統與資料表示法 教師: 陳炯勳 數系轉換 r進制數字 稱為 base r或 radix r 有r個計數符號,計數順序逢r歸零(進位) A n A n - 1 ‥‥A 2 A 1 A 0 ﹒A -1 A -2 ‥‥A -m 其中A n 及A.
第五章IIR數位濾波器設計 濾波器的功能乃對於數位信號進行處理﹐ 以滿足系統的需求規格。其作法為設計一 個系統的轉移函數﹐或者差分方程式﹐使 其頻率響應落在規格的範圍內。本章探討 的是其中一種方法﹐稱為Infinite impulse register(IIR)。 IIR架構說明。 各種不同頻帶(Band)濾波器的設計方法。
: Finding Paths in Grid ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11486: Finding Paths in Grid 解題者:李重儀 解題日期: 2008 年 10 月 14 日 題意:給一個 7 個 column.
:Problem E.Stone Game ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10165: Problem E.Stone Game 解題者:李濟宇 解題日期: 2006 年 3 月 26 日 題意: Jack 與 Jim.
:Rings and Glue ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10301: Rings and Glue 解題者:施博修 解題日期: 2011 年 5 月 18 日 題意:小約翰有了個大麻煩,他不小心將 rings.
幼兒行為觀察與記錄 第八章 事件取樣法.
第 1 章 PC 的基本構造. 本章提要 PC 系統簡介 80x86 系列 CPU 及其暫存器群 記憶體: Memory 80x86 的分節式記憶體管理 80x86 的 I/O 結構 學習組合語言的基本工具.
: How many 0's? ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11038: How many 0’s? 解題者:楊鵬宇 解題日期: 2007 年 5 月 15 日 題意:寫下題目給的 m 與 n(m
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 肆 資料分析與表達.
Chapter 9 Counters.
Sequential Circuit - Counter -
Registers(暫存器)與Counters(計數器):
CYU / CSIE / Yu-Hua Lee / E- 1 數位邏輯 Digital Fundamentals Chapter 9 Counters.
CHAPTER 3 Counters.  One of the common requirement in digital circuits/system is counting, both direction (forward and backward)  Digital clocks and.
Operational Amplifiers
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Pp 92 Parity Method Pp 94 The parity method.
Summary Counting in Binary
6-1 基本加法器 6-2 平行二進位加法器 6-3 比較器 6-4 解碼器 6-5 編碼器 6-6 數碼轉換器 6-7 多工器 ( 資料選擇器 ) 6-8 解多工器 6-9 同位元產生器 / 檢 查器.
微分器與積分器 類比電子實驗 單元二 教材投影片放在
Sequential Circuit - Counter -
EET107/3 DIGITAL ELECTRONICS 1
Presentation transcript:

Chapter 9 Counters 計數器 Asynchronous Counter Operation 非同步式計數器的運作 Up/Down Synchronous Counters 上 / 下數的同步式計數器 Design of Synchronous Counters 同步式計數器的設計 Cascaded Counters 串接計數器 Counter Decoding 計數器的解碼 Counter Applications 計數器的應用 Troubleshooting 檢修 Logical Symbols with Dependency Notation 具有相依註標的邏輯符號 Programmable Logic 可程式邏輯 Digital System Application 數位系統的應用

除法器 J K Clk Q Q0 1 Flip-Flop Applications 正反器的用途 Q0 不變 1 Reset Set 轉態 Figure 8--40 The J-K flip-flop as a divide-by-2 device. Q is one-half the frequency of CLK. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--1 A 2-bit asynchronous binary counter. 1. 非同步式計數器的運作 Figure 9--1 A 2-bit asynchronous binary counter. 1 1 1 1 Figure 9--2 Timing diagram for the counter of Figure 9-1. As in previous chapters, output waveforms are shown in green. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

1. 非同步式計數器的運作 Figure 9--3 Three-bit asynchronous binary counter and its timing diagram for one cycle. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

1. 非同步式計數器的運作 Figure 9--4 Propagation delays in a 3-bit asynchronous (ripple-clocked) binary counter. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

1. 非同步式計數器的運作 例題9-1 如圖9-5所示為一個4位元的非同步二進制計數器, 每一個正反器都是負緣觸發而且有一個10ns的極際延遲時間. (1)設計各正反器輸出的時序圖, (2)算出從Clock輸入加訊號進去到Q3輸出的延遲時間, (3)算出最高工作頻率. Sol: (2) tp(Total) = 4 x 10ns = 40ns (3) fmax = 1/ tp(Total) = 1/40ns = 25MHz Figure 9--5 Four-bit asynchronous binary counter and its timing diagram. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

1. 非同步式計數器的運作 Figure 9--6 An asynchronously clocked decade counter with asynchronous recycling. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

例題9-2 證明一個非同步的計數器如何除12, 從二進制的0000算到1011. 1. 非同步式計數器的運作 Figure 9--7 Asynchronously clocked modulus-12 counter with asynchronous recycling. 很尖銳的脈波 例題9-2 證明一個非同步的計數器如何除12, 從二進制的0000算到1011. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

1. 非同步式計數器的運作 FigureA--21 The 74LS93A 4-bit asynchronous binary counter logic diagram. (Pin numbers are in parentheses, and all J and K inputs are internally connected HIGH.) Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

1. 非同步式計數器的運作 Figure A--22 Two configurations of the 74LS93A asynchronous counter. (The qualifying label, CTR DIV n, indicates a counter with n states.) Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure A-23 74LS93A connected as a modulus-12 counter. 1. 非同步式計數器的運作 例題9-3 證明74LS93A 如何作為一個除12的計數器. Figure A-23 74LS93A connected as a modulus-12 counter. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

A 2-bit synchronous binary counter. 2. 同步式計數器的運作 A 2-bit synchronous binary counter. Figure 9--10 Timing diagram for the counter of Figure 9-11. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

解釋前一頁每次Clock來時Q0及Q1的變化 2. 同步式計數器的運作 解釋前一頁每次Clock來時Q0及Q1的變化 第一個脈波 第二個脈波 第三個脈波 第四個脈波 Figure 9--9 Timing details for the 2-bit synchronous counter operation (the propagation delays of both flip-flops are assumed to be equal). Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--11 A 3-bit synchronous binary counter. 2. 同步式計數器的運作 Figure 9--11 A 3-bit synchronous binary counter. Figure 9--12 Timing diagram for the counter of Figure 9-14. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

2. 同步式計數器的運作 FF2在Q0Q1同時為1時,下一個脈波來會改變狀態, FF3則在Q0Q1Q2同時為1時,下一個脈波來才會改變狀態, Figure 9--13 A 4-bit synchronous binary counter and timing diagram. Points where the AND gate outputs are HIGH are indicated by the shaded areas. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--14 A synchronous BCD decade counter.. 2. 同步式計數器的運作 Figure 9--14 A synchronous BCD decade counter.. Figure 9--15 Timing diagram for the BCD decade counter (Q0 is the LSB). Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

2. 同步式計數器的運作 Figure A--24 The 74HC163 4-bit synchronous binary counter. (The qualifying label CTR DIV 16 indicates a counter with sixteen states.) Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure A--25 Timing example for a 74HC163. 2. 同步式計數器的運作 Figure A--25 Timing example for a 74HC163. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

2. 同步式計數器的運作 Figure A--26 The 74LS160 synchronous BCD decade counter. (The qualifying label CTR DIV 10 indicates a counter with ten states.) Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure A--27 Timing example for a 74LS160. 2. 同步式計數器的運作 Figure A--27 Timing example for a 74LS160. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--16 A basic 3-bit up/down synchronous counter. 3. 上 / 下數的同步式計數器 Figure 9--16 A basic 3-bit up/down synchronous counter. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

3. 上 / 下數的同步式計數器 Figure 9--17 Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure A--28 The 74HC190 up/down synchronous decade counter. 3. 上 / 下數的同步式計數器 Figure A--28 The 74HC190 up/down synchronous decade counter. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure A--29 Timing example for a 74HC190. 3. 上 / 下數的同步式計數器 Figure A--29 Timing example for a 74HC190. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--18 General clocked sequential circuit. 4. 同步式計數器的設計 激勵線 輸入線與狀態變數線加到組合邏輯電路產生激勵訊號線 狀態變數線 Previous State  Present State  Next State Figure 9--18 General clocked sequential circuit. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--19 State diagram for a 3-bit Gray code counter. 4. 同步式計數器的設計 步驟一: 畫出狀態圖 Figure 9--19 State diagram for a 3-bit Gray code counter. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

步驟四: 根據下一狀態表及正反器的暫態表填寫卡諾圖. 4. 同步式計數器的設計 步驟二: 寫出 下一狀態表. 步驟三: 寫出 正反器的暫態表. 步驟四: 根據下一狀態表及正反器的暫態表填寫卡諾圖. Figure 9--20 Examples of the mapping procedure for the counter sequence represented in Table 9-7 and Table 9-8. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--21 Karnaugh maps for present-state J and K inputs. 4. 同步式計數器的設計 Figure 9--21 Karnaugh maps for present-state J and K inputs. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--22 Three-bit Gray code counter. 4. 同步式計數器的設計 步驟五: 寫出各正反器的輸入端之邏輯表示式 J0 = Q2Q1 + Q2Q1 = Q2 xor Q1 K0 = Q2Q1 + Q2Q1 = Q2 xor Q1 J1 = Q2Q0 K1 = Q2Q0 J2 = Q1Q0 K2 = Q1Q0 Figure 9--22 Three-bit Gray code counter. 步驟六: 畫出電路圖 Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

例題9-5 使用JK正反器, 設計一個如圖9-32所示不按照二進制計數順序的計數器. 4. 同步式計數器的設計 Present State Q2 Q1 Q0 Next State 0 0 1 0 1 0 1 0 1 1 1 1 例題9-5 使用JK正反器, 設計一個如圖9-32所示不按照二進制計數順序的計數器. Figure 9--23 Output Transitions QN QN+1 Flip-Flop Inputs J K 0  0 0 x 0  1 1 x 1  0 x 1 1  1 x 0 Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

4. 同步式計數器的設計 Figure 9--24 Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

4. 同步式計數器的設計 J0 = 1, K = Q2 J1 = K1 = 1 J2 = K2 = Q1 Figure 9--25 Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--26 State diagram for a 3-bit up/down Gray code counter. 4. 同步式計數器的設計 例題9-6 試設計一個3位元的格雷碼同步式上下數計數器, 當UP/DOWN為1時往上數, 為0時往下數. Figure 9--26 State diagram for a 3-bit up/down Gray code counter. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

4. 同步式計數器的設計 Present State Next State Y=0(Down) Y=1(Up) Q2 Q1 Q0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 1 0 1 0 1 1 0 1 1 1 1 0 1 Output Transitions QN QN+1 Flip-Flop Inputs J K 0  0 0 x 0  1 1 x 1  0 x 1 1  1 x 0

4. 同步式計數器的設計 Figure 9--27 J and K maps for Table 9-11. The UP/DOWN control input, Y, is treated as a fourth variable. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--28 Three-bit up/down Gray code counter. 4. 同步式計數器的設計 步驟五: 寫出各正反器的輸入端之邏輯表示式 步驟六: 畫出電路圖 Figure 9--28 Three-bit up/down Gray code counter. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--29 Two cascaded counters (all J and K inputs are HIGH). 5. 串接計數器 Figure 9--29 Two cascaded counters (all J and K inputs are HIGH). Figure 9--30 Timing diagram for the cascaded counter configuration of Figure 9-38. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--31 A modulus-100 counter using two cascaded decade counters. 5. 串接計數器 Figure 9--31 A modulus-100 counter using two cascaded decade counters. Figure 9--32 Three cascaded decade counters forming a divide-by-1000 frequency divider with intermediate divide- by-10 and divide-by-100 outputs. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

5. 串接計數器 例題9-7 試算出圖9-42中兩個電路全部各除多少? Sol: 9-42(a) 8 x 12 x 16 = 1536 9-42(b) 10 x 4 x 7 x 5 = 1400 Figure 9--33 Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

例題9-8 使用74LS160 計數器設計一個電路, 將1MHz的訊號從Clock端輸入, 輸出端得到10KHz. 5. 串接計數器 例題9-8 使用74LS160 計數器設計一個電路, 將1MHz的訊號從Clock端輸入, 輸出端得到10KHz. Figure 9--34 A divide-by-100 counter using two 74LS160 decade counters. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

5. 串接計數器 從63C0算到FFFF, 即除以40,000. 63C0H = 25,536. 40,000 = 65535 – 25536 + 1 Figure 9--35 A divide-by-40,000 counter using 74HC161 4-bit binary counters. Note that each of the parallel data inputs is shown in binary order (the right-most bit D0 is the LSB in each counter). Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

解題步驟 (n,m,x,y 皆為正整數) 決定所需位元數 n (x:所需除數) 決定所需74161個數 m 畫電路圖

計數器之解碼 對計數器序列中任何指定狀態實作其解碼邏輯 使用閃控法(Strobe)消除解碼時的脈衝干擾 6. 計數器的解碼 Output=1 解碼器 Output=1 At counter = 6

Figure 9--36 Decoding of state 6 (110). 6. 計數器的解碼 Figure 9--36 Decoding of state 6 (110). Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

6. 計數器的解碼 Figure 9--37 A 3-bit counter with active-HIGH decoding of count 2 and count 7. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--38 A basic decade (BCD) counter and decoder. 6. 計數器的解碼 Figure 9--38 A basic decade (BCD) counter and decoder. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

6. 計數器的解碼 Decoding Glitches Figure 9--39 Outputs with glitches from the decoder in Figure 9-38. Glitch widths are exaggerated for illustration and are usually only a few nanoseconds wide.

6. 計數器的解碼 Figure 9--40 The basic decade counter and decoder with strobing to eliminate glitches. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--41 Strobed decoder outputs for the circuit of Figure 9-49. 6. 計數器的解碼 Figure 9--41 Strobed decoder outputs for the circuit of Figure 9-49. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

7. 計數器的應用 Figure 9--42 Simplified logic diagram for a 12-hour digital clock. Logic details using specific devices are shown in Figures 9-52 and 9-53. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

7. 計數器的應用 Figure 9--43 Logic diagram of typical divide-by-60 counter using 74LS160A synchronous decade counters. Note that the outputs are in binary order (the right-most bit is the LSB). Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

7. 計數器的應用 Figure 9--44 Logic diagram for hours counter and decoders. Note that on the counter inputs and outputs, the right-most bit is the LSB. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--45 Functional block diagram for parking garage control. 7. 計數器的應用 車輛停車控制: 最多可停100輛, 當停滿100輛時指示燈亮起, 同時柵欄放下, 當不滿100輛時指示燈滅掉, 同時柵欄收起. Figure 9--45 Functional block diagram for parking garage control. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

7. 計數器的應用 車輛停車控制 Figure 9--46 Logic diagram for modulus-100 up/down counter for automobile parking control. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--47 Parallel-to-serial data conversion logic. 7. 計數器的應用 Figure 9--47 Parallel-to-serial data conversion logic. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

7. 計數器的應用 Figure 9--48 Example of parallel-to-serial conversion timing for the circuit in Figure 9-47.

8. 檢修 Figure 9--49 Example of a failure that affects following counters in a cascaded arrangement. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

8. 檢修 Figure 9--50 Example of a failure in a cascaded counter with a truncated sequence. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

例題9-10 分析圖9-60測量的結果是否正確, 如果不正確, 那錯在哪裡? 8. 檢修 例題9-10 分析圖9-60測量的結果是否正確, 如果不正確, 那錯在哪裡? Sol: Truncated modulus = full modulus – preset modulus = 164 - 82C016 = 65536 -32472 = 32064 The correct frequency = 10MHz / 32064 = 311.88Hz Modulus = fin / fout = 10MHz / 637.76Hz = 15680 Truncated modulus = full modulus – preset modulus = 65536 – 15680 = 49856 = C2C016 比較 82C016 與 C2C016 就知道錯在哪裡了. Thomas L. Floyd Digital Fundamentals, 8e Figure 9--51 Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Q2正確的波形應為紅線的波形, 所以若Q2的波形像綠線的部分則Q2的波形是錯的. 8. 檢修 例題9-11 觀察圖9-61的波形看計數器是否正確? Sol: Q2正確的波形應為紅線的波形, 所以若Q2的波形像綠線的部分則Q2的波形是錯的. 仔細比較Q1及Q2的波形, 發現兩者一樣, 會發生這種情況, 可能是AND 下半部內部斷線, 相當於接HIGH, 因此AND Gate 等於沒有作用所致. Figure 9--52 Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.

Figure 9--53 The 74HC163 4-bit synchronous counter. 9. 具有相依註標的邏輯符號 Figure 9--53 The 74HC163 4-bit synchronous counter. Thomas L. Floyd Digital Fundamentals, 8e Copyright ©2003 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.