{"format":"brushup-mindmap-v1","id":"co-00-sheet3","title":"⭐️第三章 存储系统","structure":"timeline-h","theme":"auto","root":{"id":"e6ab2807e2785aebf6acdb666c","topic":"第三章 存储系统","expanded":true,"children":[{"id":"15f9ae40b8c988f8c74cc9383c","topic":"存储器特点","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-0eb260ceca6ca7.svg","width":64,"height":64},"children":[{"id":"7e5a6e65287bc5c9b813285742","topic":"分类：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"65f8ec9165a9aeec78a0987feb","topic":"按作用：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"0dfa32cf-7d20-477c-93dd-1ff64880b720","topic":"高级缓冲存储器","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"90f88ad7-4115-4aad-a74f-149849db9490","topic":"【即Cache】，位于CPU和主存之间，使CPU能更快速的使用到里面的数据（Cache中的数据是主存中的副本，而缓冲区不是）","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"a068eb44345b2434022d6a91b0","topic":"主存储器","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"66f720e1-007b-4fcb-a286-fdba1d26938f","topic":"【即主存/内存】，存放计算机运行时需要的大量的数据，CPU可以直接与其进行访问，也可以和cache交换数据","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"bec565db-c1e8-41f9-a19d-068828354043","topic":"辅助存储器","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"3f9779dd-61a2-44e7-bbc0-47707f66f90d","topic":"【即辅存/外存】，不能与CPU进行直接信息交换","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"d55bf0be719adacf5d4b183914","topic":"按存储介质：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"d5aaa9483cfa839b909cb8e78a","topic":"磁表面（磁盘磁带）、磁心存储器半导体存储器（MOS存储器）、光存储器（光盘）","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"7d2a9c1a242a1364c13d3aca01","topic":"按存取方式：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"32ead7c7-839a-474e-9860-9f9555e09b87","topic":"随机存取","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"0b69f34f0488862dde821bd4ac","topic":"RAM、ROM（只读存储器）","expanded":true,"style":{"background":"#EEEEEE"}}]},{"id":"c4801854-d34c-4ff4-a7ce-659656dcee1e","topic":"串行访问存储器","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"66f4aa80-c59c-4e3d-a345-da9382c99322","topic":"对存储单元进行读写时，根据其物理位置的先后进行寻址","expanded":true},{"id":"42772ccc-4180-4084-b428-013ed887b967","topic":"例如顺序存取（磁带）","expanded":true}]}]},{"id":"1ffa940ce6ea6b9c24b90aa1e5","topic":"按信息可保存性：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"52b844042feab5b3fba0990d35","topic":"易失型（RAM断电后丢失）","expanded":true,"style":{"background":"#8EDE99"}},{"id":"a4be1d4f-0d4c-4dfa-812b-2d95d78252cd","topic":"非易失性（ROM断电后不丢失）","expanded":true,"style":{"background":"#8EDE99"}},{"id":"a6f27cd8-28d1-4573-9317-f741c39e3054","topic":"破坏性读出（DRAM芯片）","expanded":true,"style":{"background":"#8EDE99"}},{"id":"55ec71ad-1365-4038-8259-fb5026f1648b","topic":"非破坏性读出（SRAM芯片、DISK）","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"21546021-827b-48ad-9de3-32518ecb8cac","topic":"其他","expanded":true,"children":[{"id":"a735ff58-8669-4ef7-8ff3-301c45c1588c","topic":"DAM直接存取存储器","expanded":true,"children":[{"id":"5ad32722-7169-4fcd-8921-297419f9e60c","topic":"磁盘","expanded":true}]}]}]},{"id":"07db3136a478eaad95f96b623e","topic":"性能指标：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"8b1827a23fa92e2c40650baa72","topic":"存储容量：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"e18b26185e68911fe03dfb2a99","topic":"存储字数 * 字长","expanded":true,"style":{"background":"#8EDE99"}},{"id":"22284caad0d901d49506a979b7","topic":"主存存储容量","expanded":true,"children":[{"id":"bf783eeb0a0badaa7745eb3402","topic":"MAR位数：","expanded":true,"children":[{"id":"a1388c2e23586dda53724b0095","topic":"地址总线个数","expanded":true}]},{"id":"876aa82ce32ba3f4ba1e6841a6","topic":"MDR位数：","expanded":true,"children":[{"id":"0f5be373724bef32d3c318f618","topic":"数据总线个数","expanded":true}]}],"formula":{"tex":"2^{\\text{MAR位数}} \\times \\text{MDR位数}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><msup><mn>2</mn><mtext>MAR位数</mtext></msup><mo>×</mo><mtext>MDR位数</mtext></mrow><annotation encoding=\"application/x-tex\">2^{\\text{MAR位数}} \\times \\text{MDR位数}</annotation></semantics></math></span>"}}]},{"id":"164ae0fc990afec0b997f818a7","topic":"单位成本：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"376b2e2c5f0bd19a5481f95169","topic":"每位价格 = 总成本 / 总容量（bit)","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"c0791ff1b4096bfd18635b4b28","topic":"存储速度：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"9fe9b11c7b983a0511801b2f16","topic":"存取时间：","expanded":true,"children":[{"id":"43fa59f5-37c3-427a-b8af-8fb26af5e33f","topic":"启动一次存储器到最终完成操作所经历的时间","expanded":true}]},{"id":"1c7aab955958702e36ecbad56c","topic":"存取周期：","expanded":true,"children":[{"id":"2bab786d4a8a52b3329809bd71","topic":"存取时间 + 恢复时间","expanded":true,"children":[{"id":"1d4df0c1-b125-4088-9012-a4e1c5794574","topic":"又称：连续读或者连续写所允许的最短时间间隔","expanded":true,"style":{"background":"#FFABD5"}}]}]},{"id":"3939f09cc5d99bef06e7994348","topic":"主存带宽：","expanded":true,"children":[{"id":"81381c44-581a-40af-9b04-c3f9bb390a02","topic":"数据传输率，表示每秒从主存进出信息的最大数量","expanded":true}]}]}]},{"id":"b9b9f6d2cc285beee84b59332a","topic":"多级存储系统：","expanded":true,"children":[{"id":"05cb398c58b8b1ca51123a22cb","topic":"图示","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-a98a2dd28fef47.png","width":321.93,"height":149.2},"children":[{"id":"9968c2ca-4a72-43fc-b802-064cd215ed60","topic":"图示","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-222b65fc712ecf.png","width":369.23,"height":140.38}}]}]},{"id":"f8ab38a7-fe98-429b-9f77-ece351f550b9","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"079bdf1d-9cbd-4a46-9069-c5b1528536eb","topic":"11","expanded":true}]}]},{"id":"64b9e926b2ba17aaa5f9292cb2","topic":"SRAM、DRAM","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-127eb26f8b6f75.svg","width":64,"height":64},"children":[{"id":"049fdaec-dbc7-44cf-82f3-fec6b53ac213","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"eaeabf62-d63a-473a-a093-5e27a55dbe1a","topic":"12、14、15、22","expanded":true}]},{"id":"b75a85cc8978e625ad4b6ab885","topic":"SRAM","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"d0109478-6116-44e0-8838-0bb6e921145e","topic":"Static Random Access Memory","expanded":true},{"id":"2e79f9dad26800f3e4188bb61a","topic":"存储元：\n（几个MOS)","expanded":true,"children":[{"id":"e629571b1c894e94926cf90786","topic":"双稳态触发管，6个MOS","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-031f2f854118b0.png","width":287.47,"height":201.6},"children":[{"id":"2ded8bcf-ad11-449b-9f52-354639146b1d","topic":"了解即可","expanded":true}]}]},{"id":"89e920c9d03bb699de47496f23","topic":"优点：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"23ca5903669a327d37d3293b78","topic":"速度快，但是【集成度低、功耗大、用来组成高速缓存存储器】","expanded":true,"style":{"background":"#FF9595"}},{"id":"9f8b74f402a963a016a5d946fd","topic":"不需要进行刷新","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"7ea5a990-77b7-4d84-9e78-f570b31f65ef","topic":"Cache","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]},{"id":"90e8cf81bb580bdb03c2e9417c","topic":"DRAM","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"a48901db-6435-44cd-b93b-ba7adb2b5ce6","topic":"Dynamic Random Access Memory","expanded":true},{"id":"dbdb9657179bb8d661b57b81a6","topic":"存储元：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"9dda684c594b7b0cafc3b9a668","topic":"栅极电容","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"0739faaa213a90fb4872c826f0","topic":"采用技术：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"33897a397eaa697900dd48c3d8","topic":"地址复用技术","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"e75bae2861782db625d5c8beac","topic":"优点：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"fc09d364626bba5c8d57589651","topic":"集成高、价格低、容量大、功耗低","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"c3c03eba-d07d-43b8-afd0-af9aa839bf77","topic":"在工作时存储器内容不会发生改变（即会进行刷新，所以内容不会发生丢失）","expanded":true,"style":{"background":"#FFABD5"}},{"id":"069e966b-c6e2-4b78-b575-e8c871a42e3c","topic":"现在DRAM被称为SDRAM（例如DDR3，DDR4）","expanded":true,"style":{"background":"#FFABD5"}},{"id":"96db02e65de9ddc6bd4f9a9a14","topic":"刷新：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"cca8c5fe96f9e712ff2638e9d7","topic":"每次刷新多少存储单元：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"a70a0bec87f8b70ec7214a34ea","topic":"【基础版】一次刷新一整行","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-0aba303d6ad441.png","width":250.61,"height":228.96},"children":[{"id":"39a07011-e827-42e6-9474-2c0bc68e0d4c","topic":"例如有20根地址线，则一共对应有1024 * 1024根选通线。","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"07a9b88c-dc61-4c23-8c7c-8a7bccb45361","topic":"刷新顺序：从上到下选n个。每次刷新一行","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"5e16139e-568b-4e89-8ba9-adf0f5e8279b","topic":"【行列存储版】把地址分布改为行地址+列地址的存储方式","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-812ed0853d024a.png","width":480.15,"height":240.08},"children":[{"id":"d09f5331-d3e0-47ee-9ac8-98f6a645e53d","topic":"例如有20根地址线，则有1024根行选通线，1024根列选通线 = 2048根选通线。","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"321ccff2-33fc-48a7-bd26-376152232a4a","topic":"刷新顺序：从左到右，从上到下。每次选n个一起刷新","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"5f883662ae4bbb241d8fb8fc10","topic":"刷新周期：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"c66901c9d27948ed1a1489ad67","topic":"一般取2ms刷新一次","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"c4ba025b1859abcb43f309f659","topic":"刷新算法：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"bc3a780afa3a845e0b86084efc","topic":"集中刷新：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"49a257c8-53d2-47b8-a9e8-be6c29e433e8","topic":"在一个刷新周期内，在一个固定时间，停止其他操作，把【所有】的存储单元都进行刷新。","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"8d36e866-c32e-49b3-bbf8-417bc9ccba67","topic":"“死时间”、“死区”","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"d95827eaf6e993c91fccca321e","topic":"分散刷新：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"b421d851-3d3c-4a11-aa21-7e85ace1b1bd","topic":"把每行的刷新分散到各个工作周期内，每个存储周期前半部分用于正常读写，后半部分用于刷新【某一行】（这一行是CPU安排的）","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"a25ec623-d24e-46f4-9e0e-eb2121d8df51","topic":"加长了系统的存取周期","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"5109e248a4eb595171114bc580","topic":"异步刷新：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"d0b3794f-a6b6-4cc1-aea5-766345e2090c","topic":"即：集中刷新 + 分散刷新","expanded":true},{"id":"cebb4fdd-5e16-41ae-955a-36514c0c4336","topic":"将刷新周期除以行数，得到两次刷新操作之间的时间间隔 t，则每隔时间t进行一次刷新，刷新【一行】","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"d1f8ac5e80f8fd30bc8829bf46","topic":"注意：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"374b17e57c781043fe91bba342","topic":"透明度：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"0f289f3289793cf39b76981b90","topic":"对CPU透明，不依赖外部的访问","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"03e2d324-8dfc-41d9-ac88-2453dfdc2179","topic":"刷新单位：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"ef346b74-af62-4c63-9a3c-8a4a3c1e5eb1","topic":"一行，行地址由CPU自行生成","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"9ba86c32ccbb2725f1c09a783b","topic":"选片：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"c3f9c17711592f2cd744da7b6b","topic":"不需要选片，对存储器中所有芯片都进行刷新","expanded":true,"style":{"background":"#FDD834"}}]}]}]},{"id":"6e7a8cc2-b740-415e-8b9b-8447252c37c5","topic":"内存","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]},{"id":"9efb4da84e7aa35eb81f9a22d2","topic":"SRAM vs DRAM","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"78095a7807483107141b586a0e","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-a2c24d32a17806.png","width":551.69,"height":308.76},"children":[{"id":"f1f6beee-009b-4a50-87af-d34cd364b264","topic":"都是易失，只不过一个不需要刷新（SRAM)、一个需要刷新（DRAM)","expanded":true,"style":{"background":"#FDD834"}}]}]},{"id":"9d1a9b11e11b5b08a5ff28b89b","topic":"存储芯片的基本原理：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"160884ae4c0b05a41927d8cfb2","topic":"栅极电容：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"abfcec19-0035-4d9e-8cca-2b3dfd4fa6d3","topic":"MOS管+电容","expanded":true,"style":{"background":"#FFABD5"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-b4c0cf9712c913.png","width":248.78,"height":152.92}}]},{"id":"7cb9d5f8587ae40dda7ff88473","topic":"存储体/存储单元：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"2c5fba6a-3afa-4631-96a3-d411885f457d","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-2ad0d0e5332d6d.png","width":556.76,"height":186.89},"children":[{"id":"31756549-ff8f-4fda-ac5e-514f3a1bb334","topic":"存储体的一排连接了多个栅极电容，故CPU的一次读写单位即“一排栅极电容”，也即【一个存储字长/机器字长】","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"5d4b639a77699df0edf548dac1","topic":"存储芯片：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"1ea1cbb4-6681-4bcb-afc4-6a9575ecd98f","topic":"图示","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-24d7f70cbb1ed2.png","width":693.11,"height":336.33},"children":[{"id":"4004becd-23f4-4810-b812-82322b6f5e22","topic":"存储芯片：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"d972bbf4-9e98-4302-b3e9-b9b487f3e83e","topic":"一个存储芯片由多个字排列组成，每一排字对应一根【选通线】，即对应【MAR（地址）】中一个的数据。","expanded":true}]},{"id":"e4a051e3-1846-4b3a-b182-b6d93d788da1","topic":"控制电路：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"6c042ed9-a829-4b59-91c2-ffe18bb9f5aa","topic":"当MAR、MDR、译码器的电平稳定过后才允许进行下一步操作","expanded":true}]},{"id":"a8107e98-4084-4bee-8655-2a6e4107a8de","topic":"片选线：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"14cb2f22-d641-4cb3-8b2e-0145d5568c93","topic":"CS杠、CE杠(chip-select/enable)，如果此处的电平信号为低电平时，说明芯片可以工作，理应处理传递过来的命令","expanded":true}]},{"id":"50959110-1a61-4e1c-a7a7-b316cc6afa73","topic":"读/写控制线：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"8659299a-1e5c-455b-8f9a-dcafe1ffb1e9","topic":"WE/RD杠，如果此时线是低电平，则说明允许读写，如果只有一个WE杠的话，则【低写高读】","expanded":true}]}]}]},{"id":"7e95fe50-5f7b-4c6e-a12d-8c453f86a2ba","topic":"存储芯片浓缩版：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"ff8d7397-011c-4620-bcc6-37b3c9338d22","topic":"图示","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-66de57126b98b3.png","width":431.48,"height":303.23},"children":[{"id":"454733f9-3671-437a-86ff-42b0c42b4f0a","topic":"片选线：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"c02f0c24-abbf-405c-9511-d2f4ce8dc401","topic":"地址复用技术：2根","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"c8920c88-59c5-4bb9-b8b1-6551ebd5a48b","topic":"DRAM","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"8110cda3-d3c1-47fb-8aaa-238375fb1990","topic":"否则：1根","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"b339e89c-ad0a-4336-9c77-8177d79e24dc","topic":"读写线：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"24fbecda-083c-45c4-9ff2-a79a3397a59c","topic":"看题目怎么说","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"fe65905a-8096-43ff-b311-3b1ec8617506","topic":"地址线：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"909180ba-396d-413d-94fe-27217230956f","topic":"地址复用：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"67176730-1d96-4d7a-b3dc-a445552d1839","topic":"地址总线的个数/2","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"ab883f88-1482-4889-9d49-7f72a7e572c1","topic":"不复用：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"ef061a6d-1d80-4383-99d5-92140bffc23f","topic":"地址总线的个数","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"5f9f9c2d-76cd-437b-9dad-87c0a95310e1","topic":"数据线：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"7beb5294-1681-44e1-af62-9a737386a0e1","topic":"MDR的位数","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"0eabe589-e6ea-419f-862a-d78486122adc","topic":"注意一定有【供电线】和【接地线】","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"765a9b437a1afebc078148b2e3","topic":"总线个数：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"4fde391c-882d-4b37-a626-fb77ec438ec8","topic":"例：某DRAM总容量为 64K * 2B，读写分开控制，问总引脚线数","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"5a0566c0-7f9e-4a22-949b-da3833b7d3ca","topic":"（DRAM默认地址复用）","expanded":true,"style":{"background":"#BA69C8"}}]},{"id":"23834452-7c20-48b5-86e9-cfb6f4670ed9","topic":"片：2，读写线2根，（地址线：16根）地址复用线：8根，数据线：16根，供电线+接地线：2根","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"7ac99ca0-a332-4eec-975a-63103a3aa868","topic":"注意这里的64K = 2^16 = 2^8 * 2^8，所以在【译码器过后的选通线】有256（行） + 256（列）=512 根线，而在【译码器前的地址总线】处应该只有8根","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"766fc24e-14af-4629-817b-9fe5a6e07fdc","topic":"如果没有地址复用技术：2^16根选通线","expanded":true}]},{"id":"b56eab90-eaae-4c7b-bebf-91a1c0071633","topic":"30根","expanded":true,"style":{"background":"#FDD834"}},{"id":"a927606b-70e0-433b-b98b-d5c66551115a","topic":"64K = 2^16(16根线)，2B = 16bit(16根线)","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]}]},{"id":"a1e33883-f99c-428a-8e2c-615c91de380d","topic":"寻址：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"6d5f5493-d0a8-46f8-8f27-6cd65aa71194","topic":"按字节寻址","expanded":true,"style":{"background":"#8EDE99"}},{"id":"f2a1ede7-bb69-4982-9fee-d6874b063978","topic":"按字寻址、按半字/双字寻址","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"d0890f3f-da73-49d8-84e0-53527233428a","topic":"要注意一次读写的【字长】为多少","expanded":true,"style":{"background":"#FDD834"}}]}]}]},{"id":"be9ae1d8-8b73-474d-8a0b-c6f4ef00594c","topic":"读写周期","expanded":true,"children":[{"id":"8c12db7a-df18-488b-af4d-d02d05dd0e2a","topic":"RAM的读周期","expanded":true},{"id":"a8511892-2419-46ee-a8c9-207fe5c8160e","topic":"RAM的写周期","expanded":true}]}]},{"id":"59fa51447e38352f140709a15e","topic":"只读存储器ROM","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-84a338e255dc39.svg","width":64,"height":64},"children":[{"id":"9b6b017834881125fa7c3acff4","topic":"特点：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"4f0977c372f91a624ed298f511","topic":"不易失、断电不丢失、结构简单、位密度高","expanded":true,"style":{"background":"#FF9595"}},{"id":"b19b907f04ca02ee2a0dcb6cb8","topic":"写到主板中的，能让系统进入BIOS","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-83e0705bfac060.png","width":270.18,"height":108.07}}]},{"id":"a3a9cd4e3ddb01a32c115b4a75","topic":"类型：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"8d391adbda3805ada9cff98bea","topic":"MROM：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"629836b91db8d2c27877fa63b1","topic":"中文：","expanded":true,"children":[{"id":"c905fee5-d2f3-45c5-9307-9e0a56deb637","topic":"掩模式ROM(Mask)","expanded":true}]},{"id":"61bbf36fce39fa498b089a2414","topic":"特点：","expanded":true,"children":[{"id":"3fe51eea-5095-4130-8758-64b1fda3c28b","topic":"厂商按照要求再生产时直接写入，写入后任何人无法改变内容","expanded":true},{"id":"b5bc6a1c-3c28-41c8-8fb5-c95cd693a041","topic":"可靠性高、便宜、灵活性差","expanded":true}]}]},{"id":"203a198ae80aab4ec7fa5be841","topic":"PROM：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"d43864f69cc909f5af55f863f9","topic":"中文：","expanded":true,"children":[{"id":"276db6f5-3ae7-4242-89fe-ad34c7810687","topic":"一次可编程ROM(program)","expanded":true}]},{"id":"883abbc0ebebeb77686c7b835d","topic":"特点：","expanded":true,"children":[{"id":"e2e3b0b5-18da-452d-8006-a0019b55da06","topic":"可以实现一次编程（用户可以使用专门的设备），一旦写入，不可改变","expanded":true}]}]},{"id":"64896bb669fb41f3ad61bb2170","topic":"EPROM：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"d88bfa160eb9c60deb62a95a55","topic":"中文：","expanded":true,"children":[{"id":"997074f2-1a0e-4e45-b8f8-53979d8957a7","topic":"可擦除可编程ROM(Erase Program)","expanded":true}]},{"id":"1b5a6e91bea939137cfb780b3b","topic":"特点：","expanded":true,"children":[{"id":"3d99581b-ca2f-4eb2-95e1-21ec8d236e46","topic":"可以多次修改，编程次数有限，写入时间过长","expanded":true},{"id":"129da6b0-7f87-4e83-bcc2-26345803838b","topic":"UVEPROM紫外线擦除，(E^2)PROM电擦除","expanded":true}]}]},{"id":"bdd8fd72c2c905c35f5e992d3a","topic":"Flash：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"ecd9bca3e44b3dd4ae69387f63","topic":"中文：","expanded":true,"children":[{"id":"e1f0cce2-9478-4ad1-b442-78df3c214a70","topic":"闪速存储器","expanded":true}]},{"id":"a498510d44e9367c3db5cb3f8a","topic":"特点：","expanded":true,"children":[{"id":"38f9d7ec-cd23-409e-9a54-9f0da3e66b08","topic":"是EPROM的改良，擦除重写速度更快（写比读慢），Flash只用单个MOS，故位密度比RAM高","expanded":true}]}]},{"id":"86cbfdd1c2ca248186cb4a6762","topic":"SSD：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"8279bfb5f9cab655c300f81b97","topic":"中文：","expanded":true,"children":[{"id":"26d626de-2f78-4e8f-9205-fc2a076ceb1f","topic":"固态硬盘","expanded":true}]},{"id":"0d5ba48e2d99818093578b6a06","topic":"特点：","expanded":true,"children":[{"id":"805e2655-acc0-4310-a053-533aec6ed5b1","topic":"由控制单元和Flash组成，读写速度快，低功耗，价格高","expanded":true}]}]}]},{"id":"5b68a6d9b738441b4fb5c91191","topic":"OS的自举装入程序：","expanded":true,"children":[{"id":"496860fe3d3b0cafab13bacae8","topic":"引导块","expanded":true},{"id":"05c928f495fb886a07056ba766","topic":"位置：","expanded":true,"children":[{"id":"689ab44683caeed61b13285c67","topic":"主板上的ROM的BIOS芯片里","expanded":true}]},{"id":"1e0a6018-64a2-4766-86c9-07d4b9c040dd","topic":"计算机系统中，OS保存在硬盘上，其内存储器应该采用：RAM + ROM","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"b83b392455b945ed644418f434","topic":"RAM和ROM的同一编址：","expanded":true,"children":[{"id":"136b87641c2be97b37f668ddb2","topic":"连续编址","expanded":true}]},{"id":"a766541d-19b9-4e7c-8dd1-02cb28b8c700","topic":"随机存取","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"bf0862a0-aa5b-4b33-af90-caf84b0cd574","topic":"RAM和ROM都是可以随机存取的","expanded":true,"style":{"background":"#FFABD5"}},{"id":"3bf249b1-ecc1-4ad1-9827-d9c444afa73a","topic":"不可随机存取：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"e8710ab1-f9df-4997-b260-e998764b6510","topic":"磁带（OS）","expanded":true,"style":{"background":"#FFABD5"}}]}]},{"id":"310a084c-272c-4d2b-a233-398ca8ae4434","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"cc4d7d12-312e-45c4-88b9-f2bf46779134","topic":"10、15","expanded":true}]}]},{"id":"9fa9f9c833590362e4d35baaa7","topic":"双端口RAM和多模块存储器","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-249db71a608952.svg","width":64,"height":64},"children":[{"id":"7f712412-ffb1-49a1-b93d-db7a277f450a","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"74e2a6c1-5d9a-4f86-82d0-a203a175fe6c","topic":"15、17、22","expanded":true}]},{"id":"e07ae319-1496-4437-ba84-843ffebbf6d5","topic":"双端口RAM：","expanded":true,"children":[{"id":"7213be77-5e42-40a5-b147-03a0f60b3b9b","topic":"解决问题：","expanded":true,"style":{"background":"#00A99D"},"children":[{"id":"cc11c27e-14e4-4d02-95ed-c6b172f1b927","topic":"用于优化多核CPU访问单个内存条的情况","expanded":true,"style":{"background":"#00A99D"}}]},{"id":"72476abb-5af9-4ac0-b8ef-28110a7f28fb","topic":"在同一个存储器的左右设置两个独立的端口，分别与两个CPU相连，每个端口都具有独立的地址、数据、控制线","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-0abbc8ac38d50d.png","width":379.98,"height":177.64},"children":[{"id":"bd1badb0-62d3-4374-9954-0f49ae85af9e","topic":"四种情况（读写者问题）","expanded":true,"children":[{"id":"dd6223ed-3d1a-4e57-9d75-5434396eb6eb","topic":"时间\\地址","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"d3d9f179-8439-4734-b661-4531070592ba","topic":"同一地址","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"72ab23d5-ade6-4684-adfe-5ebb5938694b","topic":"不同地址","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"bf3eddac-c7f6-4634-bb82-072993aeff14","topic":"同时","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"7df889ed-941a-43d8-9886-6db7609d27e9","topic":"①都读出 --- 无冲突\n②都写入 --- 冲突\n③写+读 --- 冲突","expanded":true,"children":[{"id":"a149e436-574f-4233-a1e2-1cb4e58709c9","topic":"不会冲突","expanded":true}]}]},{"id":"96d35d43-60ff-4a72-9046-23373f0dc1ce","topic":"不同时","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"fce12bcf-4d2e-480b-90f0-97d333cca870","topic":"不会冲突","expanded":true,"children":[{"id":"154e8a4c-1207-4250-b75e-e42d1e44c9f1","topic":"不会冲突","expanded":true}]}]}]},{"id":"a067e6c6-7aec-43a4-9132-8c4eac8b394b","topic":"解决冲突办法：设置“busy”信号，由逻辑信号决定暂时关闭一个端口（使其延时），未被关闭的正常访问","expanded":true}]}]},{"id":"c51a15dd-6b4a-4182-8266-7a7e9d5fd8fe","topic":"多模块存储器：","expanded":true,"children":[{"id":"47b62036-87f9-4b4b-bd25-27121716aa30","topic":"解决问题：","expanded":true,"style":{"background":"#00A99D"},"children":[{"id":"9c52a259-af22-4368-8bf7-5762ea783ea7","topic":"在一个存取周期中，存取时间很短，恢复时间非常长","expanded":true,"style":{"background":"#00A99D"},"children":[{"id":"d15ddcb6-49eb-4a68-87d3-39b3cbc0bf00","topic":"回复时间指：整个存储体的恢复时间","expanded":true}]}]},{"id":"7bf1e614-1c5c-48bf-8dfc-c49407c8679b","topic":"多体并行","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"036efd06-71a6-4035-935f-e212cd019d92","topic":"CPU可以同时快速的取出四条指令","expanded":true,"style":{"background":"#FDD834"}},{"id":"ae31f7cf-2df9-4bf3-83c8-46c8d237d7ac","topic":"每个模块都有独立的控制电路、地址寄存器、时间寄存器、可以并行+交叉工作","expanded":true,"style":{"background":"#FFABD5"}},{"id":"e6efd227-8d96-4f07-be9d-2bc7cccf8b47","topic":"高位交叉编址","expanded":true,"children":[{"id":"833b2043-2e84-4ea0-9361-0090a214a378","topic":"高位2bit是对应不同的存储体","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-e3fe3929991c86.png","width":240.09,"height":172.19},"children":[{"id":"0ef1ca30-cf19-4287-b508-2930699ccd06","topic":"M0 : 00 xxxxxxxx\nM 1:  01 xxxxxxxx\n编程难度大","expanded":true,"children":[{"id":"c5c1eb8a-2a66-4878-b2b6-91fadab21f5d","topic":"读完一个数据后，存储体需要进行恢复，恢复完后才能读下一个","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"e32dda0b-f3ba-48d1-9ae5-7e584d200a2c","topic":"举例：","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-8aedd8aebda998.png","width":71.13,"height":127.21},"children":[{"id":"e136cd84-4f53-465b-90dd-3af483bf9e2a","topic":"甘特图， 耗时 5T","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-d7ad1926cab354.png","width":229.52,"height":97.03}}]}]}]},{"id":"edfb5c90-7ab4-4274-a25a-280964f5121f","topic":"低位交叉编址","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"77285dd5-25d0-4f28-96b0-460d8f436cdd","topic":"低位2bit对应不同存储体","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-d0787e04640217.png","width":266,"height":175.34},"children":[{"id":"ce5e5253-5547-41bb-ae44-22a586767483","topic":"举例：","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-8aedd8aebda998.png","width":71.13,"height":127.21},"children":[{"id":"d93bab73-f388-4453-aad0-201b63b7253a","topic":"甘特图， 耗时 T+4r","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-3855e6f36f72a6.png","width":1938,"height":1356}}]}]}]}]},{"id":"a1ffef2b-4a12-4375-93ca-74141cc98b24","topic":"流水线式","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"9627fbef-ea90-45e3-a005-685e00d02d13","topic":"多体并行 + 低位交叉","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c16b8fc5-a2fd-4499-99ba-4a199f3b36b8","topic":"模块存取一个字的存取周期为T，总线传送周期是r，为实现流水线方式存取，存储器交叉模块数应大于等于：m = T/r","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"510bed8f-eee7-4155-a02f-af3860d0a113","topic":"等于是最好的，不然少了浪费时间，多了浪费钱","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"79c6c036-bab4-4151-ba88-32441c914ae0","topic":"每过r周期启动下一个模块，这样当最后一块传完后，第一块又能接上了。","expanded":true},{"id":"a70ae1e1-d3fd-4f37-8348-1b3cbe1e841c","topic":"存取m个字，需要T+(m-1)r的时间","expanded":true,"style":{"background":"#FF9595"}}]}]}]},{"id":"2b6b5fc4-89cf-475f-9845-616f8630894b","topic":"单体多字","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"93b82637-9d52-4138-ba6f-914c55617743","topic":"把多体并行存储器合并在了同一个存储器中，所有存储器共用控制电路、寄存器等等","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-3f79f0b44d1053.png","width":240.08,"height":162.39},"children":[{"id":"664f7194-0452-4465-b9e4-0befa919c678","topic":"故一次存取都需要读写一整行的信息（可能会读取多余的信息）","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"2754052d-302c-4131-bf7a-f7f2468a2010","topic":"速度和多体并行的速度基本完全一致","expanded":true,"style":{"background":"#FF9595"}}]}]}]}]},{"id":"cc8b83fcc84a5daaae30da8816","topic":"主存储器和CPU的连接","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-8e07d6402c822e.svg","width":64,"height":64},"children":[{"id":"6913d491-6fc1-4e72-9d8a-233ca31c7ebb","topic":"总线信号命名：","expanded":true,"children":[{"id":"4ac2c244-6ab0-437e-9a0b-403d77509bd9","topic":"地址A0 ~ A7，数据 D0 ~ D7","expanded":true}]},{"id":"2cba33bd-530b-4091-b47d-8da57ab3b5ea","topic":"主存的基本组成","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"553ae4b8-0a63-41e2-a4c9-f5ad7bd4db92","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-d594988cc4846e.png","width":520.46,"height":206.04},"children":[{"id":"52bd33f1-4de3-4cba-aa44-7b2d2615c11c","topic":"内存条插槽内有存储器总线","expanded":true},{"id":"07c8b5a0-4ded-4f3c-a6e3-ae90a42fd4c6","topic":"内存条中的信息通过【内存条的引脚】，再通过【插槽内的引线】连接到【主板】上，通过【主板上的导线】连接到【CPU芯片】。","expanded":true},{"id":"e52c2ad1-4b13-4871-894d-d5e5552cf61c","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-3abd6598a5484b.png","width":264.31,"height":171.39}}]}]},{"id":"c5f587a6-e6f3-46bd-9d9d-8bcaa0ab15d3","topic":"位扩展","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"98501422-348b-48b1-940a-746c346a2eb4","topic":"原因：芯片的字长(bit数)和CPU的字长(bit数)不统一，需要横向连接多块芯片来满足CPU的读取一次时的bit数需求","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"97131cea-4cbb-4612-bea0-d2d30e3f884b","topic":"即：扩展一次性可以读出的数据字长","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"f7201688-03f7-4067-b4f7-d9f3d0a9a4b2","topic":"最开始只有一块芯片的时候（数据线不够）","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-bc4378b11122a8.png","width":269.66,"height":276.13},"children":[{"id":"01d5c808-37cf-4245-9e6b-b01c8727d09a","topic":"例如再连一块","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-f382591f3237d6.png","width":366.47,"height":269.68},"children":[{"id":"72065171-fcb7-4d9b-8e11-066df4ce18a9","topic":"最后连接8块芯片","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-f6cb9c159a83ed.png","width":338.04,"height":264.54},"children":[{"id":"b1adf161-9566-4736-a15e-ddf13a1ea1f3","topic":"这样就把八个8K * 1位的芯片通过【位扩展的方法】扩展为了8K * 8位的芯片","expanded":true}]}]}]}]},{"id":"95631026-d2e3-4c6c-985c-846c3636205a","topic":"字扩展","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"7cc808e3-3851-448b-adce-a3a27b59b1d3","topic":"原因：芯片的字长和CPU已经满足了，可是CPU的地址总线上还是有很多根没有充分利用。故可以通过在地址中设置片选信号来增加地址数目","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"5633580b-28d1-4b4b-9eec-f6db07ad3190","topic":"即：扩展主存字数","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"35d3ffdf-e3ee-4f05-9549-b7b824339f9f","topic":"最开始的时候地址线还有3个引脚没有连接","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-3d13ff12d14f7d.png","width":249.63,"height":258.08},"children":[{"id":"33f3919d-123e-450c-8f5b-90a7951b565c","topic":"法一：线选法，CPU每一根多的地址线就连接着对应的芯片的CS。【这样CPU多了N根线，就可以多连接N个芯片】","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-fa86ed7e3182ff.png","width":398.53,"height":232.81},"children":[{"id":"d9a9b19b-9b99-4e79-bf9f-7d73c7f54b9f","topic":"地址空间不连续","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"9c9e859c-774b-41ef-821e-f8fa62be83bc","topic":"法二：译码片选法，CPU的每一根对应的地址线都连接一个非门和一根线，这样可以控制两个芯片。【所以CPU多了N根线，可以多连接2^N个芯片】","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-7bc2d763e15fc3.png","width":481.14,"height":232.96},"children":[{"id":"399a8446-207f-4435-b554-dc7b19228e1b","topic":"译码片选法连接多个芯片(此处选择了A13,A14，所以A15无论是多少都不会改变A0-A14的地址映射）","expanded":true,"style":{"background":"#FDD834"}},{"id":"4714d7bc-9591-4c37-9cda-695e463ae211","topic":"这样就把4个8K * 8位的芯片通过【字扩展的方法】扩展为了32K * 8位的芯片","expanded":true}]}]}]},{"id":"18eb03eb28395f9c5b49b8788d","topic":"字位扩展法：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"b8c8fb1b-dba9-40d9-be3c-4ce1723ae4ef","topic":"图示","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-6e8c5b1c1cc750.png","width":468.48,"height":239.52},"children":[{"id":"31241dcb-ca8a-4d02-ac96-f4ff4f43c044","topic":"两个芯片(16K * 4)为一组进行【位扩展】，所以机器字长为8bit(16K * 8)。再将四组通过【字扩展】连接在一起，形成(64K * 8)的存储空间","expanded":true,"style":{"background":"#FDD834"}},{"id":"5c97f033-b70a-4836-94ee-ad85b180e05d","topic":"地址空间为：\n0000 0000 0000 0000 ~ 1111 1111 1111 1111","expanded":true,"children":[{"id":"2005d576-930b-4507-9d6c-8a317f7ad459","topic":"每个地址对应一个字的数据（此处一个字=1 Byte）","expanded":true}]}]},{"id":"8da87d44fdab3267f11228edef","topic":"注意CS和WE线","expanded":true}]},{"id":"9817b7af-1945-48b5-b987-b03c3e1a022d","topic":"补充：译码器","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"b53ec757-38cb-4874-9f4f-b00392454034","topic":"普通的3-8译码器","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-8877c14d0f3ffe.png","width":358.46,"height":230.64},"children":[{"id":"004660fd-8a29-4b66-8688-b02a0d41079a","topic":"\"使能\"端","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"fc5392ad-0026-471e-b4df-6326d30048ac","topic":"EN使能","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-9524b9c38ac512.png","width":696,"height":622},"children":[{"id":"df998d71-3bf3-40c8-bcec-009de6a53366","topic":"74ls138","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-f4385924a1583a.png","width":175.84,"height":186.65}}]}]},{"id":"bcb31a3e-f137-4abd-ad4b-359b818ba9d9","topic":"MREQ","expanded":true,"children":[{"id":"d36820d6-b603-4620-93a4-076f4d842589","topic":"CPU通过控制一个使能端，来控制CPU的操作顺序","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-270e5d302ba461.png","width":312.56,"height":200.59},"children":[{"id":"b6c8b763-4685-4c04-9e62-1a0f3d265378","topic":"CPU先把地址信号传递到地址线上面去，检测到信号稳定后，CPU才会把MREQ设置为0，芯片才能进行运作","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-3784c87bd19525.png","width":316.23,"height":178.84}}]}]}]}]},{"id":"43aa23bc-5ddb-4c2f-9ffd-75b52efbcbd4","topic":"考频：中","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"9516abb9-9ccb-494b-a479-f809cf72589c","topic":"09-11、16、18、21","expanded":true}]}]},{"id":"c0c0a191-606f-463f-adee-6a0f1d60c67c","topic":"外部存储器","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-28806fd6f160a8.svg","width":60,"height":61},"children":[{"id":"f282e774-2699-4d40-b3e6-4975175f9f3d","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"70596399-8c68-48a1-8061-3569f412cad2","topic":"13*2、15、19","expanded":true}]},{"id":"0d3e1136-0a2b-4e1c-9ee3-b7315fff7153","topic":"磁盘存储器","expanded":true,"children":[{"id":"de09c335-7bab-4210-aa79-cf42150f7c8c","topic":"磁盘的概念","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"ff9bc198-7d20-4d28-9dcb-0724b79f61c8","topic":"磁道","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"3f3f728d-5e8f-4846-8033-f0cbea47b05b","topic":"一个又一个的【同心圆】","expanded":true}]},{"id":"3256995d-cf20-4aa0-9729-ded94a2bcd51","topic":"磁道间隙","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"5662bce0-0fe2-425b-a623-2a4f2e718cc5","topic":"每两个同心圆之间的【间隙】","expanded":true}]},{"id":"d6af4cb9-4cbc-44d0-9f70-4b6c93964885","topic":"扇区","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"84f44848-0f0c-4193-8794-203711e28d4b","topic":"一个磁道可以分为若干个【扇区】","expanded":true},{"id":"f27f0fa3-25b4-449a-aee3-0ab8570e24c7","topic":"又称：磁盘块（物理上）","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"203b614a-2083-4502-8983-23852485c6f7","topic":"扇区间隙","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"897dbc63-9462-4428-b382-1ca8ca38372f","topic":"每两个扇区之间的间隙","expanded":true}]},{"id":"4e23d6b1-b957-4eed-a434-ef2d83fb026c","topic":"柱面","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"73fe6b18-7c3a-4c48-adc6-4431970c6bc7","topic":"多个磁盘垂直叠在一起时，所有磁道组成的垂直面就是柱面","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-2780be14696170.png","width":365.55,"height":331.26}}]},{"id":"4a355afa-bad0-43c2-b5e2-5c45efc3c188","topic":"块","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"c04e9f16-a159-481b-aed8-fb1564e9fd8c","topic":"物理块","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"751d0442-3280-4935-b3bc-1790c4d954c0","topic":"扇区","expanded":true,"style":{"background":"#FDD834"}},{"id":"30685290-e6cc-44a0-85c6-bd44929de7fb","topic":"物理上读写一次的基本单位","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"a44ba11a-39fa-4d57-b2c5-fd29eb00e015","topic":"逻辑块","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"d5eb284a-f3bc-41e5-9102-8629d29c9576","topic":"簇","expanded":true,"style":{"background":"#FDD834"}},{"id":"586d47e7-c3b7-4b2c-9920-2a04ec5122b7","topic":"OS中存储空间分配的最小单位","expanded":true,"style":{"background":"#FDD834"}}]}]}]},{"id":"b37953bb-3b1b-4dfe-97e7-7741cc31a2e7","topic":"磁盘地址形式：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"b6c850fa-c7d0-4d18-9595-402f2a6e1bcb","topic":"<柱面、盘面、扇区>","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"d2e0846c-0ba7-4e65-897b-6b13e8962e0f","topic":"因为移动磁头是需要很多时间的","expanded":true}]}]},{"id":"1f9eb396-5806-4d57-ba83-752b972b3896","topic":"磁盘阵列","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"129fb5ca-a35a-4d18-8704-c776224e285d","topic":"RAID （独立冗余磁盘阵列）是指将多个独立的物理磁盘组成一个独立的逻辑盘，数据在多 个物理盘上分割交叉存储、并行访问，具有更好的存储性能、可靠性和安全性。","expanded":true},{"id":"b26154b3-adb8-4963-bec5-6be821a39e9f","topic":"• RAID0：无冗余和无校验的磁盘阵列。","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"72192633-40af-4205-a0bb-38ecd7519949","topic":"把连续多个数据块交替地存放在不同物理磁盘的扇区中，几个磁盘交叉并行读写，扩大了存储容量，提高了磁盘数据存取速度，但没有容错能力","expanded":true}]},{"id":"d2357077-cf05-4845-8084-81e39866231b","topic":"• RAID1：镜像磁盘阵列。","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"e993f34c-377c-43b4-985c-ba4f01216e04","topic":"使两个磁盘同时进行读写，互为备份，若一个磁盘出现故障，可从另一磁盘中读出数据。","expanded":true},{"id":"c4990cec-d625-4893-a254-c79d693f58b4","topic":"但容量减少一半","expanded":true}]},{"id":"e8ac40af-43b4-4be3-9c1a-22a8f4426086","topic":"• RAID2：采用纠错的海明码的磁盘阵列。","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"59de5306-7488-4245-8b07-d02093997999","topic":"• RAID3：位交叉奇偶校验的磁盘阵列。","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"40665d26-a350-42cc-9b25-5a4f279d0a2d","topic":"• RAID4：块交叉奇偶校验的磁盘阵列。","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"7ee60dd7-56f8-4098-aa2e-851c37ab2f13","topic":"• RAID5：无独立校验的奇偶校验磁盘阵列。","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"a65b92fc-99f6-4964-9b64-7738c1f2bfaf","topic":"固态硬盘SSD","expanded":true,"children":[{"id":"1a85d0cf-089a-484a-bebc-9cf4407d13e8","topic":"固态硬盘","expanded":true},{"id":"c1afb4a4-2efe-45ef-a62e-f449c3fe27f2","topic":"基于闪存的存储器","expanded":true,"children":[{"id":"65ca3db9-db52-4812-b41b-22a57d458268","topic":"存储介质：NAND颗粒","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"635bab54-9e8a-4c4d-a7be-5b9d41b9c133","topic":"读写速度比较：","expanded":true,"children":[{"id":"febb8fd0-ace1-489b-89bb-c57745a79033","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-587b202b3b391d.png","width":720.53,"height":297.85},"children":[{"id":"5f6feb24-31a0-4e71-8cb2-0a84faa131e8","topic":"（硬件茶谈）","expanded":true}]}]},{"id":"d322f108-4642-4675-aab3-6c14f2976116","topic":"组成：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"57ff1f31-5972-4495-a34f-3e1b2f3f25f2","topic":"闪存翻译层 + 多个闪存芯片","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-42fb1caabedb7b.png","width":706.58,"height":428.1},"children":[{"id":"1ae730a9-e0fd-45a3-a094-5405d47de5ef","topic":"读写单位","expanded":true,"children":[{"id":"71d71b75-a83f-4066-af37-8882eb26e931","topic":"CPU下令要读取一个块的内容","expanded":true},{"id":"aedb4bdd-e350-406d-bb46-b5c915a97824","topic":"SSD的读取单位：一个页","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"af8a4d23-56a7-4301-a364-984512a9684a","topic":"SSD接受到这个块的地址","expanded":true},{"id":"ae033d9c-d6ff-4c91-aeca-d1c3d789b567","topic":"SSD的闪存翻译层把它翻译为SSD中对应的数个页的地址","expanded":true},{"id":"95360780-ce84-4a18-aa28-a645f21356da","topic":"SSD把这些页的数据发到IO总线上，返回CPU","expanded":true}]},{"id":"8b1765f3-4c8b-48c6-be3c-2823046d5c05","topic":"具体大小：机械磁盘的一个块大小可能在1KB；SSD的一个页大小是512B~4KB，一个块中有32~128个页","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"5e852c0f-7c3a-45cd-b8c3-fcc3623d8b49","topic":"市面上的厂家的SSD都有一个缓存","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]}]},{"id":"79025a93-a9e7-4a8d-9764-d18817f4feae","topic":"读写原则：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"9f83d662-4173-43d3-9725-3a680c0dd765","topic":"读：以一个页为单位来读 ✅","expanded":true,"style":{"background":"#FF9595"}},{"id":"4c43e5cc-876c-4951-82ce-162bb71472fd","topic":"写：以一个页为单位来写","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"74c7e662-cbfd-4984-a558-652635fc0ae3","topic":"擦除：以一个块的单位来擦除","expanded":true},{"id":"ad0b23c6-9305-405c-8029-84d04e0231ff","topic":"擦除方法：先把要写那页的整块复制到另一块，然后再擦除原来那块","expanded":true,"children":[{"id":"4dab2c53-0b19-47b1-9df4-a5c8504cce88","topic":"复制过后，在闪存翻译层中会建立新的： ‘逻辑地址’ —— ‘物理地址’ 的转换关系","expanded":true}]},{"id":"18aec3ee-8c31-476a-b3c3-6c7f6e197637","topic":"擦除的缺点：","expanded":true,"children":[{"id":"fbc25d6c-e705-484c-9d44-e149ddc3db52","topic":"擦除多了会造成磨损","expanded":true}]}]}]},{"id":"07981c47-bc78-40c8-b57d-9894a49371b9","topic":"平均磨损","expanded":true,"children":[{"id":"bd9d2275-648c-4dce-a8c1-e7d403f5464b","topic":"静态平均：","expanded":true,"children":[{"id":"da9a01b6-a8b0-4597-9a2a-828a7f108fc3","topic":"SSD在进行擦除后的数据迁移的时候，会让寿命比较老的闪存块担任“读”的责任，让新的闪存块担任“写”的责任","expanded":true}]},{"id":"fd62ef39-f065-451f-bae7-f7ef85873455","topic":"动态平均：","expanded":true,"children":[{"id":"4494a571-38bf-49b6-b50e-c99e202bd922","topic":"在SSD写入新数据的时候，会优先选择磨损次数少的块进行写入","expanded":true}]}]}]}]},{"id":"30d9c9760e094de4f7d87b7985","topic":"高速缓冲存储器Cache","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-17250ac514b2bc.svg","width":64,"height":64},"children":[{"id":"ed161682-79fb-43cd-9f54-f21fa2efd830","topic":"前提","expanded":true,"children":[{"id":"82155ca3-264b-49d9-bc91-cb695a841663","topic":"局部性原理","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"b6bf21b1-de1b-4677-b15c-4b0764d0ed8f","topic":"数组访问【空间局部性】很好 👍🏻","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"3cb717e9-2255-41e5-818e-3b156a7c15ba","topic":"数组访问【空间局部性】差劲 👎🏻","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"8e586ea8-b935-4620-87dd-7a46a1a0fe54","topic":"分析：","expanded":true,"children":[{"id":"ac80fbec-36f4-4e16-8ce8-ebed943cff3e","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-632ef2ede8771f.png","width":186.22,"height":417.85}}]}],"code":{"lang":"c","code":"int sumArrayCols(int a[M][N]) {\n    int i, j, sum = 0;\n    for (j = 0; j < N; j ++)\n        for (i = 0; i < M; i ++) // 后 i\n            sum += a[i][j];\n\n    return sum;\n}","tokens":[[{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"sumArrayCols","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"a","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"M","darkColor":"#DEDBD2"},{"text":"][","darkColor":"#BAB5A8"},{"text":"N","darkColor":"#DEDBD2"},{"text":"])","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"{","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":" i","darkColor":"#DEDBD2"},{"text":",","darkColor":"#BAB5A8"},{"text":" j","darkColor":"#DEDBD2"},{"text":",","darkColor":"#BAB5A8"},{"text":" sum ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"for","darkColor":"#8EA4E2"},{"text":" ","darkColor":"#DEDBD2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"j ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"},{"text":" j ","darkColor":"#DEDBD2"},{"text":"<","darkColor":"#BAB5A8"},{"text":" N","darkColor":"#DEDBD2"},{"text":";","darkColor":"#BAB5A8"},{"text":" j ","darkColor":"#DEDBD2"},{"text":"++)","darkColor":"#BAB5A8"}],[{"text":"        ","darkColor":"#DEDBD2"},{"text":"for","darkColor":"#8EA4E2"},{"text":" ","darkColor":"#DEDBD2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"i ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"},{"text":" i ","darkColor":"#DEDBD2"},{"text":"<","darkColor":"#BAB5A8"},{"text":" M","darkColor":"#DEDBD2"},{"text":";","darkColor":"#BAB5A8"},{"text":" i ","darkColor":"#DEDBD2"},{"text":"++)","darkColor":"#BAB5A8"},{"text":" // 后 i","darkColor":"#908B7E"}],[{"text":"            sum ","darkColor":"#DEDBD2"},{"text":"+=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"a","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"i","darkColor":"#DEDBD2"},{"text":"][","darkColor":"#BAB5A8"},{"text":"j","darkColor":"#DEDBD2"},{"text":"];","darkColor":"#BAB5A8"}],[{"text":" "}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"return","darkColor":"#8EA4E2"},{"text":" sum","darkColor":"#DEDBD2"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"}","darkColor":"#BAB5A8"}]]}}],"code":{"lang":"c","code":"int sumArrayRows(int a[M][N]) {\n    int i, j, sum = 0;\n    for (i = 0; i < M; i ++) // 先 i\n        for (j = 0; j < N; j ++)\n            sum += a[i][j];\n\n    return sum;\n}","tokens":[[{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"sumArrayRows","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"a","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"M","darkColor":"#DEDBD2"},{"text":"][","darkColor":"#BAB5A8"},{"text":"N","darkColor":"#DEDBD2"},{"text":"])","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"{","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":" i","darkColor":"#DEDBD2"},{"text":",","darkColor":"#BAB5A8"},{"text":" j","darkColor":"#DEDBD2"},{"text":",","darkColor":"#BAB5A8"},{"text":" sum ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"for","darkColor":"#8EA4E2"},{"text":" ","darkColor":"#DEDBD2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"i ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"},{"text":" i ","darkColor":"#DEDBD2"},{"text":"<","darkColor":"#BAB5A8"},{"text":" M","darkColor":"#DEDBD2"},{"text":";","darkColor":"#BAB5A8"},{"text":" i ","darkColor":"#DEDBD2"},{"text":"++)","darkColor":"#BAB5A8"},{"text":" // 先 i","darkColor":"#908B7E"}],[{"text":"        ","darkColor":"#DEDBD2"},{"text":"for","darkColor":"#8EA4E2"},{"text":" ","darkColor":"#DEDBD2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"j ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"},{"text":" j ","darkColor":"#DEDBD2"},{"text":"<","darkColor":"#BAB5A8"},{"text":" N","darkColor":"#DEDBD2"},{"text":";","darkColor":"#BAB5A8"},{"text":" j ","darkColor":"#DEDBD2"},{"text":"++)","darkColor":"#BAB5A8"}],[{"text":"            sum ","darkColor":"#DEDBD2"},{"text":"+=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"a","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"i","darkColor":"#DEDBD2"},{"text":"][","darkColor":"#BAB5A8"},{"text":"j","darkColor":"#DEDBD2"},{"text":"];","darkColor":"#BAB5A8"}],[{"text":" "}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"return","darkColor":"#8EA4E2"},{"text":" sum","darkColor":"#DEDBD2"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"}","darkColor":"#BAB5A8"}]]}}]},{"id":"b1da3c23-518d-4860-bf0e-a1e34764b9cf","topic":"上述问题的三个其他点：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"53a715c3-1230-4690-912f-1f8ec27eddd9","topic":"数组访问的时间局部性：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"ac1e44b7-d862-4d5f-a966-1c646ad8ee43","topic":"都差，因为都只访问了一次","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"e36b46da-a676-4411-971a-6dc21a8753a5","topic":"for循环代码段的局部性：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"a61820e0-307c-4490-af9d-13eb40aaf748","topic":"时间、空间都很好","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"9836f14c-451c-4bb1-bfa8-77813f2924dd","topic":"操作系统采用页式存储","expanded":true,"children":[{"id":"3788e5ca-a17a-48dc-85a2-d723fc20ca3e","topic":"<页号、偏置值>","expanded":true}]}]},{"id":"b3c606fb-4a2d-4f4f-8ad6-25a21b1932f3","topic":"Cache的基本工作原理","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"7153a984-044b-4a2e-b3df-2f5e94736d6f","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-d859d14849b7a8.png","width":641.08,"height":329.54},"children":[{"id":"c9680ea7-f252-4942-873a-7e6ed16e25fc","topic":"Cache中的内容是主存的复制（缓冲区_______）","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"73acbead-e99b-435f-86a3-15592c2d903e","topic":"可以将局部性好的内容放入到Cache中","expanded":true,"style":{"background":"#FF9595"}},{"id":"cb77dcee-ce18-43fe-a6fa-20da53b055ce","topic":"Cache命中后直接把标记后的数据部分进行读取（就可以不访问内存了）","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"ec40e5d0-6f8d-4f96-91ac-f12c01db9b03","topic":"Cache的访问速度t，H为命中率，tc是cache速度，tm是访问主存速度，(1-H)后面也可以只有tm","expanded":true,"style":{"background":"#8EDE99"},"formula":{"tex":"t = H t_c + (1 - H)(t_m + t_c)","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>t</mi><mo>=</mo><mi>H</mi><msub><mi>t</mi><mi>c</mi></msub><mo>+</mo><mo stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>H</mi><mo stretchy=\"false\">)</mo><mo stretchy=\"false\">(</mo><msub><mi>t</mi><mi>m</mi></msub><mo>+</mo><msub><mi>t</mi><mi>c</mi></msub><mo stretchy=\"false\">)</mo></mrow><annotation encoding=\"application/x-tex\">t = H t_c + (1 - H)(t_m + t_c)</annotation></semantics></math></span>"}},{"id":"6a03c02c-8b0a-43b1-8c9d-9e45a3e79833","topic":"通常采用SRAM构成","expanded":true,"children":[{"id":"36c6cc7b-2ecc-467d-8700-a69be1433348","topic":"现代计算机把Cache集成在了CPU的内部","expanded":true}]},{"id":"c3882330-4eb5-4c1e-a4c7-861f95190073","topic":"速度快、成本高、集成度低","expanded":true}]}]},{"id":"6360a10c-817e-48e6-a794-33d164860751","topic":"大题看到题目第一步怎么做：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"eb21849c-7b58-48d9-a7b9-372e23679600","topic":"下面那个地址可以不画","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-a57cfd6115647c.png","width":491.43,"height":283.26}}]},{"id":"cf2935ef-6d12-4bab-904b-82ef5a7c15fb","topic":"Cache和主存的映射关系","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-8e96857cb3fbcf.svg","width":60,"height":60},"children":[{"id":"01ad3238-a741-4706-a65c-0a5574220e3f","topic":"Cache每一行的内容","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"46cb5191-c828-499f-af37-180d3f791e4e","topic":"(计数位 + 脏位) + 有效位+标记+存储的内容","expanded":true,"style":{"background":"#FDD834"}},{"id":"2171e325-55d1-43f0-9170-9d669c36e877","topic":"【计数位】是用于LRU算法的","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"2579b70e-86c1-48b5-b577-e827781c28b7","topic":"也叫替换控制位","expanded":true},{"id":"5ac1fa8a-8a80-4fa9-8dc1-ea975d374c62","topic":"比如是2^n 路组相联，就需要n bit的计数位","expanded":true}]},{"id":"372ef5c8-c0e2-4eb2-a30b-43898f98a55d","topic":"【脏位】是用于Cache写策略的","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"cfb67a2f-0472-4ea9-aaf5-65a6f69aea21","topic":"【有效位】为1说明该Cache行的内容有效，为0则不然","expanded":true,"style":{"background":"#8EDE99"}},{"id":"ce680bc9-9b33-4474-880a-22c6114167be","topic":"【标记】是用于与地址进行比对的关键字","expanded":true,"style":{"background":"#8EDE99"}},{"id":"a5c14af9-eab0-4958-814b-0d1c292d7fe3","topic":"【存储的内容】就是对应的主存页面的副本","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"e280564c-7ea7-4e16-a131-610ce6e79264","topic":"直接映射","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"b8c878eb-ec20-4602-bfa3-577e7223ef20","topic":"直接映射规则：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"459e9367-1211-4eb9-a57f-66dac4912265","topic":"主存在Cache中的行号 = 主存块号 % Cache总块数","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-98e9a983a25cf9.png","width":1020,"height":1260}}]},{"id":"efc43abc-a84a-4d1b-ad89-c99037cefffb","topic":"映射公式","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"b4394785-d3dc-4cdd-8c30-bdddf6f7e14c","topic":"Cache中有2^c页，则主存中第 i 页对应在Cache中的行号 j","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"1b10ea4f-7da5-4497-8e00-5393ff5b913c","topic":"替换算法：如果出现冲突，则直接将块移出cache","expanded":true}],"formula":{"tex":"j = i \\bmod 2^c","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>j</mi><mo>=</mo><mi>i</mi><mtext> </mtext><mo lspace=\"0.22em\" rspace=\"0.22em\"><mrow><mi mathvariant=\"normal\">m</mi><mi mathvariant=\"normal\">o</mi><mi mathvariant=\"normal\">d</mi></mrow></mo><mtext> </mtext><msup><mn>2</mn><mi>c</mi></msup></mrow><annotation encoding=\"application/x-tex\">j = i \\bmod 2^c</annotation></semantics></math></span>"}}]},{"id":"d0f2e9aa-0ac0-4c53-be2f-6bd97a4115ab","topic":"地址变化：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"cb6d978c-bf36-4074-9b6e-d48370836609","topic":"大题第二步（根据地址应声规则计算正确的地址形式）","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-d09128dc9dc927.png","width":371.17,"height":276.56},"children":[{"id":"f6558105-e5ca-47c5-884d-03c3f2f86517","topic":"此时主存的地址样子","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-7cfbea02671474.png","width":229.61,"height":259.73},"children":[{"id":"5477d219-1340-476f-8eb4-f29044bf40c5","topic":"CPU访问例子（大题第三步）","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-f0b6be31f7e57f.png","width":405.65,"height":252.71}}]}]}]},{"id":"e49fc165-83ed-439f-ba47-38a0305642db","topic":"电路图","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"97dbc820-3591-4785-98d6-1fd501826174","topic":"图示","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-4e3cfe79e7b6dc.png","width":356.79,"height":280.11},"children":[{"id":"18cf2ff3-e0c7-433b-bbf3-84fa36f8f609","topic":"首先获得访问的地址<块号、块内地址>","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"25ae7baf-79d0-42f1-bf6b-bafe4a790297","topic":"<页号、偏移量>","expanded":true}]},{"id":"2dd5a68c-14f3-4e4f-b1b1-7e343190ca17","topic":"解析页号，获得最末尾的c位，【直接定位到】Cache的对应行，把前t位与当前标记位进行比较，如果相同则命中。","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"2547ae02-f177-494d-b005-b4ee19826617","topic":"Cache每行结构：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"771c6c37-78c3-41e9-a545-1f64add5dd93","topic":"Cache每行有 1+1+19+64*8 = 533 bit","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-2c22af418a6ce7.png","width":367.74,"height":244.55}}]},{"id":"a0e81ecd-6df3-42d4-a212-1d9814c37d0b","topic":"特点","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"ce2c5703-f8ba-4166-9ce7-f137b120a02a","topic":"简单，不够灵活，冲突率高，空间利用率低","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"8b636847-ae61-4bdf-a161-569255af8329","topic":"课后题目：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"9eaef461-0b15-4d4d-b9fc-c81c8f7ed24e","topic":"已知主存地址，装入Cache的对应地址","expanded":true,"style":{"background":"#FFABD5"}},{"id":"c02f3c23-dc1b-4b03-8283-b53a20d464a3","topic":"已知主存地址，问对应的Cache行的标记","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"f759ea38-6368-4248-a3ca-d5c768a89f43","topic":"例如：Cache一共有8行，页面大小为1K，地址总数为16bit","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"ee198fe0-6d6f-4e1f-99f0-880041841d92","topic":"100, 110, 0010010011","expanded":true},{"id":"7d6b4af3-09c8-4584-ae1c-887f9b450c2f","topic":"3bit标记号、3bit行号、10bit偏置值","expanded":true},{"id":"faad54b9-f07c-43d4-a613-43a0e46016da","topic":"前3+3bit指明了内存中对应的块号（前3需要存储在Cache中，而后3是Cache当前行的行号）","expanded":true,"style":{"background":"#FFABD5"}}]}]},{"id":"38198321-cc1f-4946-b697-b9aa7df8b71d","topic":"全相联映射","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"322824c3-12ed-472b-b71a-072ab38cb7b4","topic":"映射规则：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"f4f2f0c5-7941-4b79-8f06-aef8bad76dc1","topic":"主存中的块可以存入Cache中的任意位置","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"0ffeb6d4-1fc5-417a-a3ee-3126073c363a","topic":"映射公式","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"5748ebaf-9ea1-44e6-a9bf-95cd19af14ce","topic":"【无】","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"b722ae72-f904-4d03-bb15-1b733353a9d1","topic":"查找方式：遍历所有Cache行","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"6c50ac8c-30db-4948-8b41-1705b702a01f","topic":"地址变化：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"20541f89-d9e7-47fb-a53f-dddaf3d22fe1","topic":"大题第二步（根据地址映射规则计算正确的地址形式）","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-fbe523b3328648.png","width":371.81,"height":246.47},"children":[{"id":"0093e9dd-4e7a-4601-bf42-c050e41ea063","topic":"此时主存的地址样子","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-3bc1cfc20ac0cf.png","width":248.67,"height":258.92},"children":[{"id":"ca49f625-5db2-4461-b015-310771a6c535","topic":"CPU访问例子（大题第三步）","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-434393249944cd.png","width":454.67,"height":261.9}}]}]}]},{"id":"343485c1-8bdf-48a1-8e60-f97318738462","topic":"原理","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"504e596b-67aa-427f-9430-2ca9c9dbe571","topic":"首先获得访问的地址<块号、块内地址>","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"b23541cc-3a6e-4a63-9c48-15f1bb8ba3da","topic":"<页号、偏移量>","expanded":true}]},{"id":"c42f84d5-cdfe-49e1-8fe8-b039f227ef83","topic":"解析页号，【遍历】整个Cache标记，进行比较，找到标记相同的","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"67a07579-3c58-431b-9bf1-59432d9aa3ed","topic":"特点","expanded":true,"children":[{"id":"d69cb0c1-73a1-4a19-a93c-46c34315b1d7","topic":"灵活、冲突率低、利用率高、命中率高","expanded":true},{"id":"f1f28100-c838-44cc-86ec-b954151346b0","topic":"比较速度慢，实现成本高，需要昂贵的TLB(相联存储器)进行地址映射","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"fb8240a0-b78b-4320-84a0-73da03709c83","topic":"Cache每行有 1+1+3+22+64*8 = 539 bit","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-46d8dcb228a216.png","width":318.36,"height":168.62},"children":[{"id":"ec7d2f05-4e27-42cc-af9c-44a7607f21cb","topic":"有效位：LRU算法需要3bit","expanded":true}]}]},{"id":"9e8a7f35-38fc-496e-a0b8-c2a58eda2264","topic":"组相联映射","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"693526ec-b06c-4373-8773-0ee5f9b33903","topic":"组相联映射规则：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"dcee16d6-39c4-4eab-8fec-a12e3ccc5d8e","topic":"主存在Cache中的组号 = 主存块号 % Cache总组数","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-b5cde1e56f1645.png","width":1112,"height":1272}}]},{"id":"370a6880-d547-41d4-ba3c-f6d0605b9caf","topic":"N路组相联 --- Cache每个组中有N个Cache行","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"24743f08-cab4-4387-b539-82affbe34b1a","topic":"2路组相联：两个一组","expanded":true}]},{"id":"8e954fe6-1d57-4145-90a1-e88871b3db8e","topic":"映射公式","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"0558d712-f867-43d4-9a36-64f0ff4ef97d","topic":"把Cache分为大小相同的组，每个组对应了主存的一个区域的内容。组间采用直接映射，组内采用全相联映射（i 为 主存的页号，j 为 Cache的行号、Q为Cache的组数）","expanded":true,"style":{"background":"#8EDDF9"},"formula":{"tex":"j = i \\bmod Q","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>j</mi><mo>=</mo><mi>i</mi><mtext> </mtext><mo lspace=\"0.22em\" rspace=\"0.22em\"><mrow><mi mathvariant=\"normal\">m</mi><mi mathvariant=\"normal\">o</mi><mi mathvariant=\"normal\">d</mi></mrow></mo><mtext> </mtext><mi>Q</mi></mrow><annotation encoding=\"application/x-tex\">j = i \\bmod Q</annotation></semantics></math></span>"}}]},{"id":"ac17f62a-5daa-453f-b70f-0fa519d72c06","topic":"地址变化：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"1f40a394-e311-45c6-b40e-deff4eed530e","topic":"大题第二步（根据地址应声规则计算正确的地址形式）","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-e1db8c84b7b8d3.png","width":381.96,"height":309.3},"children":[{"id":"2a8b5357-d381-4e6b-8a21-25b1d5e7c807","topic":"此时主存的地址样子","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-dee8b4c5087247.png","width":251.84,"height":301.91},"children":[{"id":"7eebe138-e6c5-4a88-b46d-fdc6c41b56a2","topic":"CPU访问例子（大题第三步）","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-7cd464c000d905.png","width":491.21,"height":295.92}}]}]}]},{"id":"34baf678-e789-4ee2-a196-fb93fbae45e2","topic":"Cache每行结构：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"05bcefed-0f22-427b-9f26-36e7c17ae725","topic":"Cache每行有 1+1+1+20+64*8 = 535 bit","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-a93a962172f118.png","width":385.36,"height":202},"children":[{"id":"b7fd9e0c-8bf6-4442-a449-944f77570028","topic":"查找Cache时就是查找标记阵列的标记项是 否符合要求","expanded":true},{"id":"0122fa3d-2854-4ef2-aba9-c31c93db6505","topic":"标记项组成的二维标记阵列","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-c95775b6c3e93a.png","width":323.81,"height":147.26}}]}]},{"id":"0ad08c7b-948f-4875-b87b-5688ec5d304e","topic":"奇葩的题目","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"258f4482-4c01-493b-9d7f-dbd2bc64af91","topic":"组相联映射还可以把最末的几位作为组号","expanded":true,"style":{"background":"#FFABD5"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-b4044a8d111dd0.png","width":429.24,"height":234.21}}]}]}]},{"id":"91d3cc93-8822-46cd-93ad-adaef3b96ea3","topic":"Cache的替换算法","expanded":true,"children":[{"id":"d771229d-daf8-4475-aa10-088e7fce48ef","topic":"直接映射：","expanded":true,"children":[{"id":"f11716d1-8ccd-4750-a19c-11e2bf6d1470","topic":"冲突直接覆盖","expanded":true}]},{"id":"6a15340a-1866-468b-865f-4ed290239e72","topic":"组相联和全相联","expanded":true,"children":[{"id":"082156d5-9da7-44b8-8fca-e8caf532446e","topic":"RAND --- 随机算法","expanded":true,"children":[{"id":"6bf26055-1913-406c-844b-451f33ace99a","topic":"随机确定一个替换的块","expanded":true}]},{"id":"06bae774-c461-4218-a243-834cd9be20ef","topic":"FIFO --- 先进先出算法","expanded":true,"children":[{"id":"f4bd448f-9f95-4e4c-9c83-34eb39e86ca2","topic":"将最早调入的行调出","expanded":true},{"id":"a7d25315-ca3e-45cb-a9a0-adb41bb46c87","topic":"会出现Belady异常、抖动","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"be939da1-f165-45c3-891a-2e6eed572787","topic":"LRU --- 最近最少使用算法","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"60897ef7-9b1b-4c3b-8472-5a73b0d8e527","topic":"堆栈类算法，在每个cache中添加一个“counter位”","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"d8997e13-5603-4505-bb35-997dfe351aa0","topic":"2^n 路组相联，就需要n bit的计数位","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"7cec4720-2a65-41f2-97cb-91b684b808c7","topic":"举例","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-1e4a09ea82d070.png","width":508.6,"height":150.8},"children":[{"id":"046b6ecc-6b0d-40eb-8ebe-0e3f17ab0594","topic":"使用counter计数来模拟堆栈的实现，阴影数值越小，说明越新进入Cache","expanded":true,"style":{"background":"#FF9595"}},{"id":"e7b330fa-bb94-4744-a6b1-055ce1692c5e","topic":"counter的值是有范围的 0 ~ 2^n-1，不会超过","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"ff82d556-819b-4668-baeb-0f0dc88b95b5","topic":"LFU --- 最不经常使用算法","expanded":true,"children":[{"id":"2bd0dbbc-deec-43ea-8150-b1f62f62e871","topic":"每行都添加一个counter位，在一段时间内，每被访问一次，counter++。换出时把counter最小的换出","expanded":true,"children":[{"id":"7f2fff10-8348-4814-a5ae-eab820e70777","topic":"没有遵循局部性","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"f8f9a154-95f5-464a-8371-a36c75b1557d","topic":"counter的大小未知","expanded":true,"style":{"background":"#8EDDF9"}}]}]}]},{"id":"c19f5bda-227d-4b02-9c69-cee028da5a2c","topic":"与OS的请求分页置换算法一致","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]},{"id":"bb59521d-5765-4097-8012-354fb66ef5e1","topic":"Cache的写策略","expanded":true,"children":[{"id":"6c2ab4e4-5c6e-46d4-89d8-addf7fe2dae1","topic":"原因：Cache存储的是主存内容的副本，当Cache内容进行变更时，需要使得Cache和主存的内容保持一致","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"ca2d79fc-4be3-4197-9042-539863b3bb99","topic":"写命中","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"f2cd6909-e14e-447e-a73e-c7397accb6cd","topic":"全写法/写直通法","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"5136fa25-6bb8-4e25-880a-4de695618ef7","topic":"把数据同时写入Cache和主存","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"4e8a89af-d1a9-42c5-bd73-c4103e0fb0fe","topic":"当需要进行替换时，可以不做其他操作，直接进行替换操作","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"6431e592-3b0a-4bc9-a6c9-004d2d6045b1","topic":"优化【CPU对主存的访问次数过多】：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"79aca2f4-9708-4a6b-b4db-d24e07eb47b8","topic":"写缓冲","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"8c713c5c-cb0b-4ae5-96b0-9fc91ae57a00","topic":"在Cache和主存中加入一个写缓冲，CPU写数据到写缓冲中，写缓冲再自行控制将数据写入主存","expanded":true,"style":{"background":"#FF9595"}}]}]}]},{"id":"0bb7953e-bca0-45f2-8481-d6ede9add3e9","topic":"写回法","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"04d6117d-a647-4d62-980b-a08951f507d4","topic":"CPU只对Cache进行修改","expanded":true,"style":{"background":"#8EDE99"}},{"id":"4fa6a73f-03da-4cb7-8484-0405515e80a2","topic":"在Cache的每一行中添加一个脏位","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"4a521ee4-c6dc-4ab6-8cf6-7c4f31ee17aa","topic":"如果要进行Cache块置换的时候，如果发现该行的脏位为 1，则需要把该Cache块写回内存","expanded":true,"style":{"background":"#8EDE99"}}]}]}]},{"id":"37268ff4-7746-4d4e-99fc-17f85ae70916","topic":"写不命中","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"1de70041-ebfd-4b32-b77d-85d73a1ad9b9","topic":"写分配法","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"cec834ec-d6b5-463c-a347-9e0bbba8424d","topic":"每次写不命中，都先把这个数据块写入到Cache中，然后把数据修改到Cache中，设置脏位为 1","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"b06ed5e3-9164-4fd3-bbb6-d242bd2047d4","topic":"非写分配法","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"e2d01b1e-544a-46d6-b7c7-74e5b25c08e5","topic":"每次写不命中，只写入主存，不进行调块","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"50271917-7078-40a6-81f8-b6e489f5b0f8","topic":"通常搭配","expanded":true,"children":[{"id":"4e5b93ca-f52a-4671-aed4-c387dd53a914","topic":"【全非】全写法 + 非写分配法","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"8a8d66de-458c-4041-b6c9-6ec868c87f76","topic":"写命中同时写回Cache和内存，写不命中只写回内存","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"07e0e94f-1ffb-477d-ba11-a082741598b4","topic":"【回写】写回法 + 写分配法","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"4cfd2a4b-2b0d-4122-a7ef-fc5cbd02fffa","topic":"写命中只写入Cache并修改脏位，写不命中则把块调入到Cache中，并只修改Cache","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"e6529793-6b0c-44e9-8c8a-8f41bdc61860","topic":"多级Cache的混合搭配","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"da212075-74f5-4a54-9ab2-53e07dd21c27","topic":"图示","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-171c129a5d873b.png","width":473.63,"height":87.46},"children":[{"id":"31eb35eb-8ac2-49ed-99a9-f8a9fa886120","topic":"CPU -> Cache -> L2 Cache","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"07c02ef1-e018-495f-b70f-5a2e30e3cc65","topic":"采用的是全写法 + 非写分配法（因为有写缓冲）","expanded":true}]},{"id":"0b75de41-993e-43b7-9ce7-daa01ff0c8bf","topic":"Cache -> L2 Cache -> DRAM","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"21c60a1c-6d0a-48fc-b24d-fd7be40fcf5d","topic":"采用的是写回法 + 写分配法","expanded":true}]}]},{"id":"3e8a41dd-3f6d-4ffb-8013-37db478e088b","topic":"离CPU越远，容量越大，速度越慢","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"d8498192-5dd2-4e8e-af75-f0ba39c8d5c9","topic":"Cache 存 L2 Cache 的复制\nL2 Cache 存 DRAM 的复制","expanded":true,"style":{"background":"#FDD834"}}]}]}]}]},{"id":"de505f10-1fd3-43c7-8c07-0c07e2018629","topic":"考频：超高","expanded":true,"style":{"background":"#BA69C8"},"children":[{"id":"ced4ddf6-b28a-4cd2-8044-118d4ad3a850","topic":"09*2、12、14、16、17、21、22、10大、13大、16大、20大","expanded":true}]}]},{"id":"955e10cb-da76-414f-aba2-1c89a0adae8c","topic":"虚拟存储器","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-44b04ee4db8d01.svg","width":64,"height":64},"children":[{"id":"7a8d74a9-4e5b-4374-bd34-68aaf17e97d2","topic":"考频：超高","expanded":true,"style":{"background":"#BA69C8"},"children":[{"id":"8b42465c-83f5-4342-8222-1cc7b69ef714","topic":"10、13、15*2、19、20、22、11大、18大、21大","expanded":true}]},{"id":"0a1fd9c8-7135-4408-8669-675b322a2739","topic":"虚拟存储器对应用程序员是透明的，是操作系统使用虚拟技术创造的具有主存速度辅存容量的存储器","expanded":true},{"id":"261025aa-6c49-41ea-b1dd-1a56cbd421e4","topic":"用户编程使用逻辑/虚地址来进行编程，操作系统自行将其转为对应的物理/实地址","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"88c63077-a16c-4804-bce6-8437deee59ec","topic":"虚拟存储器的三个地址空间","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-dad8eab77c70fe.png","width":427.83,"height":205.44}}]},{"id":"56ec1a25-11a0-4187-8071-83e9e8e9dd21","topic":"页式虚拟存储","expanded":true,"children":[{"id":"fc2fb1ea-8832-4f9e-9e35-d1af9912b29e","topic":"页表","expanded":true,"children":[{"id":"146fc651-3cff-4ea4-814a-b22686288e80","topic":"作用：找到逻辑地址对应的物理地址","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"7aecd8b2-18fe-4274-bb21-9d27fad7888b","topic":"虚拟地址的空间：内存 + 外存","expanded":true,"style":{"background":"#8EDE99"}},{"id":"977e6c9d-4b6f-442b-b0e0-8ff69cf9a81a","topic":"实地址的空间：内存","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"7fa502d7-6d8f-4c77-b0de-28d13d98f322","topic":"页表项","expanded":true,"children":[{"id":"fce561cb-ef06-4c55-ad48-1b197b3084d1","topic":"主存中的页表实例：<有效位、脏位、引用位、物理页号>","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-362c0fc0c3527c.png","width":440.92,"height":245.1},"children":[{"id":"5b753951-9926-414f-8bdb-35c11892e34a","topic":"有效位：装入位，表示是否已经装入内存","expanded":true},{"id":"6c6b6a5f-0e1e-4768-a3e4-f257b7141ac4","topic":"脏位：是否被修改过","expanded":true,"children":[{"id":"126869e1-a0bb-47a9-8428-a35453df5ad0","topic":"采用【写回法】","expanded":true}]},{"id":"eb3bfadc-8faa-45a9-aad2-4843e921e1dc","topic":"引用位：使用位，给置换算法用的","expanded":true},{"id":"aa19dea3-e3d4-4b56-9d69-7578509b1621","topic":"磁盘地址/页号：有效位为 1，则存的是内存页号。有效位为0，则存的是磁盘块号","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"f7072d34-439a-4d67-b6a7-9fffbe53c198","topic":"地址转化：","expanded":true,"children":[{"id":"8218c7c2-c3e7-4f59-a89c-240e7aef0191","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-60e85a18cf70b9.png","width":342.56,"height":278.05}}]}]},{"id":"7b99c864-8654-42a3-afdc-22614514dbae","topic":"快表","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"9f112c16-f84f-40b9-8c28-03131969e684","topic":"TLB 相联存储器，由高速缓冲器组成","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"224fcb41-b3b2-4c0d-9251-cf7c358ef6ee","topic":"快表项","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"75dd203b-c7f8-44f7-be9c-cdc1f00a9443","topic":"<虚页号、物理页号>","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"71bcf842-1e3f-4e67-9e2d-5ae6e00a1db3","topic":"作用：能够更快速的进行逻辑->物理的地址转化","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c5c529c8-652b-469a-9e66-1412c5761c72","topic":"利用局部性原理，如果在TLB中命中，就可以不用去内存中查询慢表了（少了一次内存访问）","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"4f94c123-b292-42d0-a862-22247716b980","topic":"采用：全相联映射/组相联映射","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"98613dbb-b1f2-4c83-8b32-702082cffe88","topic":"快表同样可以采用所有Cache的映射方式和替换算法","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"3c10d131-69ca-4f0d-a61d-fc0bb7b21fd0","topic":"TLB命中了，主存一定命中","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"2aa3663f-9489-4f14-bae9-8151eba90407","topic":"Cache命中了，主存也一定命中","expanded":true,"style":{"background":"#FFABD5"}}]}]},{"id":"b9bba354-889f-4731-b0f2-ab6e699ff1c3","topic":"TLB + Cache 的多级存储系统","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"2e481cb3-33d1-42cf-84cb-45722b124009","topic":"第一步：虚拟地址到物理地址","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-3b1ca0328d81b7.png","width":410.57,"height":397.68},"children":[{"id":"c7cd0d3e-1de2-4faa-93b7-02ec1b020dee","topic":"第二步：物理地址的Cache表示形式","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-f552e6ab9b465f.png","width":396.73,"height":406.06},"children":[{"id":"be38d61c-6b02-47e9-9320-c46c76ad7038","topic":"CPU给出虚拟地址<虚页号 + 页内地址>","expanded":true},{"id":"7b5456a7-5f37-44ca-aea5-d7acd626ada4","topic":"OS层：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"e0459fb5-37dd-46e9-b84f-e5abcd3a7e16","topic":"解析虚页号，查快表","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"5b39405a-e7ab-4d5b-993c-8633f0ff8de2","topic":"若命中了直接跳到合成物理地址","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"cedc8190-919a-4458-8046-aa72f23b7ce5","topic":"若没命中，首先定位到页表寄存器，获得页表始址 + 页表大小，如果页表溢出了就报错","expanded":true,"style":{"background":"#8EDE99"}},{"id":"3c546318-a605-4502-98af-0ae22a674372","topic":"随后通过(页表始址 + 一级页号)访问到对应的页目录表，找到对应的二级页表","expanded":true,"style":{"background":"#8EDE99"}},{"id":"939f3d13-3da0-4d00-932e-cdc85fac6f90","topic":"通过(二级页表表号 + 二级页号)找到对应的页表项，获得页表项中的存储的实页号","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"1cf50333-2326-4e9c-afd7-cfdc7668bc9b","topic":"把【虚拟地址】 ( 实页号 + 页内地址 ) 合成为【物理地址】","expanded":true,"children":[{"id":"95997ac8-d403-44e0-95bb-e987fd6da607","topic":"同时要更新TLB","expanded":true,"children":[{"id":"6058f01d-32f7-4def-8a83-cd8f0a6921da","topic":"在这一步的时候，页面一定在内存中了","expanded":true,"icons":["star:dark-blue"],"style":{"background":"#FDD834"}}]}]},{"id":"a0028f67-bac3-4970-a125-2debda37f89c","topic":"硬件层：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"3266cfc9-8a07-413a-b884-801c8dfe2824","topic":"解析物理地址，得出Tag、组号、块内地址","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"d2aedc69-1c86-45a7-b6c6-f5c5328d75b4","topic":"通过组号对应的Cache组，随后遍历Tag找到对应的Data，进行访问","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"a18e11b7-fca8-46fe-9f21-e0568b17aedb","topic":"如果遍历了所有Tag没有找到Data，那么直接去访问主存找对应的数据","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"8ac42d4e-c0ef-4c0d-92b0-84635bc2e591","topic":"把数据送到CPU","expanded":true}]}]}]}]},{"id":"9f270e9a-1cf2-4ec8-98e5-e4c12cae40ca","topic":"段式虚拟存储","expanded":true,"children":[{"id":"c92f6ea3-113a-4295-afaf-7d7c0a1fc5d9","topic":"与主存交换信息采用”段“","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"524d50cd-8332-424c-941c-adca0751d00f","topic":"略","expanded":true}]}]},{"id":"68885456-03ba-4532-bd8c-68ecc6e3b312","topic":"段页式虚拟存储","expanded":true,"children":[{"id":"569d95e9-6fb0-4194-a094-ac8ebd1bab54","topic":"与主存交换信息采用”页“","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"29dea277-2075-4de5-9bae-4054a8a3e9ea","topic":"略","expanded":true}]}]},{"id":"1fc51888-5704-4653-8318-48c47de8c346","topic":"Cache、TLB、页表的组合情况：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"5cdcdf55-db37-42c5-947e-67ec640eea11","topic":"图示","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-b2371b91475b3b.png","width":561.83,"height":249.29}}]},{"id":"1fce7971-9d97-4286-9987-1997c8cc08cf","topic":"虚存 和 Cache","expanded":true,"children":[{"id":"70dafaa1-5027-469b-a95a-ea126e74a4b0","topic":"相同处","expanded":true,"children":[{"id":"5e70adc4-b752-4a0c-b3f7-280d880daa2f","topic":"都提高了系统性能，两者都有容量、价格、速度等的梯度","expanded":true},{"id":"6cac9834-07c4-4688-965a-35c319512a13","topic":"都把数据分成了若干块，虚存的块更大(页面大小) ，Cache的块更小(内存块大小)","expanded":true,"style":{"background":"#FF9595"}},{"id":"3d64df2c-d9c3-4dd6-93a8-9f39d0f8638c","topic":"都有地址映射、替换算法、更新策略","expanded":true},{"id":"ead1e985-94ce-43f3-b604-1b6e9156967b","topic":"都运用了局部性原理","expanded":true}]},{"id":"0a6104a8-abfb-4076-aa66-daa0613df870","topic":"不同处","expanded":true,"children":[{"id":"009e8395-e427-469b-9b20-6460f93619e3","topic":"Cache解决系统速度问题","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"9319fb9e-25a7-4eb1-a266-3a2b5c3236e7","topic":"虚存解决主存容量问题","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"55fa57a0-2c53-4b4f-81f4-c199a5561d5d","topic":"Cache纯硬件实现，对所有程序员都透明","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"036a2e7d-6c7c-4fa5-9cf1-7eb6bdf33bb7","topic":"虚存对系统程序员不透明","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"1c1e24c0-7d0c-4192-ad52-756316c164c3","topic":"Cache不命中对速度影响没有虚存不命中的影响那么大","expanded":true,"children":[{"id":"3d8687d1-dc8c-491e-987d-ed3f6aa0216e","topic":"Cache不命中：读内存","expanded":true},{"id":"5691d174-ac3b-4135-8297-b5859686b078","topic":"虚存不命中：读外存","expanded":true}]},{"id":"186c990b-f28a-4692-af83-bf61554b8fa3","topic":"Cache不命中时，CPU直接访问主存","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"48d744d2-47a5-4c69-a878-003481e5e0b0","topic":"虚存不命中时，只能先把硬盘的数据调入内存，再与CPU通信","expanded":true,"style":{"background":"#FF9595"}}]}]}]}]},{"id":"2be22230-e488-4288-a667-8a29be5e54f7","topic":"END","expanded":true}]},"relations":[{"id":"7652c369-c6db-4c52-9863-10afb3a0b5fe","from":"39a07011-e827-42e6-9474-2c0bc68e0d4c","to":"d09f5331-d3e0-47ee-9ac8-98f6a645e53d","bidirectional":false,"label":"工程难度显著减少"},{"id":"c438bb07-1b9a-4f72-a862-8a6de1b54379","from":"71d71b75-a83f-4066-af37-8882eb26e931","to":"aedb4bdd-e350-406d-bb46-b5c915a97824","bidirectional":false,"label":"闪存翻译层"},{"id":"70a795ce-b145-4ce4-91d9-a5da840519f8","from":"79c6c036-bab4-4151-ba88-32441c914ae0","to":"d93bab73-f388-4453-aad0-201b63b7253a","bidirectional":false,"label":"例如这个图"}],"summaries":[{"id":"38ff8281-4f23-4926-92c5-fc0c89cc1430","parentId":"de09c335-7bab-4210-aa79-cf42150f7c8c","start":0,"end":3,"label":""},{"id":"abf630e1-f569-4263-a099-05f769cfc90d","parentId":"07981c47-bc78-40c8-b57d-9894a49371b9","start":0,"end":0,"label":"静态平均的效果比动态平均效果更好"},{"id":"8e17465a-888a-4b7e-be36-597133f77627","parentId":"7b5456a7-5f37-44ca-aea5-d7acd626ada4","start":2,"end":3,"label":"如果过程中发现了对应的页面不在内存中，则进行缺页处理程序（换出页面、把磁盘中的页【调入到内存】，更新页表）"},{"id":"6b302a0c-511a-41c5-b286-17437216fa4a","parentId":"a0028f67-bac3-4970-a125-2debda37f89c","start":1,"end":2,"label":"如果Cache访问缺失了，则换出Cache中的一行，把对应的主存块的内容写入到Cache中，设置标记项"},{"id":"bc5380e4-2091-4a96-967f-045f554becdf","parentId":"2e481cb3-33d1-42cf-84cb-45722b124009","start":0,"end":0,"label":"也可以合起来图"},{"id":"a0d6ca80-3cc0-4841-9af0-a8795765cc39","parentId":"0a6104a8-abfb-4076-aa66-daa0613df870","start":0,"end":0,"label":"Cache - 空间换时间；虚存 - 时间换空间。"}],"boundaries":[{"id":"0eee7209-c157-4a34-b2b3-30b04d89d2c8","parentId":"5f883662ae4bbb241d8fb8fc10","start":0,"end":0,"label":"题目没说刷新时间，那就是2ms","style":{"stroke":"#FF5252"}},{"id":"0071a915-1397-499c-b4ae-6f1cf8164f2f","parentId":"ff8d7397-011c-4620-bcc6-37b3c9338d22","start":0,"end":4,"label":"一共五大部分"},{"id":"81a9193d-b7b0-4c04-9214-871ea9775f9b","parentId":"56ec1a25-11a0-4187-8071-83e9e8e9dd21","start":2,"end":2,"label":"重要考点"}]}