陳柏儒
  • 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
      • Create new note
      • Create a note from template
        • 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
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Write
          • Only me
          • Signed-in users
          • Everyone
          Only me 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
      • Save as template
      • 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 Create Help
    Create Create new note Create a note from template
    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
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Write
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me 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
    8
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 記憶體 Memory ###### tags: `Technology` ## 分類 ![](https://i.imgur.com/zyDUxOI.png) * **Random Access Memory (RAM)** - 當記憶體中的訊息被讀取或寫入時,所需要的時間與這段資訊所在的位置無關,也就是說可以不用按照位址的順序,而**隨機指定記憶體位址**來讀取或寫入資料。 * DRAM * SRAM * **Direct-access data storage** - 讀寫記憶體的時間跟這Physical location有關係,所以讀寫速度會受到media rotation speed或arm movement限制 * Hard disks * CD-RWs * DVD-RWs * Other older magnetic tapes and drum memory * 揮發性 * **Volatile**: 電源關閉時,無法保存資料 * DRAM * SRAM * **Non-volatile**: 電源關閉時,可以保存資料 * ROM * Flash ### DRAM(Dynamic RAM) * 利用**電容**來儲存資料的,也就是藉由判斷電容內的電量多寡來區別0和1,不過在現實中往往會發生**漏電**的現象,屬於揮發性記憶體(volatile memory) * 一旦時間久了,資料就有可能會消失,因此需要**週期性的充電**,此週期性充電又稱為**重新整理(refresh)**,因此較為耗電。 * 結構 * 把一個 DRAM 晶片的內部結構剖開看看,會看到一個**儲存陣列(Memorry Array)**。CPU 會給這個儲存陣列「行地址」和「列地址」,就可以選出一個「儲存單元」。 ![](https://i.imgur.com/tUlqSrL.png) * 每一個位元的資料通常都只需 **一個電容跟一個電晶體 (1 Transistor 1 Capacitor, 1T1C)** 來處理,電晶體在這裡的功用是用來控制讀取以及寫入,並不像其他種類的記憶體,是用來代表0與1的,在DRAM中,真正代表0與1的就是電容 * 資訊存取時由**字元線(Word Line, WL)** 來控制電晶體開關,而**位元線(Bit Line, BL)** 則負責電荷的判讀和電容的充電。 * 漏電 (leakage) ![](https://i.imgur.com/USem7nR.png) * 電容的電會從substrate漏掉導致電壓下降,因此需要定期refresh,根據JEDEC standard,每64ms要充電一次 ![](https://i.imgur.com/Zy0iYba.png) * Refresh是一列一列(WL)refresh * 相比之下在SRAM上一個位元通常需要六個電晶體。正因這緣故,DRAM擁有非常高的密度,**單位體積的容量較高因此成本較低**。 * 缺點為存取速度較SRAM慢 * Write speed = Read speed * **CMOS晶片** * 用於記錄主機板上面的重要參數的一塊可讀寫的**RAM晶片** * 電腦主板一般專門配有CMOS**電池**為其供電。 * 主要包括系統時間、CPU電壓與頻率、各項設備的I/O位址與IRQ等 * 由於主記憶體擺放在 CPU 之外,從工廠出來的晶粒需要封裝和組合之後才可和 CPU 連結,因此從 CPU 至 DRAM 晶粒之間依據層級由大至小為 **channel>DIMM>rank>chip>bank>row/column** * ![](https://i.imgur.com/NxLXcRA.png) * channel 和 DIMM * 每個 channel 需要配有 1 組記憶體控制器 (DRAMC) * 每個 channel 中能夠擁有許多組 DIMM(Dual In-line Memory Module),**DIMM 也就是目前消費者能夠在市場上買到的記憶體模組** * 早期發展出 SIMM(Single In-line Memory Module),將多組記憶體顆粒焊在 1 片電路板上,成為記憶體模組,再將此電路板插在主機板上。接著為了增加資料吞吐量,將 1 條記憶體模組的頻寬從 SIMM 的 32bit 改換成 DIMM 的 **64bit** * rank 和 chip ![](https://i.imgur.com/j4RsfuT.png) * bank、row、column ![](https://i.imgur.com/VrMQQdG.png) ![](https://i.imgur.com/sJtQmTH.png) * bank 再往下分拆就是實際儲存位元的電路,一般來說橫向選擇排數的線路稱為 row(row enable、row select、word line),直向負責傳遞訊號的線路為column(bitline)bank 再往下分拆就是實際儲存位元的電路,一般來說橫向選擇排數的線路稱為 row(row enable、row select、word line),直向負責傳遞訊號的線路為column(bitline) * 電腦常講的記憶體通常就是DRAM * 容量: 4GB、8GB、16GB、32GB * 世代 ![](https://i.imgur.com/Ec5SO8v.png) * JEDEC(Joint Electron Device Engineering Council): 記憶體標準的主體制定組織 * DDR SDRAM (Double Data Rate SDRAM) * 目前較為常見的就是DDR3、DDR4,兩者插槽pin腳不一樣,因此購買時要看主機板是支援哪一種 * DDR3 * 電壓: 1.5V * DR3-1066, DDR3-1333, DDR3-1600, DDR3-1866, DDR3-2133 * DDR4 * 電壓: 1.2V (比DDR3更低) * DDR4-2133 (最低)、DDR4-2400, 2666, 2800, 2933, 3000, 3200... * 尺寸 * **DIMM(Dual In Line Memory Module)** :是一般桌電所使用的記憶體尺寸 * **SO-DIMM(Small Outline DIMM)** :則是用於筆記型電腦的記憶體尺寸,它的尺寸比 DIMM 還要短很多。 ![](https://i.imgur.com/QkyvxBj.png) * 頻率 * DDR3-1600: 後面這個數字代表每秒的傳輸次數(megatransfers),單位是 MT/s,這個值大家也時常視為記憶體的時脈(clock rate),單位是 MHz,換算成傳輸速率就是 64 bits * 1600 MHz / 8 = 12800 MB/s。 * 延遲時間(CAS latency,CL 值) * 電腦要讀取記憶體的資料時,需要等待多久之後才能真正開始讀取 * 有些記憶體會標示它的延遲時間,其內容是一連串的數字,例如 9-10-9-27,第一個數字就是記憶體的延遲時間,單位是時脈週期。 * 以DDR3-533為例,CL 值是7個時脈週期的話,換算出來就是 1/533000000 * 7 = 13.09 ns。 * 主機板記憶體插槽 * 通常這種很多記憶體插槽的主機板,它的記憶體插槽應該都會有不同的顏色,最簡單的做法就是選同一種顏色插,並且分散在不同的記憶體通道 ![](https://i.imgur.com/NzasE0e.png) * 通道 * 有單通道、雙通道 (Dual-Channel)、三通道、多通道記憶體 * 將多個記憶體由串聯方式改良為並聯方式,以得到更大的頻寬 ![Uploading file..._68nm8q1at]() * SDRAM (Synchronous DRAM) ### SRAM(Static RAM,靜態隨機存取記憶體): * 使用 **flip-flop** 來儲存資料,只要保持通電,裡面儲存的資料就可以恆常保持,然而,當電力供應停止時,SRAM儲存的數據還是會消失(volatile memory)。 * 需要**六個電晶體(6T)** 合起來才能保存一個 bit。 ![](https://i.imgur.com/cmnRhNj.png) ![](https://i.imgur.com/69kYhsC.png) * 電晶體的開關速度遠比電容充電放電的速度還快,所以相對於 DRAM、SRAM 的讀寫速度比 DRAM 快很多。 * **Main Memory用DRAM**,**Cache用SRAM**,因為SRAM價格較高,不易做成大容量,但他的速度較快, 因此整合到CPU內成為快取記憶體以加快資料的存取。 ### 唯讀記憶體 ROM (Read Only Memory) * 非揮發性記憶體,在沒有通電時也能夠將資料記錄下來 * **BIOS(Basic Input Output System)** * 一套**程式**,這套程式是寫死到主機板上面的一個記憶體晶片中,這個記憶體通常是ROM或Flash。 * 他在**開機**的時候執行,以**載入CMOS當中的參數**,並嘗試呼叫儲存裝置中的開機程式,進一步進入作業系統當中。也可以修改CMOS中的資料。 ### Flash 快閃記憶體 * 在電晶體中增加一層以多晶矽為材料的**浮動閘極(Floating-Gate, FG)**,利用FG中有無電荷判別元件之記憶狀態 ![](https://i.imgur.com/9PPQCpN.png) * 屬於非揮發性記憶體(NVM),FG被絕緣體夾住,當電源關掉時,FG中的電荷無法消散故能保存記憶。 * Flash跟DRAM一樣有高密度優勢,而且還可以作多層次儲存(Multi-Level Cell, MLC),根據電荷多寡而不只是0和1,可以儲存2個以上的bits,因此記憶體容量可以達幾GB以上。 * 電荷注入都需要經過絕緣層,所以資料存取會慢上許多。 * 電荷經過絕緣層都會對絕緣層造成些許破壞,因此相較於DRAM、SRAM,Flash的壽命較短,只能存取幾千到幾萬次。 * * NOR Flash * 比 NAND Flash 更早導入市場。 * 讀取的速度較快,但寫入的速度慢、價格也比 NAND Flash 貴。目前用來儲存作業系統的程式碼或重要資料,比如拿來做 ROM。 * NAND Flash * 寫入的速度快、價格較低,故目前以 NAND Flash 最為普遍。 * 應用: USB 硬碟、手機儲存空間、固態硬碟(Solid State Drive,SSD) ## Reference * https://kopu.chat/2017/06/08/dram_rom/ * https://www.techbang.com/posts/18381-from-the-channel-to-address-computer-main-memory-structures-to-understand

    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