資工系必修 共筆
  • NEW!
    NEW!  Connect Ideas Across Notes
    Save time and share insights. With Paragraph Citation, you can quote others’ work with source info built in. If someone cites your note, you’ll see a card showing where it’s used—bringing notes closer together.
    Got it
        • Sharing URL Link copied
        • /edit
        • View mode
          • Edit mode
          • View mode
          • Book mode
          • Slide mode
          Edit mode View mode Book mode Slide mode
        • Customize slides
        • Note Permission
        • Read
          • Owners
          • Signed-in users
          • Everyone
          Owners Signed-in users Everyone
        • Write
          • Owners
          • Signed-in users
          • Everyone
          Owners Signed-in users Everyone
        • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invite by email
        Invitee

        This note has no invitees

      • Publish Note

        Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

        Your note will be visible on your profile and discoverable by anyone.
        Your note is now live.
        This note is visible on your profile and discoverable online.
        Everyone on the web can find and read all notes of this public team.

        Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Explore these features while you wait
        Complete general settings
        Bookmark and like published notes
        Write a few more notes
        Complete general settings
        Write a few more notes
        See published notes
        Unpublish note
        Please check the box to agree to the Community Guidelines.
        View profile
      • Commenting
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Suggest edit
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
      • Emoji Reply
      • Enable
      • Versions and GitHub Sync
      • Note settings
      • Note Insights New
      • Engagement control
      • Make a copy
      • Transfer ownership
      • Delete this note
      • Insert from template
      • Import from
        • Dropbox
        • Google Drive
        • Gist
        • Clipboard
      • Export to
        • Dropbox
        • Google Drive
        • Gist
      • Download
        • Markdown
        • HTML
        • Raw HTML
    Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
    Menu
    Options
    Engagement control Make a copy Transfer ownership Delete this note
    Import from
    Dropbox Google Drive Gist Clipboard
    Export to
    Dropbox Google Drive Gist
    Download
    Markdown HTML Raw HTML
    Back
    Sharing URL Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Customize slides
    Note Permission
    Read
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    Write
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ###### tags: `數位系統設計` :::info [回共筆首頁](https://hackmd.io/zrsmsRtEQ-OrnGslDxT0NQ) [回科目首頁](https://hackmd.io/vXoSKbhKRV2nufoPIyxgyQ) ::: [TOC] # Lecture03: Synchronous Sequential Logic ## Sequential Circuits ![](https://i.imgur.com/bEsju0H.png =80%x) - Synchronous同步更新: 在幾個不連續彈特定的時間點 - Asynchronous非同步更新: 任何滿足條件的時間 :::info Synchronous同步更新 => Flip-Flop Asynchronous非同步更新 => Latch ::: ## Synchronous Sequential Circuits - Master-clock generator => 產生時脈 - Clocked sequential circuits => 透過時脈同步更新 - The memory elements: flip-flops - Each binary cell is capable of storing one bit of information - Two outputs: 一正一反 - Maintain state, until input signal to switch state 輸出會等到master-clock觸發,改變狀態 ## Clocked ![](https://i.imgur.com/BppneE7.png =50%x) - Latched => level-sensitive - Flip-flops => edge-sensitive ## Latches - Latches are asynchronous sequential circuit - 狀態會隨著輸出入改變而改變 - 建造Flip-flops - 不適用於同步循序電路 :::warning Latches的性質比Flip-flops還要差,所以實務上主流是Flip-flops,但是還是會在一些精密電子產品裡(像是電腦主機板)看到Latches,因為他還是有存在的必要。 ::: ## SR Latch with NOR Gates - **NOR 的 controling value = 1** ![](https://i.imgur.com/tofUPnd.png =90%x) ## SR Latch with NAND Gates - **NAND 的 controling value = 0** ![](https://i.imgur.com/FZNjGwU.png =90%x) ## SR Latch with Control - 用Enable腳,控制SR Latch要不要受輸入作動 ![](https://i.imgur.com/CvWqnNW.png =90%x) ## D Latch ![](https://i.imgur.com/Ena44rt.png) ## Master-slave D flip-flop - Negative-edge-triggered flip-flop - 負緣觸發 ![](https://i.imgur.com/UeL50Pc.png) ## Edge- Triggered D Flip-Flop - Clock Tree Synthesis: clock signal is distributed evenly to all sequential elements in a design :::info Clock Tree Synthesis(CTS) => 旨在將外部 clock 妥善分配給內部的各個元件。由於 CTS 需要精確各元件的位置以計算準確的延遲與可運行頻率,且 clock routing 是主要 power 耗損的主要來源 (30%附近) ,須優先於 signal routing,因此一般 CTS 在 place 之後 route 之前進行。 ::: ## Setup and Hold Time for Flip-Flop - The setup time - 在CK變換之前,需要有一段時間,資料要準備好(setup) - The hold time - 在CK變換之後,需要有一段時間,資料可以穩定(hold) - Flip-Flop delay - 當資料輸入到輸出的時間,稱為propagation delay ![](https://i.imgur.com/OsP5XeR.png =70%x) :::warning 在實務上,希望CK跟輸入信號不會同時變換,因為同時變換會使得無法分析,得出我們預期的結果,所以會要求setup跟hold的時間,盡量避免出錯。 ::: ## JK Flip-Flop :::danger 要記得JK正反器的Boolean Function,請記到期末考,在分析電路時,可以比較快速。 F = JQ' + K'Q ::: ![](https://i.imgur.com/VIW6BLD.png) ## T Flip-Flop - 若T=0,現在的輸出結果會是前一個輸出結果 - 若T=1,現在的輸出結果會是前一個輸出結果**的反相** ![](https://i.imgur.com/P35SOAs.png =40%x) ## 小小統整Characteristic tables - D Flip-Flop 輸入是什麼輸出就是什麼 - JK Flip-Flop F=JQ'+K'Q - T Flip-Flop 輸入為1會啟動反相,把前一個輸出反相後變成現在的輸出 ![](https://i.imgur.com/xEnVsZX.png =80%x) :::info 題外話: PUF晶片:一種晶片的指紋辨識(像是ID),簡單的應用是在悠遊卡。 逆向工程:可以拿來竊取重要技術,也可以保護公司本身的智慧財產權,能夠知道山寨產品有無竊取自己公司的重要技術。 ::: ## Analysis of Clocked Sequential Circuits - State equation: 重點在present states and inputs - State table: 把所有的轉換結果列出來,會有input、present states、output - State diagram ### Example - state equation ![](https://i.imgur.com/h1KhzGZ.png) - state table ![](https://i.imgur.com/JH8r7Jm.png =70%x) - state diagram ![](https://i.imgur.com/EQ049zN.png =80%x) :::info D Flip-Flop是電子產品較多的使用的Filp-Flop,因為較其他正反器還要直覺、單純。 D Flip-Flop的next state就是Input Equation ::: ## Analysis with Other Flip-Flop - 要分析Flip-Flop電路的結果,可以用以下兩種方法做 1. 第一種方法 1. 把input equation化簡出來 2. 列出所有的input情況,推導出Filp-Flop的input,透過Filp-Flop的特徵值,近一步推出所有情況next state table 3. 根據state table,就能夠畫state diagram 2. 第二種方法 1. 把input equation化簡出來 2. 利用Flip-Flop的Characteristic equation,把input equation 替換到Characteristic equation,就可以得到state equation了 3. 根據state equation,列出所有的情況,就能夠畫state diagram :::success 要記得D、JK、T的Characteristic equation ::: ## Mealy and Moore Models ### Mealy model - 當state改變或是input改變,output可能就會改變。 - 因為output的equation跟input有直接關係。 ![](https://i.imgur.com/tLQzFUT.png =50%x) ### Moore model - 只有state改變,output才可能會改變。 - 因為output的equation只有跟state有直接關係,而state是跟input有關係,output跟input沒有直接關係。 - ![](https://i.imgur.com/C1UvUoD.png =50%x) :::info - Mealy and Moore ![](https://i.imgur.com/MK2lrwz.png) 口訣:$Less\ is\ More$ 輸出比較少的,是Moore model ::: ## State Reduction and Assignment - State diagram 可能看化簡,只要輸入輸出的行為一樣,就不需要理會用到的Flip-FLop個數是多少 :::danger 課本的簡化方法,比較弱。 老師在Project中提供的化簡方法比較完整,也比較好。 ::: ## State Assignment - Binary,最直覺的樣子。 - Gray Code 因為現在的bits和下一個bits只會相差一個bit,代表在狀態轉換的時候,可以得到最佳的Power Consumption。 - One-Hot,可作為控制信號。雖然會增加Flip-Flop的數量,但是可以節省時間。 ![](https://i.imgur.com/KURhttn.png =80%x) :::info 不同的Assignment可以用來針對不同的需求,設計電路。 ::: ## Design Procedure - 從state equation或state tablec或state diagram,經過化簡後,設計出電路從state equation或state table,經過化簡後,設計出電路。 ## Excitation Tables - 原本我們知道input是什麼,output可以用Boolean Table推導出來。 - 現在。我們希望前一個狀態到下一個狀態是由我們定義,那們input的值要去推導出來,就會使用到Excitation Tables。 ![](https://i.imgur.com/m56hNEY.png) :::spoiler 小練習:如果Q(t)=0,Q(t+1)=1,則T跟JK的Excitation Table為何? T => 1 JK => (1,x) ::: ### Synthesis Progress - 從狀態機,設計電路 - 步驟 1. 畫出期望的狀態機變化 2. 畫出state table,從Present State和Next State回推Flip-Flop的input 3. 針對Flip-Flop的input用**卡諾圖**化簡 4. 畫出電路圖

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully