{"format":"brushup-mindmap-v1","id":"co-00-sheet2","title":"第二章 数据的表示和运算","structure":"timeline-h","theme":"auto","root":{"id":"9249af3ad0d88fb5007fca7685","topic":"第二章 数据的表示和运算","expanded":true,"children":[{"id":"db1ec404-7291-4bad-88be-b8642d3320b5","topic":"数制和编码","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-ca9bf0c86fbc08.svg","width":64,"height":64},"children":[{"id":"077c322f-3d8c-42db-aa98-c62974528f22","topic":"进位计数制","expanded":true,"children":[{"id":"04bfee39-e0ad-4880-a568-2e85bc9e89ef","topic":"基数：","expanded":true,"children":[{"id":"47801fa6-c7fc-4ac9-89e2-0e984a4c0577","topic":"N进制的基数为 0 ~ N-1","expanded":true}]}]},{"id":"243b7b6a-400c-4f29-b8ff-7ec55157cc2f","topic":"为何选择二进制","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"23530ff6-e06c-4a58-9662-56ba763384fa","topic":"使用有两个稳定状态的物理器件就可以表示二进制的每一位了","expanded":true},{"id":"fb1faab9-acee-485c-b4f2-e518f5d5a0ef","topic":"逻辑运算方便","expanded":true},{"id":"1f8b3c99-eef3-45f9-83df-849f60469fc2","topic":"逻辑门电路设计方便","expanded":true}]},{"id":"0f4d0f4e-6e93-4eb1-be87-10ecc79bda1f","topic":"二进制、八进制、十六进制、十进制相互转化","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-c1c06b6344ca14.png","width":340.04,"height":288.47},"children":[{"id":"6c5d8707-0898-4c76-95c5-042246876cbe","topic":"注意八进制和十六进制要补位","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"d600482b-2cf2-463d-9f60-dc8a4f1d6b6c","topic":"真值、机器数","expanded":true,"children":[{"id":"93d43fa2-d99d-44f6-86d2-66d98a2201d2","topic":"真值：","expanded":true,"children":[{"id":"5085b427-10e5-4789-908b-9034c05ba093","topic":"符合人类习惯的数字","expanded":true}]},{"id":"67af9571-5cf1-4c52-8365-85c5b2d0a2d3","topic":"机器数：","expanded":true,"children":[{"id":"49a9e53e-fba8-4fc4-a567-73c18ede9d76","topic":"数字在机器中代表的意思","expanded":true}]}]},{"id":"acdf09dc-65ce-4af9-a8a1-b5edf7c32e08","topic":"BCD码","expanded":true,"style":{"background":"#D0D0D0"},"children":[{"id":"f8282a74-ed37-4d1d-a2c0-3c16a3a6cdbd","topic":"*","expanded":true,"style":{"background":"#D0D0D0"}},{"id":"c2a472e7-e0f7-4985-99bf-11b5a792ed4d","topic":"8421、2421、余3码","expanded":true,"style":{"background":"#D0D0D0"}}]}]},{"id":"8dff7caa-747f-407e-9587-b6a42cdb71b6","topic":"定点数的表示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-c2539473d179e5.svg","width":64,"height":64},"children":[{"id":"7b417c44-6c0c-4f8b-bafb-7009f103ea4b","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"6b1d1731-a319-4a18-b332-39f96d68f8a1","topic":"15、18、21、22","expanded":true}]},{"id":"d4225ab4-c7a7-488c-a763-abed04cf8e95","topic":"无符号数","expanded":true,"children":[{"id":"1b49eee4-dc11-4c75-ab95-350134419e42","topic":"unsigned int、 unsigned long","expanded":true,"children":[{"id":"151b5a75-7171-4950-8c0a-f0ee4a1dc1e8","topic":"无符号数没有小数","expanded":true}]},{"id":"ae71cc35-fb6b-4367-8037-b74f4b90eff1","topic":"【没有符号位】，有n个bit，则数的表示范围为：( 0 ~ 2^n - 1 )","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-6df20d9a4d83f6.png","width":287.26,"height":90.68},"children":[{"id":"124843e9-dfa3-4084-b151-ab8d64a6146e","topic":"指针、表示地址","expanded":true}]}]},{"id":"1ffc4d07-f196-45db-b72d-8dae0f664012","topic":"定点数","expanded":true,"children":[{"id":"c3c13b55-9422-4b4d-86dc-a6d7f121f7ef","topic":"小数点位置是固定的","expanded":true,"children":[{"id":"8abb12b1-5390-4a26-92ac-940535f86f76","topic":"即小数点前面和后面的位数是固定的","expanded":true}]},{"id":"91a5f526-27ea-4b68-9bf6-3bcd4970c13d","topic":"定点小数","expanded":true,"children":[{"id":"81fcecd0-8553-4e97-9e7d-5b952ddea31d","topic":"图示","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-234c3049bf9ec8.png","width":317.65,"height":104.23},"children":[{"id":"f4b0858e-5839-46fd-99e4-aa174e01be04","topic":"只表示正的、负的小数","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"8db12481-5291-4d90-ac72-2f1d8ccd7074","topic":"定点整数","expanded":true,"children":[{"id":"bc2538de-55c1-47a8-88ac-97005246f0cd","topic":"图示","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-c75c99f4530e8d.png","width":320.8,"height":101.36},"children":[{"id":"0cab2fc9-d735-4e73-9db8-0b219a7b18ca","topic":"只表示正的、负的整数","expanded":true,"style":{"background":"#8EDE99"}}]}]}]},{"id":"b4933e87-1aed-4649-9b71-79e1c44371f8","topic":"浮点数 --- 小数点位置是不固定的","expanded":true},{"id":"4979837a-9db0-42ad-9546-1d4ca764a3b3","topic":"有符号数","expanded":true,"children":[{"id":"166c6c92-cd1b-4502-a8e4-282f12d5ee68","topic":"原码","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c2b045d0-3eff-4078-a57e-163d95872e37","topic":"形式","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"76ec8c3a-c6c5-414b-b7c3-2cccd2f70f95","topic":"第一位为符号位，其余位为数值位，要么表示小数要么表示整数","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"8e59a7c7-9d76-4bb3-89ee-0a161f5aec10","topic":"表示范围","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"467be8da-c782-4b12-974f-338ba890a533","topic":"整数","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"eab01ac0-052d-41a3-9d44-077e653631cb","topic":"整数","expanded":true,"children":[{"id":"95a96d04-efea-4f20-afe4-f702a96dd3f6","topic":"存在 +0 和 -0，所以正负数对半分","expanded":true,"style":{"background":"#8EDE99"},"formula":{"tex":"-(2^n - 1) \\le x \\le (2^n - 1)","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mo>−</mo><mo stretchy=\"false\">(</mo><msup><mn>2</mn><mi>n</mi></msup><mo>−</mo><mn>1</mn><mo stretchy=\"false\">)</mo><mo>≤</mo><mi>x</mi><mo>≤</mo><mo stretchy=\"false\">(</mo><msup><mn>2</mn><mi>n</mi></msup><mo>−</mo><mn>1</mn><mo stretchy=\"false\">)</mo></mrow><annotation encoding=\"application/x-tex\">-(2^n - 1) \\le x \\le (2^n - 1)</annotation></semantics></math></span>"}}]}]},{"id":"ba3a41e8-f6f0-4453-a18e-7b9cd7bb7fb9","topic":"小数","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"4cd4d327-dee8-46a0-b44c-50743ac6a67c","topic":"纯小数","expanded":true,"children":[{"id":"97c956f7-1451-43f4-98bd-c36e0090159c","topic":"小数的表示是离散的，正负对半分","expanded":true,"style":{"background":"#8EDE99"},"formula":{"tex":"-(1 - 2^{-n}) \\le x \\le (1 - 2^{-n})","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mo>−</mo><mo stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><msup><mn>2</mn><mrow><mo>−</mo><mi>n</mi></mrow></msup><mo stretchy=\"false\">)</mo><mo>≤</mo><mi>x</mi><mo>≤</mo><mo stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><msup><mn>2</mn><mrow><mo>−</mo><mi>n</mi></mrow></msup><mo stretchy=\"false\">)</mo></mrow><annotation encoding=\"application/x-tex\">-(1 - 2^{-n}) \\le x \\le (1 - 2^{-n})</annotation></semantics></math></span>"}}]}]}]},{"id":"9ce08258-41fa-4426-bc73-b37cc9cb0a44","topic":"作用","expanded":true,"children":[{"id":"fc48a027-08ac-4d12-b10b-df4ee1830fdf","topic":"最容易理解的表示方式","expanded":true},{"id":"0f1af4db-94d1-4a73-a0cc-f6b787e9d923","topic":"原码相加运算不成立哦","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"8311cf70-9788-4250-b402-7baac43b05f3","topic":"举例：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"802ea2cc-b8b6-4913-a57e-06afd4006535","topic":"整数","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"9c24b0a9-e190-457f-a1d7-f5700b86c8db","topic":"x1  = +1110","expanded":true,"children":[{"id":"888ace6b-9c8c-4c72-8d0d-5b2621504a7e","topic":"[x1]原 = 0, 0001110","expanded":true}]},{"id":"3de04dc6-797c-4f17-81b7-69cbddb9a5a7","topic":"x2 = -1110","expanded":true,"children":[{"id":"a463ca66-0e77-4b2c-808c-7124ed665fb9","topic":"[x2]原 = 1, 0001110","expanded":true}]}]},{"id":"8df42343-e66e-4427-b54c-899ad564b878","topic":"小数","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"bc7de525-b648-4c64-8c18-48ad4edc31e1","topic":"x1  = +0.1101","expanded":true,"children":[{"id":"f0e57a0a-09e7-4f2c-b302-d03efd462f23","topic":"[x1]原 = 0.1101000","expanded":true}]},{"id":"b4bb0a08-fcf5-48ad-b92a-937d73f0d999","topic":"x2 = -0.1101","expanded":true,"children":[{"id":"51acebfb-3f41-4bef-b348-594cc8ec1aba","topic":"[x2]原 = 1.1101000","expanded":true}]}]}]}]},{"id":"42b27e16-33fc-46aa-b6f1-4604b7f33ce0","topic":"反码","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"9a265bfb-54a0-4d89-937b-536839168798","topic":"形式","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"fab7cd7f-b25a-44cb-99ae-b821ab5f89e0","topic":"从原码转化而来，如果原码为正，反码不变。如果原码为负，则反码的数值位是原码的取反","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"64e2818a-b785-4508-8440-3491b09d8c9a","topic":"表示范围","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"46441b0e-8c23-4c70-a0fa-87e42c8423bc","topic":"和原码完全一致","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"12161ba2-ef08-4dc6-8f36-253698195309","topic":"作用","expanded":true,"children":[{"id":"dde0ed5e-23cc-4d03-bbdb-cf54c8806f95","topic":"作为”原码 -> 补码“的中间态","expanded":true},{"id":"e767b469-a6ca-4b61-9ad1-d10f4cd45433","topic":"若是想通过反码得出十进制，则先转为原码再转为十进制","expanded":true}]},{"id":"722990ff-f1ab-4dca-a2a4-bcefea223dae","topic":"举例：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"bcaa4b97-551e-43ab-91cc-b9678cd59f1a","topic":"整数","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"8af41d0a-0585-4f0a-a7a7-83e67c116f08","topic":"x1  = +1110","expanded":true,"children":[{"id":"5cf49ad1-ee74-4342-ab35-571ee3a71852","topic":"[x1]反 = 0, 0001110","expanded":true,"children":[{"id":"c15d6c25-6fc5-431c-bb4a-3237d43eba71","topic":"[x1]原 = 0, 0001110","expanded":true,"style":{"background":"#ADADAD"}}]}]},{"id":"772632ac-e55c-4e5e-8221-db020b39fa64","topic":"x2 = -1110","expanded":true,"children":[{"id":"0a17a8a1-bbac-459b-9f4b-419dade6403d","topic":"[x2]反 = 1, 1110001","expanded":true,"style":{"background":"#7986CB"},"children":[{"id":"b3ec5d87-a74b-4cce-93ed-5121121f33c5","topic":"[x2]原 = 1, 0001110","expanded":true,"style":{"background":"#ADADAD"}}]}]}]},{"id":"bbbfdcfe-1209-428f-9a3d-e538c1039456","topic":"小数","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"b211cda0-5014-44d3-b4c7-e2a094be1e78","topic":"x1  = +0.1101","expanded":true,"children":[{"id":"99d89bfd-cd56-4c54-b4f3-74748ca43e68","topic":"[x1]反 = 0.1101000","expanded":true,"children":[{"id":"78c07efa-615a-4ac0-900c-d71f4722fc68","topic":"[x1]原 = 0.1101000","expanded":true,"style":{"background":"#ADADAD"}}]}]},{"id":"eeb71bc8-726d-419a-be91-1b60bf3e1dfd","topic":"x2 = -0.1101","expanded":true,"children":[{"id":"213757f3-9d0e-4954-bd17-a378accc5bf9","topic":"[x2]反 = 1.0010111","expanded":true,"style":{"background":"#7986CB"},"children":[{"id":"32d1ce5a-635a-4a6a-9447-6b23b8092921","topic":"[x2]原 = 1.1101000","expanded":true,"style":{"background":"#ADADAD"}}]}]}]}]}]},{"id":"bf82449b-0a56-48d0-905e-c4a581a63e8d","topic":"补码","expanded":true,"icons":["star:red"],"style":{"background":"#8EDDF9"},"children":[{"id":"8fac4e5b-53c0-4da2-b284-ac48e209f507","topic":"形式","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"0ab07d42-610a-47ae-b480-65fff2b7b666","topic":"正数的补码：不变\n负数的补码：反码 + 1","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"0143ae4b-96ce-472e-8f89-340ad38b09a5","topic":"负数：原码转为补码的技巧是【尾数】取反再+1","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"0bcc7882-d580-48cd-beaf-47ece1af742b","topic":"注意：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"8e4f6f25-806a-4457-a614-ff5f42708556","topic":"补码中只存在一个 0","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"54a4504e-986e-4d25-90c8-a72e6d5d4bcd","topic":"+0 的补码： 0 0000 000","expanded":true,"children":[{"id":"dc3ef09f-51c1-4a6a-83de-f597e769ba1d","topic":"-0 的补码：【 1 0000 000按位取反再+1 】 \n-> 【0 0000 000】和+0 一致了","expanded":true}]},{"id":"ab1a3251-e2d7-403f-85aa-cc5c3473dfda","topic":"1 0000 000是无法通过原码变化获得的，故规定在整数中表示 -2^n，在小数中表示 -1","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"abda5178-64cd-4b2d-a566-1e2fe453f48b","topic":"原码 -> 补码：（负）按位取反 + 1\n补码 -> 原码：（负）按位取反 + 1","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"64fed95e-2212-4cbd-a235-b3e5d37d4bd9","topic":"为什么：","expanded":true,"hyperlink":"https://blog.csdn.net/m0_37433111/article/details/107938663?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.essearch_pc_relevant&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.essearch_pc_relevant"},{"id":"89f64d11-a650-428e-95cf-c7ea91362011","topic":"按位取反 + 1 的快速做法：从右往左，遇到第一个 1 右边的所有bit不动，把这个1左边的全部数值位bit取反","expanded":true,"style":{"background":"#FF9595"}}]}]}]},{"id":"54d6dcaf-195e-4e7e-b77c-5141f90fd843","topic":"表示范围","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"7217063c-b220-4b40-ae63-57bc05f7f618","topic":"整数","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"ac2b7119-d2af-41bc-b215-2eaa9573217a","topic":"没有 -0 了，负数可以到 -2^n 了","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"35358731-a2cf-481c-8878-89649f89a961","topic":"原码范围：","expanded":true,"children":[{"id":"ff6d77d9-c12c-48d8-a0ed-ca7e0ba841ef","topic":"存在 +0 和 -0，所以正负数对半分","expanded":true,"style":{"background":"#999999"},"formula":{"tex":"-(2^n - 1) \\le x \\le (2^n - 1)","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mo>−</mo><mo stretchy=\"false\">(</mo><msup><mn>2</mn><mi>n</mi></msup><mo>−</mo><mn>1</mn><mo stretchy=\"false\">)</mo><mo>≤</mo><mi>x</mi><mo>≤</mo><mo stretchy=\"false\">(</mo><msup><mn>2</mn><mi>n</mi></msup><mo>−</mo><mn>1</mn><mo stretchy=\"false\">)</mo></mrow><annotation encoding=\"application/x-tex\">-(2^n - 1) \\le x \\le (2^n - 1)</annotation></semantics></math></span>"}}]}],"formula":{"tex":"-2^n \\le x \\le 2^n - 1","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mo>−</mo><msup><mn>2</mn><mi>n</mi></msup><mo>≤</mo><mi>x</mi><mo>≤</mo><msup><mn>2</mn><mi>n</mi></msup><mo>−</mo><mn>1</mn></mrow><annotation encoding=\"application/x-tex\">-2^n \\le x \\le 2^n - 1</annotation></semantics></math></span>"}}]},{"id":"a90d9f8f-b74d-4882-bf79-9a507b002f87","topic":"小数","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"7a46e0e4-0172-426a-a796-d1039fe1e8e8","topic":"没有 -0 了，负数可以到 -1 了","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"17fbc1a7-ab65-4f45-ae02-1bbd0153f0ed","topic":"原码范围：","expanded":true,"children":[{"id":"e3055b90-c07f-4a45-ab6a-2eba3f933e6e","topic":"小数的表示是离散的，正负对半分","expanded":true,"style":{"background":"#999999"},"formula":{"tex":"-(1 - 2^{-n}) \\le x \\le (1 - 2^{-n})","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mo>−</mo><mo stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><msup><mn>2</mn><mrow><mo>−</mo><mi>n</mi></mrow></msup><mo stretchy=\"false\">)</mo><mo>≤</mo><mi>x</mi><mo>≤</mo><mo stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><msup><mn>2</mn><mrow><mo>−</mo><mi>n</mi></mrow></msup><mo stretchy=\"false\">)</mo></mrow><annotation encoding=\"application/x-tex\">-(1 - 2^{-n}) \\le x \\le (1 - 2^{-n})</annotation></semantics></math></span>"}}]}],"formula":{"tex":"-1 \\le x \\le 1 - 2^{-n}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mo>−</mo><mn>1</mn><mo>≤</mo><mi>x</mi><mo>≤</mo><mn>1</mn><mo>−</mo><msup><mn>2</mn><mrow><mo>−</mo><mi>n</mi></mrow></msup></mrow><annotation encoding=\"application/x-tex\">-1 \\le x \\le 1 - 2^{-n}</annotation></semantics></math></span>"}}]}]},{"id":"8b37042f-8fbf-408f-8bc8-aedff4feddf1","topic":"作用","expanded":true,"icons":["star:red"],"style":{"background":"#FDD834"},"children":[{"id":"9d1c7a0f-62b3-4282-81ae-b32a33b05852","topic":"补码相加减的运算是成立的","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"d7604b0c-9747-4844-8510-9c32cebd4ff2","topic":"所以在现代语言(例如C++)中都是采用的补码来表示数","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"d5089b0e-6fff-4150-aea4-0b1a4cf87091","topic":"一切加减法都可以写作两个补码数相加","expanded":true}]},{"id":"b9edf250-0dbf-4024-8ae3-692b1056120c","topic":"举例：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"ca14ab91-ae24-4d51-86b8-24021a3b05a6","topic":"整数","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"f21bf2f6-8b17-4f14-be64-ceea99b2763e","topic":"x1  = +1110","expanded":true,"children":[{"id":"c6393a7b-5d91-48b9-8aa6-38514c50c251","topic":"[x1]补 = 0, 0001110","expanded":true,"children":[{"id":"e6285f51-8b61-4fa6-8d96-9544e943b134","topic":"[x1]原 = 0, 0001110","expanded":true,"style":{"background":"#ADADAD"}}]}]},{"id":"100c3ed5-cb0d-4ecd-858f-978ec6238567","topic":"x2 = -1110","expanded":true,"children":[{"id":"44072b54-4e5f-4eed-b361-c93d239fcadb","topic":"[x2]补 = 1, 1110010","expanded":true,"style":{"background":"#7986CB"},"children":[{"id":"1061a113-8500-46d0-8a20-02ba89b0740a","topic":"[x2]原 = 1, 0001110","expanded":true,"style":{"background":"#ADADAD"}}]}]}]},{"id":"219c8149-663c-429f-8604-e6a6a6aa16cd","topic":"小数","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"6c4f27ad-c8a0-4d29-8676-5787cbd80080","topic":"x1  = +0.1101","expanded":true,"children":[{"id":"8d5c46b3-3806-42a7-8a16-fb999316c921","topic":"[x1]补 = 0.1101000","expanded":true,"children":[{"id":"9606b619-0fb8-4b50-89d7-23dd7369db1a","topic":"[x1]原 = 0.1101000","expanded":true,"style":{"background":"#ADADAD"}}]}]},{"id":"d9f24fd1-f467-49d3-9ee4-d21445bcd9f9","topic":"x2 = -0.1101","expanded":true,"children":[{"id":"835623aa-95e2-415e-9ef1-c6b1a5710934","topic":"[x2]补 = 1.0011000","expanded":true,"style":{"background":"#7986CB"},"children":[{"id":"1009e310-6a5b-4bdd-8df6-97eda1eb6590","topic":"[x2]原 = 1.1101000","expanded":true,"style":{"background":"#ADADAD"}}]}]}]}]}]},{"id":"d023f59c-7512-4c70-9c83-bd40a1f38abd","topic":"移码","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"1119038d-3e26-434f-94e0-462e8d72bba3","topic":"形式","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"51b4e752-5e39-4f69-9660-c4c9179e7033","topic":"移码 = 补码首位取反","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"1029cc62-35d9-4f2e-b06a-5944a975fff1","topic":"表示范围","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"7c06d5a6-3fd2-4813-9042-275c18069b58","topic":"和补码一致","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"f38d174b-d421-4d83-8e85-dd58af40ca86","topic":"作用","expanded":true,"icons":["star:red"],"style":{"background":"#FDD834"},"children":[{"id":"d3353c93-abd0-4833-8956-2e62e3b274c0","topic":"使用移码计算机可以直接通过【按位比较的方式】来比较两个数的大小","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-9803e7b2b8d1ae.png","width":448.03,"height":286.66}}]}]}]}]},{"id":"a24ff2d3-5303-4a9e-9b81-935b2266bf30","topic":"数值表示和差错检测","expanded":true,"style":{"background":"#999999"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-1a9748e57e5a29.svg","width":64,"height":64},"children":[{"id":"b0e477f0-c39d-4107-8686-8ec37b35426d","topic":"校验码","expanded":true,"style":{"background":"#D0D0D0"},"children":[{"id":"966cb859-63a0-4ab7-821a-1395eedf4e76","topic":"不考","expanded":true,"style":{"background":"#D0D0D0"}},{"id":"fdf6ceb1-5646-4316-a03c-18c54f5f875a","topic":"奇偶校验、CRC循环冗余校验、海明码","expanded":true,"style":{"background":"#D0D0D0"}}]},{"id":"b5e49792-50a2-4a53-993e-80c10b380678","topic":"字符与字符串","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"626d0788-e2cc-4fd2-8656-72eed456b1a5","topic":"英文字符","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"9d61c19e-c23a-4f97-83b9-079adaecc72a","topic":"ASCII码","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"0d74fe67-6bc8-40c4-ae97-d475bb183257","topic":"0 ~ 127，只占7bit，通常会补充一个 1bit 凑齐1B","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"6f766ac9-bb1f-4971-a691-dbf48dba9658","topic":"0 ~ 31为控制、通信字符","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"e068c615-4067-4832-ad7b-68d26079aaa5","topic":"例如：6 - ACK、22 - SYN","expanded":true}]},{"id":"aa3b1bc0-229c-4af3-bd19-8377a93097d0","topic":"数字 0 -> 48","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"2bc8dacd-f11f-44c7-a444-6a7895d11e85","topic":"字母 A -> 65","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"64b38b5f-1c8b-4db6-aae3-696629db9b21","topic":"字母 a -> 97","expanded":true,"style":{"background":"#8EDE99"}}]}]}]}]},{"id":"0b4b3992-163d-4a4e-8973-581731812f30","topic":"汉字字符","expanded":true,"style":{"background":"#999999"},"children":[{"id":"4cdf6520-2ae2-451e-8787-50f77e58b779","topic":"GB2312-(19)80","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"687e16c3-6d9f-488a-affd-da30f153acb2","topic":"汉字 + 各种符号一共7445个","expanded":true},{"id":"64b4607e-4e23-474a-8931-3c9ee9ff88c2","topic":"一共16bit来存储，分为区号(8bit) + 位号(8bit)","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"79b21734-d1c5-49b2-aaf3-c61955cc0a83","topic":"图示","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-acd8b0e2890cf0.png","width":294.73,"height":291.2},"children":[{"id":"c1711b0a-99b6-48bd-8ce1-8be9bb8d9fcd","topic":"区位码 = 区号 + 位号","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"5239a455-22f5-425a-8a41-1c6ae12bb579","topic":"国标码 = 区位码 + 2020H","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"969ecfc9-9318-4e10-b7b4-81ca6e0ada83","topic":"因为ASCII码的20H以前的都是通信码，以此来区别，国标码是用于传输","expanded":true}]},{"id":"87106d3a-7bd0-4c50-87ba-d61805de5543","topic":"汉字内码 = 国标码 + 8080H","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"cdd16ea9-7496-45ab-b911-082c238c8bac","topic":"因为ASCII码127，故80H可以把汉字内码和ASCII码区别开来","expanded":true}]}]},{"id":"208241cd-e015-49fa-ac29-4c3f5af2eb4b","topic":"输入一个汉字","expanded":true,"children":[{"id":"bec7ecbb-2da0-40e6-858c-ab29549763f2","topic":"输入拼音，输入法定位到该汉字的国标码","expanded":true},{"id":"a78b0e7a-e844-437f-8022-d08cf93f5405","topic":"系统将国标码转为汉字内码","expanded":true}]},{"id":"bc29dfe2-be7f-4f1f-9bda-a64e57353e40","topic":"输出一个汉字","expanded":true,"children":[{"id":"b0eb9fa2-fafa-4b12-aa26-6def39f4cd11","topic":"输出汉字字形码例如：一个16 x 16的黑白点阵","expanded":true}]}]},{"id":"6e33057c-3dcd-4e04-863d-174c1973e382","topic":"GB18030收录了27484个汉字","expanded":true},{"id":"15ae7def-26e4-45cf-97fa-cfa8a1e0cdb2","topic":"*","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]},{"id":"c33db92d-be98-4898-bcda-2a6e0b1acea5","topic":"字符串的储存","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"05018ba4-d95b-43ee-bf3d-2dd12075ac26","topic":"大端模式","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"713d8284-4285-4df0-98e1-96df89fa863f","topic":"最高有效字节放在低地址部分","expanded":true,"style":{"background":"#FF9595"}},{"id":"4c1f51ca-1d28-4df7-9bb4-bf4508b79c2f","topic":"符合人类阅读习惯","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"d47936d7-73a8-4bbb-b3d8-080fb91e6c9a","topic":"小端模式","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"11859731-b758-4f66-a346-ea4bdf6c49cf","topic":"最高有效字节放在高地址部分","expanded":true,"style":{"background":"#FF9595"}},{"id":"77b800a3-0673-4e59-92ca-c133c6bc5560","topic":"符合机器取值顺序（先取低有效位再取高有效位）","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"018a6468-ac4d-4d26-b976-9f1248e232f8","topic":"记忆口诀：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"a08cff00-2072-4771-8955-61cfab4b4607","topic":"大人小机","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"6a22e119-aa90-406d-9f8a-75bc3edf0322","topic":"Intel唯一在追求小端，【与OS无关】，与硬件制造厂商的选择有关","expanded":true,"style":{"background":"#FFABD5"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-81036c16173d6e.png","width":433,"height":80}}]}]},{"id":"8fa43697-9ef0-47fe-92f6-f97779cc2450","topic":"被删除","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]},{"id":"8fb0bd7c-9757-4f4b-aaf7-5ba039d02579","topic":"运算电路和方法","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-af719faaedece9.svg","width":64,"height":64},"children":[{"id":"4216cb54-7436-4b10-8fb6-632ac88a1b33","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"fe5eb8f1-ebc1-4feb-b683-e78c3c5a50e7","topic":"18（标志位）、20大（ALU）","expanded":true}]},{"id":"027dc743-a753-48a8-8be5-3f93fcf39db5","topic":"（补充）门电路和摩根定律","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"aee430ff-9485-4959-a185-c60ba23a13f0","topic":"图示","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-ffb606858cef5c.png","width":374.13,"height":246.08},"children":[{"id":"07af24d1-725a-4a25-aeab-146d0a0a8bab","topic":"图示","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-ddc324aa1c3a39.png","width":235.2,"height":245.71}}]}]},{"id":"5cf08fa4-256b-4b93-aef4-51fb31c418d0","topic":"一位全加器","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"2e782d27-6869-4925-9b02-bac71b73a769","topic":"图示","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-e4395d4a4bb0a3.png","width":536.23,"height":269.28},"children":[{"id":"aab89d09-d5c8-4416-bd02-5dd23c05209d","topic":"逻辑符号（简化）","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-7fcb35c037fd78.png","width":176.37,"height":122.98},"children":[{"id":"cb90e52f-820e-47b3-bb18-b73f58bc44dd","topic":"结构","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"7fa4fbae-e4fd-441a-a914-8d47ced7f22c","topic":"三个输入","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"cc8b0fcb-1a1f-4f7d-bde9-0a337f5488d7","topic":"Ai","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"d2706ef3-b84d-4486-ba4c-fa3c90e69390","topic":"第一个加数","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"b5b2c4b6-7a19-423f-9609-2b4a976931b8","topic":"Bi","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"bd354420-37b7-4935-b5f6-cf659cb3fec9","topic":"第二个加数","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"92f77f96-1383-4299-be01-0f3f2ef04a40","topic":"C(i-1)","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"4933baad-7baf-4610-bfcb-36037c11c929","topic":"上一次运算后传入的进位数","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"f6117f9b-d3fa-45c0-b26d-16bba3c3e655","topic":"两个输出","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"351bf8e9-d92d-4578-a720-5a16a99de70f","topic":"Ci","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"5de3b3a2-e0ca-40dd-9abb-8eadf77cb7ed","topic":"本次运算后的进位数","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"e1a38931-fb43-43a1-9d4f-6528559c73e0","topic":"Si","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"9128417f-42d1-411f-b6e6-459502e1a766","topic":"本次运算的结果","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"2099030a-7a76-4355-81b5-fb321e855af4","topic":"计算公式","expanded":true,"style":{"background":"#8EDE99"},"formula":{"tex":"\\begin{aligned} S_i &= A_i \\oplus B_i \\oplus C_{i-1} \\\\ C_i &= A_i B_i + (A_i \\oplus B_i) C_{i-1} \\end{aligned}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mtable rowspacing=\"0.25em\" columnalign=\"right left\" columnspacing=\"0em\"><mtr><mtd><mstyle scriptlevel=\"0\" displaystyle=\"true\"><msub><mi>S</mi><mi>i</mi></msub></mstyle></mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"true\"><mrow><mrow></mrow><mo>=</mo><msub><mi>A</mi><mi>i</mi></msub><mo>⊕</mo><msub><mi>B</mi><mi>i</mi></msub><mo>⊕</mo><msub><mi>C</mi><mrow><mi>i</mi><mo>−</mo><mn>1</mn></mrow></msub></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel=\"0\" displaystyle=\"true\"><msub><mi>C</mi><mi>i</mi></msub></mstyle></mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"true\"><mrow><mrow></mrow><mo>=</mo><msub><mi>A</mi><mi>i</mi></msub><msub><mi>B</mi><mi>i</mi></msub><mo>+</mo><mo stretchy=\"false\">(</mo><msub><mi>A</mi><mi>i</mi></msub><mo>⊕</mo><msub><mi>B</mi><mi>i</mi></msub><mo stretchy=\"false\">)</mo><msub><mi>C</mi><mrow><mi>i</mi><mo>−</mo><mn>1</mn></mrow></msub></mrow></mstyle></mtd></mtr></mtable><annotation encoding=\"application/x-tex\">\\begin{aligned} S_i &amp;= A_i \\oplus B_i \\oplus C_{i-1} \\\\ C_i &amp;= A_i B_i + (A_i \\oplus B_i) C_{i-1} \\end{aligned}</annotation></semantics></math></span>"}}]}]}]}]},{"id":"408ed437-c0da-4a5d-a9ed-84db1f125d5a","topic":"串行加法器","expanded":true,"style":{"background":"#D0D0D0"},"children":[{"id":"3954c627-c356-4b62-aab3-994a5a068b8e","topic":"串行加法器：循环使用一位全加器","expanded":true,"style":{"background":"#D0D0D0"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-2684d7510423ad.png","width":293.79,"height":197.36},"children":[{"id":"f3ef3dc5-6d49-4dda-b1b2-46b6dedd9add","topic":"如果操作数长n位，加法就要分n次进行，每次产生一位和，并且串行逐位地送回寄存器。","expanded":true},{"id":"b168b064-4d18-4f7d-ac02-d66ca2b2ef00","topic":"问题：每一位的运算必须基于上一次的运算才能进行，非常浪费时间","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"baf07bce-86d7-4d88-984b-645d104c545b","topic":"串行进位加法器","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"e60d1bb3-dbc7-41ff-9033-55509898f6c7","topic":"把多个全加器串在一起，和串行加法器问题一致，速度一样的慢","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-6da80d5fa49e8a.png","width":283.23,"height":108.13},"children":[{"id":"7251d02c-8f0a-4197-a208-65cb5cf1ef08","topic":"串行进位的并行加法器：把n个全加器串接起来，就可进行两个n位数的相加。","expanded":true},{"id":"3100a901-3e9b-46bd-9df0-83de33f5f8c6","topic":"串行进位又称为行波进位，每一级进位直接依赖于前一级的进位，即进位信号是【逐级形成】。","expanded":true}]}]},{"id":"068c3e6f-52ee-4e1b-8f80-8a5db467b865","topic":"并行进位加法器","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"76e824dc-7012-4838-bb62-f04928f9cefa","topic":"理论依据","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"271936c8-7c31-4f5b-aed2-0f65d946cf32","topic":"相互间的进位没有依赖关系，只要同时到达，可以同时生成C1~C3","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-33186cff6f5fea.png","width":451.04,"height":105.28},"children":[{"id":"a9ec2f34-79ef-4a9c-9c1d-2d0b5b4586cb","topic":"先行进位、超前进位","expanded":true}]}]},{"id":"d74768f5-df90-4bde-a459-c90360e34b79","topic":"四位CLA部件/CLA电路","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"69b7e302-1603-4832-9dd8-5ca6404b2224","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-d430053aa7ce5e.png","width":452.56,"height":207.14}}]},{"id":"af5c2996-a48e-4e21-b619-042d7d2e00af","topic":"四位全先行进位加法器","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"7ca82f9c-0e75-4bc4-b6c3-d5d454fcb2cb","topic":"图示","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-d865bc6dcedf9c.png","width":462.47,"height":165.64},"children":[{"id":"a2c80581-902b-4e32-957c-3205153c7838","topic":"简化","expanded":true,"children":[{"id":"d3fadb99-cfd8-485c-86c2-4db90cd7363d","topic":"把几(4)个加法器串在一起，这样可以并发的计算4bit的数据","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-7189b29a588934.png","width":203.52,"height":207.99}}]}]}]}]},{"id":"346cd84a-ffe9-4b77-8d7d-34e40c6cd9ff","topic":"多级并行进位加法器","expanded":true,"style":{"background":"#EEEEEE"},"children":[{"id":"195aa876-1797-4cb5-9961-c3f54e0a47ca","topic":"图示","expanded":true,"style":{"background":"#EEEEEE"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-2d9d341115ba75.png","width":541.91,"height":366.18}}]},{"id":"662403d9-90a7-4ebc-af74-988b79f32a4c","topic":"带标记加法器","expanded":true,"children":[{"id":"98c4e5dc-e33a-492a-8821-93739af34333","topic":"标志位的生成","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"15e37adb-9d68-4a96-ae53-3897eaa9ad78","topic":"PSW用来存放两类信息：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"a2785716-d37c-4974-8abc-8088829a9ab6","topic":"一类是体现当前指令执行结果的各种状态信息，称为状态标志，如有无借位进位（CF位）、有无溢出（OF位）、结果正负（SF位）、结果是否为零（ZF位）、奇偶标志位（PF位）等；","expanded":true,"children":[{"id":"f55a38ee-45bc-43e4-8ef2-943280e5660a","topic":"另一类是存放控制信息，称为控制状态，如允许中断(IF位)，跟踪标志（TF位），方向标志(DF)等。有些机器中将PSW称为标志寄存器FR（Flag Register）。","expanded":true}]}]}]},{"id":"b98ec153-279d-4845-b162-ca3918c68156","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-79c03f8ef8e680.png","width":253.3,"height":247.87},"children":[{"id":"b3a75704-6a32-4ed3-aa28-f85b3c843ae3","topic":"ZF：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"5721ad00-860b-40b5-a07c-e360f8548e72","topic":"F输出全为0，ZF = 1","expanded":true,"style":{"background":"#FF9595"},"formula":{"tex":"ZF = \\overline{F_n + \\cdots + F_2 + F_1}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>Z</mi><mi>F</mi><mo>=</mo><mover accent=\"true\"><mrow><msub><mi>F</mi><mi>n</mi></msub><mo>+</mo><mo>⋯</mo><mo>+</mo><msub><mi>F</mi><mn>2</mn></msub><mo>+</mo><msub><mi>F</mi><mn>1</mn></msub></mrow><mo stretchy=\"true\">‾</mo></mover></mrow><annotation encoding=\"application/x-tex\">ZF = \\overline{F_n + \\cdots + F_2 + F_1}</annotation></semantics></math></span>"}}]},{"id":"ffffa3b4-28d0-4f78-a8a1-1370e1fc25d4","topic":"OF：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"392bf522-787c-4456-9001-f6b769a62e03","topic":"溢出位，是给【有符号数】用的，有符号数溢出则OF = 1，不溢出 OF = 0","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"a804bfc0-aff1-4e06-99a3-af4dbc07b7ba","topic":"最高位进位 ⊕ 次高位进位","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"70989e44-2fb0-4dc7-81a6-88dfb37a74aa","topic":"符号位发生了改变就说明溢出","expanded":true}],"formula":{"tex":"OF = C_n \\oplus C_{n-1}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>O</mi><mi>F</mi><mo>=</mo><msub><mi>C</mi><mi>n</mi></msub><mo>⊕</mo><msub><mi>C</mi><mrow><mi>n</mi><mo>−</mo><mn>1</mn></mrow></msub></mrow><annotation encoding=\"application/x-tex\">OF = C_n \\oplus C_{n-1}</annotation></semantics></math></span>"}}]},{"id":"fb43874e-8a9c-4bcb-a831-a45f5384f457","topic":"SF：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"34b239e4-79a5-4fe7-8448-6ed75dbd7226","topic":"给【有符号数】的，正数为0，负数为1","expanded":true,"style":{"background":"#FF9595"},"formula":{"tex":"SF = F_n","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>S</mi><mi>F</mi><mo>=</mo><msub><mi>F</mi><mi>n</mi></msub></mrow><annotation encoding=\"application/x-tex\">SF = F_n</annotation></semantics></math></span>"}}]},{"id":"97fbd5bf-38c5-4faa-bfb9-308d1c47c0d8","topic":"CF：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"a47825c2-fd05-465d-82c5-134c4696381b","topic":"进位位，是给【无符号数】用的，运算进位了CF = 1，否则 CF = 0","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"716c66b4-ca0d-40fc-8914-f1dfd2b5f883","topic":"加法运算Cin = 0，Cout = 1说明出现了进位","expanded":true,"icons":["priority:1"]},{"id":"eb014843-eb7a-4f9d-8587-65cd3789b16f","topic":"减法运算Cin = 1，Cout = 0说明出现了借位，就是A比B小","expanded":true,"icons":["priority:2"]}],"formula":{"tex":"CF = C_{out} \\oplus C_{in}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>C</mi><mi>F</mi><mo>=</mo><msub><mi>C</mi><mrow><mi>o</mi><mi>u</mi><mi>t</mi></mrow></msub><mo>⊕</mo><msub><mi>C</mi><mrow><mi>i</mi><mi>n</mi></mrow></msub></mrow><annotation encoding=\"application/x-tex\">CF = C_{out} \\oplus C_{in}</annotation></semantics></math></span>"}}]}]},{"id":"803b63b3-8db0-46bd-8ab2-3573e8e00c68","topic":"带标记加法器逻辑电路","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"958a6495-1acc-48e2-91f4-37d1ca069e62","topic":"图示","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-979f1474da7697.png","width":475.44,"height":258.93},"children":[{"id":"2b1a472a-6f5e-4cec-a3b2-702f89c4413a","topic":"Cn和Cout一样","expanded":true}]}]}]},{"id":"064403db-167a-471d-b73f-0b0c8c6ecd01","topic":"多路选择器、三态门","expanded":true,"children":[{"id":"81f9a684-967c-4e56-8a08-f54ccb645f94","topic":"多路选择器","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-f290b253ab5833.png","width":1814,"height":1222},"children":[{"id":"77e513a2-4961-43a5-bf16-027f32dc78b5","topic":"k个输入，m要求","expanded":true,"children":[{"id":"eaa0f3bc-52a5-4912-8b78-cccc8255fb36","topic":"一位ALU的结构（有三种操作）","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-656b1a946bb4ce.png","width":308.18,"height":194.88}}],"formula":{"tex":"m \\ge \\lceil \\log_2 k \\rceil\\,\\text{bit}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>m</mi><mo>≥</mo><mo stretchy=\"false\">⌈</mo><msub><mrow><mi>log</mi><mo>⁡</mo></mrow><mn>2</mn></msub><mi>k</mi><mo stretchy=\"false\">⌉</mo><mtext> </mtext><mtext>bit</mtext></mrow><annotation encoding=\"application/x-tex\">m \\ge \\lceil \\log_2 k \\rceil\\,\\text{bit}</annotation></semantics></math></span>"}}]},{"id":"f47e5362-4724-471c-bc21-cefb90c62d02","topic":"三态门","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-12223f123186bd.png","width":1602,"height":1488}}]},{"id":"d21ecd9a-17f6-45e3-bc66-f2e354c178df","topic":"ALU为组合逻辑电路","expanded":true,"children":[{"id":"96c09b18-0959-43d2-abe7-8f732dd2d612","topic":"组合逻辑电路：没有存储单元只包含了电路。\n时序逻辑电路：既有电路又有存储单元","expanded":true,"style":{"background":"#8EDE99"}},{"id":"60d1be1f-f79b-4711-a936-249d6ef1aee2","topic":"ALU的基本结构","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-b57100baca41f1.png","width":271.3,"height":211.64}}]},{"id":"73ef84ff-3d93-42d9-b686-576037818e9a","topic":"运算器的组成部分","expanded":true,"children":[{"id":"c9342d4c-3b1d-4d94-9544-f3e1dc13b66a","topic":"ALU","expanded":true},{"id":"e59c3b7c-5579-44fe-ad41-c192f1bb5ae9","topic":"总线","expanded":true},{"id":"106825f6-9f56-45bc-afc8-e105b714d86d","topic":"状态寄存器","expanded":true,"children":[{"id":"721456fb-159c-47a2-ba24-3d0ca700359f","topic":"存储进位信息","expanded":true}]}]}]},{"id":"38d338e0-9183-4a5c-9b44-7b9fde15c1fb","topic":"定点数的移位运算","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-2dbe0fdaf450fc.svg","width":60,"height":61},"children":[{"id":"17e20605-b45a-45d9-a53c-3fbd85b3e952","topic":"逻辑运算","expanded":true,"children":[{"id":"04f2c06d-5a88-4756-82aa-fbcd4d917dd7","topic":"与、或、非三大基本运算","expanded":true}]},{"id":"d3810e7b-f11a-4b1f-b549-e1a687683ed7","topic":"逻辑移位","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"b695ba39-fd41-415b-93e4-de2204ab41ab","topic":"不管数的类型，一律添 0","expanded":true,"style":{"background":"#8EDE99"}},{"id":"4d78cf3f-df9a-4263-8f84-c7e8fbd3c371","topic":"作用：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"abea657c-4dcc-4258-a6a0-dda4b0694edd","topic":"用于拆分和定位一个二进制中对应区间bit的数值，例如可以通过逻辑移位获得24bit RGB二进制数的R、G、B分别的数值","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"1df30865-eed5-4c2f-9c43-ca6e7e87048b","topic":"算术移位","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"1b716ff7-d08b-456b-8f15-e81c9102cc09","topic":"原码","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"c476f926-4d98-4bc9-9a2a-115526fb519e","topic":"正数负数，一律添 0","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"7d96b784-eed7-45fa-9218-05ba508d1d79","topic":"反码","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"74c98cf1-2834-4811-a167-d53e2ec1460f","topic":"正数全 0，负数全 1","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"cd4f0376-f053-494a-9805-5cb2e28a7c5f","topic":"补码","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"603a962c-a94e-4c81-9f4f-3699f66e8f0b","topic":"正数全 0，负数左 1 右 0","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"c35ff896-54e2-4445-9812-2b75845d315e","topic":"算术移位的精度：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"17f70788-42c9-4a6b-88ef-7243dec1392d","topic":"往右移动会丢失精度","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"64075c72-e131-4f74-bf8c-46d8118d6fbc","topic":"例：0011(3) 右移一次 0001(1)，而 3 ÷ 2 = 1.5","expanded":true}]},{"id":"e25bd50b-c973-489b-b34a-596ccfb2bc84","topic":"往左移动可能出现严重误差","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"bbccfc4e-d8a0-4f1d-a9a0-3f8036e65a5e","topic":"例： 1000(-8)  左移一次 0000 (0), 出现严重误差","expanded":true}]}]},{"id":"1e998202-24e1-4017-b1b4-1deee0249d9f","topic":"作用：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"3c55aa2d-7c53-4845-8adc-84fd14382cbd","topic":"算术位移可以模拟乘法运算","expanded":true,"style":{"background":"#FDD834"},"formula":{"tex":"\\begin{aligned} -2 \\times 7 &= 1111\\,1110 \\times 0000\\,0111 \\\\ &\\to -2\\text{左移}0\\text{次}(\\times 1)\\text{、}1\\text{次}(\\times 2)\\text{、}2\\text{次}(\\times 4)\\text{再相加} \\\\ \\text{即 } & 1111\\,1110 + 1111\\,1100 + 1111\\,1000 \\\\ &= 1111\\,1010 + 1111\\,1000 = 1111\\,0010 = -14 \\end{aligned}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mtable rowspacing=\"0.25em\" columnalign=\"right left\" columnspacing=\"0em\"><mtr><mtd><mstyle scriptlevel=\"0\" displaystyle=\"true\"><mrow><mo>−</mo><mn>2</mn><mo>×</mo><mn>7</mn></mrow></mstyle></mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"true\"><mrow><mrow></mrow><mo>=</mo><mn>1111</mn><mtext> </mtext><mn>1110</mn><mo>×</mo><mn>0000</mn><mtext> </mtext><mn>0111</mn></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel=\"0\" displaystyle=\"true\"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"true\"><mrow><mrow></mrow><mo>→</mo><mo>−</mo><mn>2</mn><mtext>左移</mtext><mn>0</mn><mtext>次</mtext><mo stretchy=\"false\">(</mo><mo>×</mo><mn>1</mn><mo stretchy=\"false\">)</mo><mtext>、</mtext><mn>1</mn><mtext>次</mtext><mo stretchy=\"false\">(</mo><mo>×</mo><mn>2</mn><mo stretchy=\"false\">)</mo><mtext>、</mtext><mn>2</mn><mtext>次</mtext><mo stretchy=\"false\">(</mo><mo>×</mo><mn>4</mn><mo stretchy=\"false\">)</mo><mtext>再相加</mtext></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel=\"0\" displaystyle=\"true\"><mtext>即 </mtext></mstyle></mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"true\"><mrow><mrow></mrow><mn>1111</mn><mtext> </mtext><mn>1110</mn><mo>+</mo><mn>1111</mn><mtext> </mtext><mn>1100</mn><mo>+</mo><mn>1111</mn><mtext> </mtext><mn>1000</mn></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel=\"0\" displaystyle=\"true\"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"true\"><mrow><mrow></mrow><mo>=</mo><mn>1111</mn><mtext> </mtext><mn>1010</mn><mo>+</mo><mn>1111</mn><mtext> </mtext><mn>1000</mn><mo>=</mo><mn>1111</mn><mtext> </mtext><mn>0010</mn><mo>=</mo><mo>−</mo><mn>14</mn></mrow></mstyle></mtd></mtr></mtable><annotation encoding=\"application/x-tex\">\\begin{aligned} -2 \\times 7 &amp;= 1111\\,1110 \\times 0000\\,0111 \\\\ &amp;\\to -2\\text{左移}0\\text{次}(\\times 1)\\text{、}1\\text{次}(\\times 2)\\text{、}2\\text{次}(\\times 4)\\text{再相加} \\\\ \\text{即 } &amp; 1111\\,1110 + 1111\\,1100 + 1111\\,1000 \\\\ &amp;= 1111\\,1010 + 1111\\,1000 = 1111\\,0010 = -14 \\end{aligned}</annotation></semantics></math></span>"}}]}]},{"id":"e62fbb8b-9696-48cf-b30b-4d315536ed2a","topic":"循环移位","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"518b9b03-9984-4ff8-be20-9a0b1e932eec","topic":"带进制位和不带进制位","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-36f6e0e2827eff.png","width":535.69,"height":212.84},"children":[{"id":"856a616a-5277-4955-b6a0-59f925a11ea0","topic":"CF中不是0就是1","expanded":true},{"id":"041a658d-d96a-49e4-b453-4ff193ad7466","topic":"带进位位：大循环","expanded":true},{"id":"409260aa-2b47-42e5-bc51-fee45e5a56f7","topic":"不带进位位：小循环","expanded":true}]}]},{"id":"c6fc27b8-83c9-43ff-8a05-e539e15a934f","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"9e947302-1bea-4c9e-88b0-d801254a247c","topic":"18","expanded":true}]}]},{"id":"c0910a43-e26f-4661-86bf-72fae30e958a","topic":"定点数的加减法","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-ad5da923dd36e9.svg","width":64,"height":64},"children":[{"id":"27d0ae53-c00f-4947-8441-e88824db60cb","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"b0e7d222-873d-4c83-adf1-8727e3a86418","topic":"（10、13、14、18）溢出","expanded":true}]},{"id":"d8566e2e-477a-4f5a-a495-15a86e817456","topic":"【加减法】","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"91e2ee15-7b3c-4e01-85e4-eca341443bbd","topic":"运算规则：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"8a278aa4-5ce3-44dd-b217-ac53d84dc12a","topic":"1. 使用补码来进行加法，符号位参与运算","expanded":true,"style":{"background":"#FDD834"}},{"id":"8cddf12e-9017-49fc-a9ef-ec3963e92584","topic":"2. 如果是 A - B，改为补码形式的 A + (-B)来进行计算","expanded":true}]},{"id":"68a52c38-e1b4-43f1-8d45-d05a586ac4bc","topic":"运算电路：","expanded":true,"children":[{"id":"bcbbf27c-8e33-4e5d-a01b-67c9c1260050","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-c904426616e73b.png","width":443.8,"height":244.43},"children":[{"id":"d17cff5a-2bc6-4a58-8d73-13bb9098bc77","topic":"ZF、OF、SF、CF的意义","expanded":true,"children":[{"id":"f5783643-5958-4f86-b156-bb40ac500029","topic":"zero flag，overflow flag，signal flag，carry flag","expanded":true}]}]}]},{"id":"8e79fade-2362-4e53-82bc-e2e15e406936","topic":"溢出判断：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"a40fd1ac-9228-4097-aa96-cbeef5efcdb0","topic":"正负溢出","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"20543a81-c7cd-48bb-a459-83308817c287","topic":"正 + 正","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"85f6624e-cad6-4823-99b5-d5482b5ff998","topic":"可能导致正溢出","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"e971028d-3c26-49b7-86d6-df63ae1feab2","topic":"负 + 负","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"1f1ff587-e8a2-4c0e-8367-6f42e6b865e9","topic":"可能导致负溢出","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"a158b971-ed57-4d1e-b890-8439ab28a11e","topic":"正负相加","expanded":true,"children":[{"id":"afdef37c-bba6-4207-9e52-942f585a810f","topic":"一定没有溢出","expanded":true}]}]},{"id":"559c9dcc-3f09-4ca4-a294-3b227cb2a74a","topic":"溢出的含义：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"b28503d3-411b-4c19-9e7e-5c209921bb07","topic":"原码、反码、补码计算器","expanded":true,"hyperlink":"https://chenwenhang.github.io/code-switch/"},{"id":"2324f7f7-7072-4485-b88c-7f537e991e1a","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-b5f34fbaca3376.png","width":388.92,"height":192.45}}]},{"id":"8b6d247e-8a92-49ef-8232-873b1062c4ed","topic":"检测手段","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"a466d9ee-b3cf-4f5c-bd3d-f0647129808d","topic":"单符号位","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"72c990a7-06bd-4d1a-90d7-1f061cb84a01","topic":"计算出结果后进行检测，可以检测出异常","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-90a8036b947577.png","width":411.83,"height":244.21},"children":[{"id":"d3b439c1-7399-40a0-80c0-7f6f5d68ac64","topic":"无法检测是正溢出还是负溢出","expanded":true}]}]},{"id":"2c5210f4-6678-429c-9598-840e26475f56","topic":"符号位 + 进制位","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"c2645188-20ec-43b2-bc66-8f6a219ea155","topic":"( 正溢出 -> 0,1 ) ；( 负溢出 -> 1,0 )","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-7887b4e46f875f.png","width":390.27,"height":234.71}}]},{"id":"4b952ba2-a9c0-43ae-8077-c065ee860925","topic":"双符号位","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"07fb4b06-e22d-45df-b7bf-5ab654e63762","topic":"( 正溢出 -> 0,1 ) ；( 负溢出 -> 1,0 )","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-5f30809f4ef5e3.png","width":407,"height":217.84},"children":[{"id":"8b1129ea-73d1-4703-9ba4-8950a3d274fd","topic":"存储的时候是单符号位，运算时扩展成了双符号位。","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"ee405127-bd84-4873-be7d-17f68eb272b4","topic":"拓展","expanded":true,"children":[{"id":"18850ad8-10ba-45e3-84c5-141ec5c12f29","topic":"双符号位补码：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"ca8e4e70-1dbf-48e4-9591-12fd1bdc26a4","topic":"模4补码","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"d0f44d88-978b-486b-89ef-ed8d2860ad4f","topic":"单符号位补码：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"30620239-1ee6-4a27-8f89-7a88aea3bf76","topic":"模2补码","expanded":true,"style":{"background":"#FDD834"}}]}]}]},{"id":"d866f829-57c6-4a04-8567-8a741470f425","topic":"解决办法","expanded":true,"children":[{"id":"a4d853c9-cba0-4c4c-8bf8-96a278e87f73","topic":"通过符号扩展来进行溢出控制，例如 int (4B) -> long(8B)，扩展方法和算术位移一致","expanded":true}]}]}]},{"id":"edd68350-8f7e-4910-804d-e119891f25f1","topic":"【乘法运算】","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"11c4e63e-66c0-43b6-b0f9-0596727eb551","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-42b7da0f2dc8dc.png","width":608,"height":752},"children":[{"id":"342ea0e0-2973-422b-9617-f971325122f1","topic":"ACC：乘积高位","expanded":true,"style":{"background":"#FDD834"}},{"id":"e93614a9-bf57-434a-ae4d-2a618e6e8e71","topic":"MQ：乘数、乘积低位","expanded":true,"style":{"background":"#FDD834"}},{"id":"32d6559f-5359-4603-8412-2461f0df77c9","topic":"X：被乘数","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"761a19e7-cb99-4387-bf07-01f24b494831","topic":"X * MQ","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"8cd5616b-f0dd-4606-a676-5f1db7a9b536","topic":"X是被乘数，MQ是乘数","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"8c2968c3-7bee-4cc4-a27a-c7fe121a36a7","topic":"前放X，后放MQ","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"188f4a2b-a13d-459e-a068-d55dc93b2864","topic":"（X*Y）","expanded":true,"style":{"background":"#BA69C8"}}]}]}]},{"id":"940912c1-47b2-4efd-be87-a2f228b161e4","topic":"【原码乘法】\n符号另算。多次累加，通过MQ最后一位来判断是否让ACC加X，每次都让右移，最后结果ACC为高位，MQ为低位","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"6dd48623-0fcb-4c80-b52d-ac1aa2115a1a","topic":"硬件构成","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"6e307ae0-9af0-4e7c-b904-c62596bec7ec","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-b6da1188842f76.png","width":476.3,"height":209.91},"children":[{"id":"b4350245-50d8-48c1-84d2-51f4bd70cb64","topic":"ACC有n+1位，MQ也有n+1位","expanded":true}]}]},{"id":"f8d613a9-d4f7-4b59-a714-7184d09849be","topic":"加法规则：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"a52bb5c2-9a8c-4aa9-966d-ad1f82cd2aff","topic":"MQ的最低位为0，则ACC = ACC + 0","expanded":true,"style":{"background":"#FDD834"}},{"id":"bbd42453-ff79-4a93-8ee4-14633d59da30","topic":"MQ的最低位为1，则ACC = ACC + X","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"f7a79ac2-3df3-4730-ae0e-feb1eadecb15","topic":"移位规则：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"c9202677-daeb-4d39-bbc7-513cfe372025","topic":"统一采用逻辑移位（只补0）","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"c2dce210-47be-45fd-816c-8813df69241c","topic":"因为是原码，所以逻辑算术移位没区别","expanded":true}]}]},{"id":"4e330fde-f321-4647-acd8-650d32205483","topic":"运算流程：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"8b4af1f5-f94e-4fa9-b65c-0af608a0b01b","topic":"已知运算 x * y，x为负，y为正","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"16874a96-5db1-4d77-a884-2880e8685ab3","topic":"其中x和y的符号位为一位，数值位为n位","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"57d94bd6-0ba9-4551-8c36-54974344b3ca","topic":"0. 确定最终符号位为 1，把【x的符号改为0】","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"73e06691-9bce-4e50-a289-5503a53a8dc4","topic":"符号位的计算：对两个数的符号位进行异或运算即可","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"5629266d-a94c-4952-9331-d048919f5eeb","topic":"1. 把x存入X寄存器中，把y存入到MQ寄存器中，清空ACC","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"17cdd378-6179-4420-b939-3de7608f64c8","topic":"此时，MQ的最低位就应该是被乘数X应该进行操作","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"5cec4649-6df7-489e-b0dc-06934b29223f","topic":"2. 进行加法，进行移位","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"f6f3decc-8abc-43ab-81aa-9f3f94fdf79d","topic":"此时的右移有两个作用：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"d7392b9e-5fba-4c7c-a7b9-87921f1fff18","topic":"A. 使得MQ的最低位指明了下一次需要进行操作 \nB. 下次一次的加法是和上一次的结果“错位”相加","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"841222d0-0cb0-453a-8192-d277e988c2cc","topic":"3. 重复 1~2 的步骤 n 次。\n最后的结果就是(ACC, MQ)中，其中MQ的最末位舍弃，ACC的第一位改为符号位","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"9f6a6ef4-ed06-4242-af2c-7b2c833ffaf6","topic":"ACC的全部 + MQ的前n位","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"1e410115-1d1d-4daf-b1c9-a8508294fa7f","topic":"x * y 最后的结果最多为 2n 位，MQ和ACC都是n+1位寄存器，MQ的最末位舍去","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"a86185c0-1c3d-41a0-98bb-ca283ebb6ccf","topic":"采用的是原码一位乘法，还有二位乘法，不拓展了","expanded":true,"style":{"background":"#D0D0D0"}},{"id":"83e7abdf-6d85-4244-a38d-481f3e19bddf","topic":"n次位移，n次运算","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]},{"id":"049cbabf-46e7-470c-8f76-24de2d86b57c","topic":"【补码乘法】\n符号参与运算，双符号位，MQ多一个辅助位，ACC是+/- X或者不变看MQ后两位之差，然后位移。【最后还有一次加法】","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"caf54522-91c7-4f95-b0c3-48a3059c9d9b","topic":"硬件构成","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"07b4bb25-fa93-4e46-b823-1f47abe8eccd","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-94f50caea260c4.png","width":598.12,"height":287.67},"children":[{"id":"a8ad99d5-bb15-4cec-9d80-183e13db16bd","topic":"MQ为 n+2 位（因为多了一位辅助位）","expanded":true},{"id":"58209d41-7cb5-4948-a50c-ba3fa262cf72","topic":"同样ACC和X都是n+2位（因为CPU要保证寄存器长度一致），那么就可以采用双符号位了","expanded":true}]}]},{"id":"4ac3f688-08e1-4c56-b3cb-c1aca0a50373","topic":"加法规则：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"9a7deff1-aea0-41d7-b759-ffeda0afe2c0","topic":"根据MQ的最低位和MQ的辅助位（在硬件中MQ的最低位为MQ的倒数第二位，辅助位为MQ的倒数第一位）","expanded":true,"style":{"background":"#FF9595"}},{"id":"544ee1fc-24d8-4733-bc30-615cd7aeb410","topic":"辅助位 - 最低位 = 1 ， ACC = ACC + x","expanded":true,"style":{"background":"#FDD834"}},{"id":"59e774c3-0c96-4791-90da-384df71ccc3e","topic":"辅助位 - 最低位 = 0 ， ACC = ACC + 0","expanded":true,"style":{"background":"#FDD834"}},{"id":"52c8d0e7-6b38-4232-b645-b6ef60e7cce8","topic":"辅助位 - 最低位 = -1， ACC = ACC + (-x)","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"49b13851-0ba9-4cd2-8b63-4a191607d178","topic":"x的补码到-x的补码是由另外的辅助电路完成的","expanded":true}]}]},{"id":"d2873acc-e401-4dd5-909c-14fb5c97349b","topic":"移位规则：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"1231b4fb-2592-4176-b545-26566b703a0f","topic":"采用算术移位","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"408ac95b-1621-44f8-a88a-411a7f459044","topic":"正的补0，负的补 1","expanded":true,"style":{"background":"#FDD834"}}]}]},{"id":"61771e3f-2264-4a06-b536-304ebd629cd9","topic":"运算流程：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"ae41f865-1e00-4358-9bf3-aabfac55465e","topic":"已知运算 x * y，x为负，y为正","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"bc09f047-7800-4961-b894-a3576d7e66f9","topic":"其中x和y的符号位为一位，数值位为n位","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"d24a8f03-3489-4682-bd6c-4be0e2d077ea","topic":"1. x扩展为双符号直接存入X，y不扩展符号存入MQ中，清空ACC（MQ辅助位初始为0）","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"1caedf8f-f44e-471a-83b4-22f4ba6a8d9d","topic":"2. 根据加法和移位的规则进行加法运算","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"2b9e8629-f176-4817-aea9-05adbe050833","topic":"3. 重复 1~2 的步骤n次","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"5f6b8251-fdfc-45e7-a2d3-d5605b253f28","topic":"4. 对3的结果再进行一次加法运算","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"d5307d38-4f45-4d7a-b46c-f4a21d648803","topic":"5. 最后的结果就是(ACC, MQ)","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"e587a556-4089-4da3-a353-b18f2e57a066","topic":"ACC的全部 + MQ的前n位","expanded":true}]}]},{"id":"fa44e42c-a856-4b11-bd06-ecbd40758a66","topic":"n次位移，n+1次运算","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]},{"id":"51f9bcf7-6fa7-4353-8bcb-239bcc5cec8f","topic":"整数运算和小数运算的符号位位置相同","expanded":true,"children":[{"id":"400668fc-858a-42ca-b57f-d74c449987b0","topic":"但是整数运算的小数位在MQ的第n位上，小数运算的小数点在第1/2位上(看是原码还是补码）","expanded":true}]},{"id":"2b270dc1-e0d9-42d5-a31a-9bfd355b63cb","topic":"原补码乘法，区别在于原码只需看MQ最后一位，补码需要看MQ的辅助位和最后一位","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]},{"id":"ff567a5c-810d-4204-ac3a-b0e653222f8f","topic":"乘法电路","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"8d339679-f1de-4609-b562-98276c7ae660","topic":"无符号数","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"4004a584-7200-45f8-827e-b558e55c9b3f","topic":"图示","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-db60e8d6cc26b9.png","width":572.32,"height":279.9},"children":[{"id":"507949a9-26f8-4782-8d5a-873cd9136ccb","topic":"自己尝试一下~","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-1629262d1cb4a0.png","width":495.07,"height":264.09},"children":[{"id":"b41ba682-745e-4c4a-bc5f-6fb206f4b4b3","topic":"阵列乘法器，可以同时得到多位的乘积","expanded":true,"hyperlink":"https://zhuanlan.zhihu.com/p/139173424","image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-b9075ea2d8d167.png","width":382.95,"height":171.84}}]}]}]},{"id":"2716d119-cbd5-4e63-8dd1-ead2aea80227","topic":"有符号数","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"4cbfd12a-f4cf-4603-ba9d-acfc8e8829b5","topic":"补码一位乘法逻辑结构图","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-57afc9b67afba4.png","width":590.55,"height":316.58},"children":[{"id":"eaad25d8-ba1c-4240-a47d-403c9c8ba8b2","topic":"注意事项：这里电路（MIPS）中的【补码】乘法是单符号位的，n次加移就够了","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"69eb181b-2675-475f-bf21-917100f7683d","topic":"上面学的双符号位【补码】乘法要n+1次加法、n次移位","expanded":true,"style":{"background":"#FFABD5"}}]}]}]}]},{"id":"be469c91-b5a8-4f9d-975e-52fa5e7ff6a0","topic":"【除法运算】","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"86fef3d2-934d-4f6c-bd3a-687662e9a1d6","topic":"硬件检测","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"d8b281bb-5e08-4be0-b72e-7f319098cbae","topic":"定点小数应是除数 > 被除数","expanded":true,"style":{"background":"#8EDE99"}},{"id":"8bc243a4-a225-4f4a-bcc6-0b139753c243","topic":"如果第一步的商运算后的结果为 1，那么就说明除数 <= 被除数，无法用定点小数来进行计算，故报错","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"34d73914-826f-48fe-84b4-ea2cc96be0b9","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-42b7da0f2dc8dc.png","width":608,"height":752},"children":[{"id":"ff780e46-87a4-4ed8-be01-c611efc17be3","topic":"ACC：被除数、余数","expanded":true,"style":{"background":"#FDD834"}},{"id":"f72d8394-7df6-4f52-af52-68bfc4f6b856","topic":"MQ：商","expanded":true,"style":{"background":"#FDD834"}},{"id":"63f78a76-2636-423b-a1fd-8053462854be","topic":"X：除数","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"6a1547a5-ea33-4bf2-a80b-93abc205e75f","topic":"R ÷ Y = Q...R","expanded":true,"style":{"background":"#BA69C8"},"children":[{"id":"9fbde61c-d7fa-467b-960c-f2460cc05128","topic":"R: remainder，Y: ...，Q: quotient","expanded":true}]},{"id":"5ca105d8-08bd-4cbe-8ada-8990eb46e59b","topic":"【原码除法】\n先商一，然后相减后发现是负数了，再处理，逐渐左移，最后MQ是商，ACC是余数","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"8699419a-aea4-4538-acd5-8289aeea6a35","topic":"恢复余数法","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"08588b4d-9db0-4811-8629-b9e808666858","topic":"硬件构成","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"a746832c-73b8-4bb0-b58d-954f900d40f4","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-dfe890806c7949.png","width":592.01,"height":351.94},"children":[{"id":"13736774-92b3-4448-9b12-c4e81a2b1e5c","topic":"ACC有n+1位，MQ也有n+1位","expanded":true}]}]},{"id":"e2524c00-3334-4fcc-8336-ae0b8b4599a7","topic":"运算流程：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"81a0967d-8639-4f6a-a1b7-63eee9206838","topic":"单独处理符号位","expanded":true,"style":{"background":"#FDD834"}},{"id":"22d46703-6150-44cd-98b7-52cc0058763f","topic":"已知运算 x ÷ y","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c1b4d308-8bac-44d0-b902-cbb8a44d8519","topic":"ACC ÷ X","expanded":true}]},{"id":"89b371e5-5e83-42ac-87f9-1ed1372ff3a5","topic":"0. 把 y 写入到X，把 x 写入到ACC，MQ清零","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"9c52b376-155f-42f2-8ceb-4acf364591a7","topic":"1. 算法默认商 1，MQ的最低位置为 1，进行减法操作：ACC = ACC + (-X)","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"0be03979-7051-4172-bcfb-48be59fea593","topic":"如果最后的ACC的结果为负，则说明此时商0，则把MQ的最低位改为 0，同时ACC = ACC + X","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"328a6e0c-7446-481f-91cb-c9c33443692e","topic":"“恢复余数法”","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]}]},{"id":"c0465154-a253-4b74-aa48-e323cfae987b","topic":"2. 把(ACC, MQ)的值全部左移一位","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"78cdfc19-de5a-47d5-a8b1-516fde78ad73","topic":"此时的左移有两个作用：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"25bcbda9-4a23-4071-a8b3-19c0c680344e","topic":"A. 使得ACC被除数*2\nB. 有一位商已经确定在MQ中了","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"9d053b59-cae0-446f-829d-af0bd85d7a3f","topic":"3. 如果x和y的数值位都为n，那么需要经过【n + 1】次减法运算，n 次移位运算","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"72550586-295d-4541-aa18-b3adc70b7e02","topic":"如果最后一次商 1 还是负数，则应该再恢复余数一次","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"5921552c-02cb-4c8a-b0ff-7a33d4fcfe43","topic":"MQ最后存放了商，ACC存放了余数，【修改MQ的符号位】","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"c1b59f76-63d7-4268-9e4c-ea00261a327f","topic":"加减交替法","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"4a1a42c2-3f62-44e8-979e-9f39e820f226","topic":"优化思路：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"01548b81-e932-42b4-9c9b-589febbab6f1","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-88b5f3d4ee45e1.png","width":515.56,"height":217.44}},{"id":"b82f7fe5-b60f-461e-87b0-14dea901d947","topic":"不进行恢复余数的操作，将操作更改如下","expanded":true,"children":[{"id":"0005ab73-665d-4e65-bbc1-328aad08e0c4","topic":"计算机每次都默认商 1，然后进行补码减法，对于减法后的结果，如果结果为正，则移位进行下一次商操作。","expanded":true},{"id":"abdbf0b8-f38f-4ccb-b2b7-ab33d5a08020","topic":"如果商 1 结果为负，则将 (ACC, MQ) 的值左移一位，在加上X的值（此处的X是ACC,MQ,X的那个X）","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"6746db94-e0e7-4f59-ac25-9e4b8ce0f2b6","topic":"把 (a + b) x 2 - b","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"53760648-e415-4ed6-83fc-c417a14fe738","topic":"简化为了 2 x a + b","expanded":true,"style":{"background":"#FDD834"}},{"id":"933099c0-d298-4c9e-8be1-1cd6477417bc","topic":"首先恢复余数(+b)，然后向左移位一次(x2)，然后进行下一次的商 1 相减设置(-b)","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]}]}]}]},{"id":"2f44a39c-1f9f-4678-bb05-ed7848d40e20","topic":"其他特点：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"a4012d96-83ad-4577-95c1-008ec7366327","topic":"最后算完MQ和ACC的时候如果ACC的内容是负数，还是要 +X 恢复一下","expanded":true,"style":{"background":"#FF9595"}},{"id":"4d1d852e-fb11-4c04-9e8c-86b6598617f1","topic":"加法进行了 n + 1/n + 2 次，而左移进行了 n 次","expanded":true,"style":{"background":"#FF9595"}}]}]}]},{"id":"6f858d72-53fb-47e3-af10-3914f1283677","topic":"【补码除法】\n符号位参与运算，如果X和ACC异号，则左移后相加，如果X和ACC同号，则左移后相减","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"9e9ded71-7c61-495c-b896-4bb4f0772e38","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-6fc366c6cbe0d3.png","width":676.26,"height":344.24},"children":[{"id":"32103fa7-3509-40df-b6f2-9f0201d4e18c","topic":"原码除法采用默认商 1","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"1b320f6d-77d8-421d-af02-b3a7e853dda8","topic":"如果结果为正：左移 + X","expanded":true,"style":{"background":"#8EDE99"}},{"id":"1e8c3404-3091-49ab-97f7-2c9193b6dc6a","topic":"如果结果为负：左移 - X","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"d6e94861-73b3-4e1f-801d-651a4dafc7fc","topic":"补码除法在商的时候根据ACC和X的符号进行判断","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"5de75b02-ecd4-436f-a83f-845e3b3c63f4","topic":"如果ACC和X的符号不同，则商0","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"36b7f5d7-c80e-431d-a822-1be2751e8aa6","topic":"(ACC, MQ)左移一位，+ X","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"46ea6f84-39b0-450f-8928-f3ee6d388aa8","topic":"如果ACC和X的符号同号，则商 1","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"f1701409-cc0d-45a1-b97c-8d55c726e0e6","topic":"(ACC, MQ)左移一位， - X","expanded":true,"style":{"background":"#8EDDF9"}}]}]}]}]}]},{"id":"8685e11e-484b-494b-b17b-9b84477e7f19","topic":"除法电路","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"db4f6199-ca7e-4248-962a-6cba6a693ba0","topic":"R ÷ Y = Q...R / ACC ÷ X = MQ ... ACC","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-0bc998ed2cf6d8.png","width":434.67,"height":253.97},"children":[{"id":"785ba065-bedd-4e01-8776-63c118f12343","topic":"定点小数","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"959c40bf-e857-4224-8b9f-6f3e59152cc9","topic":"图示","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-08c3a2414c6569.png","width":457.12,"height":229.89}}]},{"id":"0011450b-232e-4b7f-90cb-e5be97774798","topic":"定点整数","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"95824c17-7ba0-4e76-9d28-7f922f6b2ac6","topic":"图示","expanded":true,"style":{"background":"#FFABD5"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-7cdaaf53e2c0b3.png","width":456.58,"height":275.16}}]},{"id":"e31563ae-969c-481b-9b04-8b0450676c48","topic":"复习：Q中写值0或1，然后左移","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]}]},{"id":"190cc4f2-156e-4139-b822-45bdb00e33a5","topic":"总结：","expanded":true,"children":[{"id":"0d0eaf6e-d876-4d0f-bedb-7b4dc02edaa5","topic":"乘法、除法基本结构：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"d165d145-ce72-4352-922a-0a044516661b","topic":"ALU：实现加减法，能够求[-补码]","expanded":true,"style":{"background":"#FF9595"}},{"id":"a301bb8e-7e7f-49bb-a9df-b25cc4e04294","topic":"具有逻辑/算术移位功能的寄存器","expanded":true,"style":{"background":"#FF9595"}},{"id":"448ffa54-292b-4093-bb1b-6d09fda359c8","topic":"可以控制左右移/加减/读写信号发出的控制逻辑","expanded":true,"style":{"background":"#FF9595"}},{"id":"19274c83-ec7b-4329-8adf-0e9dc79180fc","topic":"计数器Cn：记录还剩余几轮处理","expanded":true,"style":{"background":"#FF9595"}}]}]}]},{"id":"7fce4b05-b3cc-4180-834b-2f3859c478b6","topic":"定点数的转换","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-84a338e255dc39.svg","width":64,"height":64},"children":[{"id":"67ff0b9c-b25f-46b5-a2df-99958021acc2","topic":"强制类型转化","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"5a3da868-be47-4f86-8375-4e943d3a485f","topic":"原则：不改变具体数值，只改变解释方式","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"c7c9a2a1-828e-4489-9715-b858a05e6575","topic":"例如：","expanded":true,"children":[{"id":"58a41e37-d8f1-4a19-a624-a5e6e48374b4","topic":"unsigned int 转 int 示例","expanded":true,"code":{"lang":"cpp","code":"#include <iostream>\n\nint main() {\n    unsigned int x = 0x80000001;\n    int x1 = x;\n    printf(\"(%lu) - %u\", sizeof(unsigned int ),  x);\n    printf(\" - (%lu) - %d\\n\", sizeof(int ),  x1);\n    unsigned int y = 0xFFFFFFFF;\n    int y1 = y;\n    printf(\"(%lu) - %u\", sizeof(unsigned int ),  y);\n    printf(\" - (%lu) - %d\", sizeof(int ),  y1);\n}\n// 得出结论：unsigned int 转为 int 类型\n// 是直接存储为补码形式的","tokens":[[{"text":"#include ","darkColor":"#C699E0"},{"text":"<iostream>","darkColor":"#94C977"}],[{"text":" "}],[{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"main","darkColor":"#6EC0DF"},{"text":"()","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"{","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"unsigned","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"x","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0x80000001","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"x1","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"x","darkColor":"#EEECE6"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"printf","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"\"(","darkColor":"#94C977"},{"text":"%lu","darkColor":"#E2B159"},{"text":") - ","darkColor":"#94C977"},{"text":"%u","darkColor":"#E2B159"},{"text":"\"","darkColor":"#94C977"},{"text":",","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"sizeof(","darkColor":"#BAB5A8"},{"text":"unsigned","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"),","darkColor":"#BAB5A8"},{"text":"  ","darkColor":"#DEDBD2"},{"text":"x","darkColor":"#EEECE6"},{"text":");","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"printf","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"\" - (","darkColor":"#94C977"},{"text":"%lu","darkColor":"#E2B159"},{"text":") - ","darkColor":"#94C977"},{"text":"%d","darkColor":"#E2B159"},{"text":"\\n","darkColor":"#E67F9F"},{"text":"\"","darkColor":"#94C977"},{"text":",","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"sizeof(","darkColor":"#BAB5A8"},{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"),","darkColor":"#BAB5A8"},{"text":"  ","darkColor":"#DEDBD2"},{"text":"x1","darkColor":"#EEECE6"},{"text":");","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"unsigned","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"y","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0xFFFFFFFF","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"y1","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"y","darkColor":"#EEECE6"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"printf","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"\"(","darkColor":"#94C977"},{"text":"%lu","darkColor":"#E2B159"},{"text":") - ","darkColor":"#94C977"},{"text":"%u","darkColor":"#E2B159"},{"text":"\"","darkColor":"#94C977"},{"text":",","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"sizeof(","darkColor":"#BAB5A8"},{"text":"unsigned","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"),","darkColor":"#BAB5A8"},{"text":"  ","darkColor":"#DEDBD2"},{"text":"y","darkColor":"#EEECE6"},{"text":");","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"printf","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"\" - (","darkColor":"#94C977"},{"text":"%lu","darkColor":"#E2B159"},{"text":") - ","darkColor":"#94C977"},{"text":"%d","darkColor":"#E2B159"},{"text":"\"","darkColor":"#94C977"},{"text":",","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"sizeof(","darkColor":"#BAB5A8"},{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"),","darkColor":"#BAB5A8"},{"text":"  ","darkColor":"#DEDBD2"},{"text":"y1","darkColor":"#EEECE6"},{"text":");","darkColor":"#BAB5A8"}],[{"text":"}","darkColor":"#BAB5A8"}],[{"text":"// 得出结论：unsigned int 转为 int 类型","darkColor":"#908B7E"}],[{"text":"// 是直接存储为补码形式的","darkColor":"#908B7E"}]]},"note":"运行输出：\n(4) - 2147483649 - (4) - -2147483647\n(4) - 4294967295 - (4) - -1"}]}]},{"id":"8a53b9ef-a0ce-421e-9488-c41cf47d9a70","topic":"长整数变短整数","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"9337ef86-0474-4854-9472-0af152e760c9","topic":"高位截断，低位保留","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"c959d0aa-fc91-46c6-8bd8-0f2b2f4a15aa","topic":"短整数变长整数","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"29c737ea-226d-4af4-84d8-3caa8ce9a0fc","topic":"符号扩展","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"3344597d-dc14-4eb1-9eaf-165c5a8d91b9","topic":"unsigned 就是直接补0","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"287c34ba-265e-40f5-a89d-f5fe8618916d","topic":"short/int/long 就是按正负补0/补 1","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"c53e9a1b-649e-463d-8fab-7e3c7ac79e0e","topic":"由 short 变为 unsigned int 的过程","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"eb22d175-03a1-4f0f-9a56-aeb5c836f152","topic":"首先先把short【扩展】为int类型，然后再【转为】unsigned int的【表示方法】","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"703b573a-deda-45b7-b4d4-fc2af92c777c","topic":"如果自己手动修改转化的方式：先转为unsigned再扩展，就会很系统默认的不一样","expanded":true,"style":{"background":"#FFABD5"}}],"code":{"lang":"c","code":"#include <stdio.h>\n\nint main() {\n    short x = 0xf000;\n    unsigned short num1 = (unsigned short) x;\n    int num2 = (int) x;\n    unsigned int num3 = (unsigned int) x;\n    unsigned int num4 = (unsigned int)((unsigned short)x);\n    printf(\"num1 = 0x%x --- num1 = %u --- sizeof(num1) = %ld\\n\",\n            num1, num1, sizeof(num1));\n    printf(\"num2 = 0x%x --- num2 = %d\\n\", num2, num2);\n    printf(\"num3 = 0x%x --- num3 = %u\\n\", num3, num3);\n    printf(\"num4 = 0x%x --- num4 = %u --- sizeof(num4) = %ld\\n\",\n            num4, num4, sizeof(num4));\n}","tokens":[[{"text":"#include ","darkColor":"#C699E0"},{"text":"<stdio.h>","darkColor":"#94C977"}],[{"text":" "}],[{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"main","darkColor":"#6EC0DF"},{"text":"()","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"{","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"short","darkColor":"#74CBC4"},{"text":" x ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0xf000","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"unsigned","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"short","darkColor":"#74CBC4"},{"text":" num1 ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"unsigned","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"short","darkColor":"#74CBC4"},{"text":")","darkColor":"#BAB5A8"},{"text":" x","darkColor":"#DEDBD2"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":" num2 ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"int","darkColor":"#74CBC4"},{"text":")","darkColor":"#BAB5A8"},{"text":" x","darkColor":"#DEDBD2"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"unsigned","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":" num3 ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"unsigned","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":")","darkColor":"#BAB5A8"},{"text":" x","darkColor":"#DEDBD2"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"unsigned","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":" num4 ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"unsigned","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":")((","darkColor":"#BAB5A8"},{"text":"unsigned","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"short","darkColor":"#74CBC4"},{"text":")","darkColor":"#BAB5A8"},{"text":"x","darkColor":"#DEDBD2"},{"text":");","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"printf","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"\"num1 = 0x","darkColor":"#94C977"},{"text":"%x","darkColor":"#E2B159"},{"text":" --- num1 = ","darkColor":"#94C977"},{"text":"%u","darkColor":"#E2B159"},{"text":" --- sizeof(num1) = ","darkColor":"#94C977"},{"text":"%ld","darkColor":"#E2B159"},{"text":"\\n","darkColor":"#E67F9F"},{"text":"\"","darkColor":"#94C977"},{"text":",","darkColor":"#BAB5A8"}],[{"text":"            num1","darkColor":"#6EC0DF"},{"text":",","darkColor":"#BAB5A8"},{"text":" num1","darkColor":"#6EC0DF"},{"text":",","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#6EC0DF"},{"text":"sizeof(","darkColor":"#BAB5A8"},{"text":"num1","darkColor":"#6EC0DF"},{"text":"));","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"printf","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"\"num2 = 0x","darkColor":"#94C977"},{"text":"%x","darkColor":"#E2B159"},{"text":" --- num2 = ","darkColor":"#94C977"},{"text":"%d","darkColor":"#E2B159"},{"text":"\\n","darkColor":"#E67F9F"},{"text":"\"","darkColor":"#94C977"},{"text":",","darkColor":"#BAB5A8"},{"text":" num2","darkColor":"#6EC0DF"},{"text":",","darkColor":"#BAB5A8"},{"text":" num2","darkColor":"#6EC0DF"},{"text":");","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"printf","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"\"num3 = 0x","darkColor":"#94C977"},{"text":"%x","darkColor":"#E2B159"},{"text":" --- num3 = ","darkColor":"#94C977"},{"text":"%u","darkColor":"#E2B159"},{"text":"\\n","darkColor":"#E67F9F"},{"text":"\"","darkColor":"#94C977"},{"text":",","darkColor":"#BAB5A8"},{"text":" num3","darkColor":"#6EC0DF"},{"text":",","darkColor":"#BAB5A8"},{"text":" num3","darkColor":"#6EC0DF"},{"text":");","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"printf","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"\"num4 = 0x","darkColor":"#94C977"},{"text":"%x","darkColor":"#E2B159"},{"text":" --- num4 = ","darkColor":"#94C977"},{"text":"%u","darkColor":"#E2B159"},{"text":" --- sizeof(num4) = ","darkColor":"#94C977"},{"text":"%ld","darkColor":"#E2B159"},{"text":"\\n","darkColor":"#E67F9F"},{"text":"\"","darkColor":"#94C977"},{"text":",","darkColor":"#BAB5A8"}],[{"text":"            num4","darkColor":"#6EC0DF"},{"text":",","darkColor":"#BAB5A8"},{"text":" num4","darkColor":"#6EC0DF"},{"text":",","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#6EC0DF"},{"text":"sizeof(","darkColor":"#BAB5A8"},{"text":"num4","darkColor":"#6EC0DF"},{"text":"));","darkColor":"#BAB5A8"}],[{"text":"}","darkColor":"#BAB5A8"}]]},"note":"运行输出：\nnum1 = 0xf000 --- num1 = 61440 --- sizeof(num1) = 2\nnum2 = 0xfffff000 --- num2 = -4096\nnum3 = 0xfffff000 --- num3 = 4294963200\nnum4 = 0xf000 --- num4 = 61440 --- sizeof(num4) = 4"}]}]},{"id":"08e8b6f4-c482-4f48-a44a-8fea3ebe7354","topic":"数据存储","expanded":true,"children":[{"id":"8346f788-9b9b-439f-881e-5f91479036e4","topic":"大小端模式","expanded":true,"children":[{"id":"217dacbf-39aa-4834-b36d-6770fb424a85","topic":"大端模式","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"81cc2151-8370-4866-ab18-9af586a5b46d","topic":"最高有效字节放在低地址部分","expanded":true,"style":{"background":"#FF9595"}},{"id":"cf88e6c4-f703-4cdc-9fa2-bb7737915897","topic":"符合人类阅读习惯","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"d267965b-d1fd-4fc1-b947-18f56cf54a14","topic":"小端模式","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"30c09ba6-d6cc-4a62-bdeb-f5621058e5f9","topic":"最高有效字节放在高地址部分","expanded":true,"style":{"background":"#FF9595"}},{"id":"61b05520-aac9-4608-a06c-d0f0853abc44","topic":"符合机器取值顺序（先取低有效位再取高有效位）","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"5601550c-5b38-4685-86b9-ecbd048ba203","topic":"记忆口诀：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"84011fa9-4dde-4eac-a9d3-77a6f0fbebe6","topic":"大人小机","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"c3a5ed9a-5b9d-4808-9040-76ecfa691a1c","topic":"Intel唯一在追求小端，【与OS无关】，与硬件制造厂商的选择有关","expanded":true,"style":{"background":"#FFABD5"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-81036c16173d6e.png","width":433,"height":80}}]},{"id":"10651b25-4d2e-4428-a1f1-5f09ff56cc7e","topic":"边界对齐","expanded":true,"children":[{"id":"a8561907-dc5b-4bba-ae6f-f00053d3bbd4","topic":"边界对齐方式","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"9112fa1f-d413-407f-83bc-b87ec8abd424","topic":"边界对齐方式，最大可能满足一次访存可以直接获得一个字的数据","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-2cf5c8835e875c.png","width":320.87,"height":167.41},"children":[{"id":"41633b20-2836-4f0a-a9cb-c62f2c149b27","topic":"空间换时间","expanded":true},{"id":"422aeed2-e77f-4754-a339-a09b41f11cf6","topic":"RISC通常采用边界对齐，可以适应指令流水","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"dfed7831-1135-44c0-b848-472e574e47d7","topic":"边界不对齐方式","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"63bd2e77-bf95-405f-8d6f-92ab87daab76","topic":"边界不对齐方式可能2B的半字都需要2次访存","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-f3280b0fa42d5c.png","width":300.07,"height":110.86},"children":[{"id":"d5876af6-e66e-46b5-9d58-d6e62fb4de9b","topic":"时间换空间","expanded":true}]}]}]}]},{"id":"1eb29ede-6b50-45cd-8da0-d35cf09a1df5","topic":"考频：高","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"dbebc0a2-3fe0-40b9-9a37-ec7f4a1cf300","topic":"09、12*2、16、18*2、19、20、11大","expanded":true}]}]},{"id":"1496d7df-2cbd-4080-a891-d1f248a693db","topic":"浮点数","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-939c1c28fe2e94.svg","width":64,"height":64},"children":[{"id":"c5f84932-97f8-4277-a331-f734aeb35e11","topic":"考频：高","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"d5319783-f91f-4596-a072-e1178b63e64c","topic":"09-15、18、20-22、17大","expanded":true}]},{"id":"c1282bc8-ea1a-4ad8-9ec4-efc8f19a6684","topic":"通常表示方法","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"87810fd1-b57a-40e5-8246-14d52b983b2b","topic":"浮点数真值公式","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"09f9ed04-f85c-43e4-a8d4-a984b222bad9","topic":"其中 R为基数（即R进制），E和M都是有符号定点数。E称为阶码，M称为尾码","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"b40eb70a-b1f9-4961-9b2d-030f2e21c5af","topic":"E为定点整数，M为定点小数","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"cae29dfc-7e23-4040-92de-3966638f9fcf","topic":"其中E和M可以用补码或原码来表示","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"00ce5aa0-85f4-400e-b405-38b0693a1f17","topic":"注意计算十进制值的时候补码为负要转为对应真值在写值","expanded":true,"style":{"background":"#FFABD5"}}]}],"formula":{"tex":"N = (-1)^S \\times R^E \\times M","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>N</mi><mo>=</mo><mo stretchy=\"false\">(</mo><mo>−</mo><mn>1</mn><msup><mo stretchy=\"false\">)</mo><mi>S</mi></msup><mo>×</mo><msup><mi>R</mi><mi>E</mi></msup><mo>×</mo><mi>M</mi></mrow><annotation encoding=\"application/x-tex\">N = (-1)^S \\times R^E \\times M</annotation></semantics></math></span>"}},{"id":"11136edc-85ba-47e0-917c-1c7d38ddbe04","topic":"一般格式","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-03b0dc2832e4ed.png","width":306.71,"height":96.39}},{"id":"ad492c67-5c4e-4c03-9fd2-04c95eeb9385","topic":"尾数规格化","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"20c659ae-5680-4b54-9999-fc343a96c004","topic":"原码","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"d0a8e5ab-a532-4daa-80de-e9f753996a2c","topic":"浮点数的尾数部分的最高位一定是“有效数”位","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"86c847af-fa16-4f86-8711-c6ce389be9d5","topic":"负数： 1, 1 ....","expanded":true,"style":{"background":"#8EDE99"}},{"id":"aeddfa98-dc89-457e-bfc4-681317b2f846","topic":"正数：0, 1....","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"9fde0c9b-7e0e-477d-a98d-8954f5292497","topic":"补码","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"1488e7af-a727-483e-9904-61203f782fa6","topic":"浮点数的尾数部分最高位和符号位一定不同","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"483d8df1-4a91-4eff-a241-4d7b90959f83","topic":"负数：1, 0 ...","expanded":true,"style":{"background":"#8EDE99"}},{"id":"b673b294-6ae7-4332-a8b8-9402f4f61120","topic":"正数：0, 1....","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"ed9df134-7a02-4447-8751-352be69b15ad","topic":"尾数、阶码规格化","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"018d42f9-8ca7-4de1-9f37-7b9d2ccfed27","topic":"例如 原码 ( M = 1,011 ，E = 0, 000 0010 )，则应该变为：( M = 1,110 ，E = 0, 000 0001），M左移了，E对应减小","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"3ea76c8a-6c03-426c-88e0-08d6b4bbdec6","topic":"尾数左移：左归","expanded":true},{"id":"2fa3f6b1-9e74-46ca-99ba-bad0a17fa677","topic":"尾数右移：右归","expanded":true}]}]}]},{"id":"84fca804-ef6f-4245-b808-4deaa8926b04","topic":"计算","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"de42a8bf-3f0b-48e7-b182-0d4ac155220b","topic":"在进行加减计算中，采用双符号位进行计算，可以挽救很多溢出","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"551b55e5-49a5-42dc-83fb-526213248761","topic":"例如：符号位 00 和 符号位 00 相加的结果是 0 1，则可以把尾数右移一位，阶码 +1 来进行挽救","expanded":true,"style":{"background":"#8EDE99"}}]}]}]},{"id":"e8e1ddc6-82a6-4ee7-b2d7-14d8e55ac09e","topic":"浮点数的运算","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"e30454b0-50bc-4370-b22f-a9c0ca89a949","topic":"对阶","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"0290558b-a043-4ecb-8b56-a6a6e03893bc","topic":"首先把两个浮点数的阶码对齐，以小阶向大阶看齐","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"d650e990-da24-44d3-9e5c-66402720166b","topic":"尾数求和","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"3874d5cb-19e1-4c28-a908-a8367c82a5c3","topic":"尾数按定点数的加减法进行运算","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"94cd2494-a6ee-4deb-8193-cf7ed5ef1edb","topic":"规格化","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"4a70a692-e8df-4c7b-abea-3b50a61e633f","topic":"尾数 > 0时，规格化为00.1xxxx\n尾数 < 0时，规格化为 11.0xxxx","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"737869dc-c97c-42bd-9e84-0e7f8781c30b","topic":"舍入","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c4460e8d-f454-4ade-80b9-525ed1faa439","topic":"\"0\"舍\"1\"入法：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"b4744fdd-8779-4ae8-b1c0-5bec5a4f7bbe","topic":"尾数右移，如果被【移除的最高位】为 0，那么就舍去。如果被【移除的最高位】的是 1，那么就让尾数 + 1","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"d0abd736-f276-44fa-9338-42de6a824d97","topic":"10100","expanded":true,"children":[{"id":"afc8d58d-de8d-4a9e-8a19-19a015ae60d6","topic":"右移3次：","expanded":true,"children":[{"id":"ca91cc71-297d-41be-9b53-81e59a49298c","topic":"10 + 1 = 11","expanded":true}]},{"id":"bffc2972-2fa6-4a57-8805-6d68e3af7a9e","topic":"右移1次：","expanded":true,"children":[{"id":"dcf40cca-06ac-4386-ad09-3f74fdedf867","topic":"1010","expanded":true}]}]},{"id":"0b13cc6b-dffb-414c-bbf1-dc430e1d6c39","topic":"此时+1后可能还需要进行规格化","expanded":true}]}]},{"id":"954adbe0-d483-4cb9-88ec-43a331e8cc0d","topic":"恒置为\"1\"法：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"069a1735-5c04-4abf-beac-cb436f658f4b","topic":"尾数右移，不管如何移动，尾数最末位一定为 1","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"254a1421-1f90-484b-af48-9c3bda60142e","topic":"溢出判断","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"73d7aa44-8471-400b-a0e8-c2e73ff4a0e1","topic":"双符号时","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"8a346215-aee2-47f2-a729-a08d333138cc","topic":"如果阶码出现了“01”，说明出现了上溢，进入中断处理","expanded":true,"style":{"background":"#8EDE99"}},{"id":"66030cf1-02dc-4bf1-8617-ccb34271cfe4","topic":"如果阶码出现了“10”，说明出现了下溢，按 0 处理","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"9c898976-c438-470e-b6d9-a60fad2ebb32","topic":"一般考试的运算是不会计算IEEE754模式的","expanded":true,"style":{"background":"#7986CB"},"children":[{"id":"4213745a-e207-4986-aa15-bb2032941968","topic":"计算只有09选择题考了","expanded":true}]}]},{"id":"78311d51-91f2-40be-9431-fc4c893c3f3a","topic":"IEEE 754","expanded":true,"icons":["star:red"],"style":{"background":"#FDD834"},"children":[{"id":"d68be9bf-4937-42c5-afbc-976ce666dc85","topic":"一般格式","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"667bd3fb-0754-4aae-b8ef-5a6f07bdee2f","topic":"<符号位、阶码、尾数>","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"4a698d58-1885-4bf1-b25b-225cfa9cc06f","topic":"【符号位】 1 为负，0为正","expanded":true,"style":{"background":"#FDD834"}},{"id":"66bbac97-b17d-4b70-9cee-bfcca8008081","topic":"【阶码】部分使用特殊的移码计算","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"8df61f91-0387-47c0-8103-6ab2ab92dbc4","topic":"之前的移码（改符号位）：1,000 0001 + 1000 0000 = 0,000 0001","expanded":true},{"id":"97aa06ce-ab8c-4ce8-8478-6543eeda17d0","topic":"直接在补码那里进行加法运算，例如：1, 000 0001 + 0111 1111(偏) = 0000 0000","expanded":true,"style":{"background":"#8EDE99"}}],"formula":{"tex":"\\text{偏置值} = 2^{n-1} - 1","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mtext>偏置值</mtext><mo>=</mo><msup><mn>2</mn><mrow><mi>n</mi><mo>−</mo><mn>1</mn></mrow></msup><mo>−</mo><mn>1</mn></mrow><annotation encoding=\"application/x-tex\">\\text{偏置值} = 2^{n-1} - 1</annotation></semantics></math></span>"}},{"id":"216a49ff-9065-47e9-9476-758c30d3ecb3","topic":"【尾数】用原码表示，且隐藏最高位的1","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"0fa6dc67-3ce4-4f0e-a93e-a018aaf8b6ce","topic":"不同精度","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"ff2fa584-fa20-4833-8d7b-6d3ef8f65d9d","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-57696e7958cb78.png","width":494.3,"height":404.22}}]},{"id":"2292c7c3-7c4a-48d7-bf8a-ea8f772975af","topic":"特殊的浮点数情况","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"00720619-e37e-451d-8341-691ce712c5c3","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-fb2c9928e01bb5.png","width":491.36,"height":168.2},"children":[{"id":"b3214aff-2b05-461e-9665-ce601a7e9665","topic":"8bit原码表示的阶码可以表示 0 ~ 255，在IEEE754中，0和255分别代表了特殊含义。","expanded":true},{"id":"07ac9c24-b6aa-4b14-ae93-f4e1a39bc458","topic":"故IEEE754的阶码取值范围是： (1 ~ 254) - 127 = -126 ~ 127","expanded":true,"style":{"background":"#FF9595"}},{"id":"c51e018d-2140-4030-92fa-29f95c9c268c","topic":"为什么全0是-127，全1是-128？","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"18c422b3-d4d6-47ca-bb1e-e4cf80194a12","topic":"IEEE754的阶码在这个图基础上全部进行了-1","expanded":true,"style":{"background":"#FFABD5"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-e3d3dab9387c7d.png","width":470.93,"height":300.85}}]}]}]}]}]},{"id":"035b4186-5e71-4a48-891e-73b892fbb608","topic":"举个举例：","expanded":true,"children":[{"id":"2646564d-6cd0-4cd0-be3e-cef84252834f","topic":"图示","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-172f475115611f.png","width":533.6,"height":387.64},"children":[{"id":"74c3d24b-0ced-42de-9efe-7784b19da685","topic":"IEEE 754 浮点数 - 在线工具","expanded":true,"hyperlink":"https://www.toolhelper.cn/Digit/FractionConvert"}]}]},{"id":"21708cff-844d-47c0-b61b-14d1905b4366","topic":"类型转换","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"9f0a3c4f-c993-4b68-b20f-2b652ca7d498","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-f85860e150b2ba.png","width":717,"height":445}}]}]},{"id":"8daa0929-59a1-42ce-a4c7-5e188a57a21c","topic":"END","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-ac155e6bc1bf7a.svg","width":64,"height":64}}]},"relations":[{"id":"73b644be-2a1b-4ebd-8749-88e52f2f65fd","from":"940912c1-47b2-4efd-be87-a2f228b161e4","to":"049cbabf-46e7-470c-8f76-24de2d86b57c","bidirectional":false,"label":"1. 多了辅助位 \n2. 加法规则变了\n3. 多了一次加法"}],"summaries":[{"id":"810e01dd-5a52-4ad5-9618-eccf1cdf8ea0","parentId":"db1ec404-7291-4bad-88be-b8642d3320b5","start":3,"end":3,"label":"例如：真值 +5 即机器数 0,101"},{"id":"b8c76c77-a123-4633-a0b6-514355a0b3c5","parentId":"8e4f6f25-806a-4457-a614-ff5f42708556","start":1,"end":1,"label":"因为1 0000 000 = 0 0000 000按位取反 + 1，但是 +0 是正数，没有这个运算规则"},{"id":"90a7d251-ce60-475c-976d-b67437203b25","parentId":"c33db92d-be98-4898-bcda-2a6e0b1acea5","start":0,"end":1,"label":""},{"id":"1fc33092-f0ec-46f6-a134-935673166913","parentId":"cd4f0376-f053-494a-9805-5cb2e28a7c5f","start":0,"end":0,"label":"注意：是左边添 1，右边添 0"},{"id":"c978d0c4-aa2d-4399-b822-d1b9e4b69c31","parentId":"11c4e63e-66c0-43b6-b0f9-0596727eb551","start":0,"end":2,"label":"X * MQ = ( ACC, MQ )"},{"id":"d09e914d-2647-4aa9-b91c-408f1bb2c5ce","parentId":"940912c1-47b2-4efd-be87-a2f228b161e4","start":3,"end":3,"label":""},{"id":"01877a94-a0a0-4c0e-8836-ee498afacdc7","parentId":"049cbabf-46e7-470c-8f76-24de2d86b57c","start":3,"end":3,"label":""},{"id":"ae2bdd3e-295d-458d-9a19-067cd9773cd5","parentId":"34d73914-826f-48fe-84b4-ea2cc96be0b9","start":0,"end":2,"label":"ACC ÷ X = MQ ... ACC"},{"id":"a759cfe4-1a9c-4a9a-8641-fde5046ecc25","parentId":"8699419a-aea4-4538-acd5-8289aeea6a35","start":1,"end":1,"label":""},{"id":"039e736c-e745-49cd-adc4-c4807d06b3d3","parentId":"c1b59f76-63d7-4268-9e4c-ea00261a327f","start":0,"end":1,"label":""},{"id":"8bb145de-9bf3-427e-b0ec-73fa09f821b9","parentId":"32103fa7-3509-40df-b6f2-9f0201d4e18c","start":0,"end":1,"label":"随后进行下一次的运算"},{"id":"e00d70ca-1555-41fc-9ec0-0cb541fd2a07","parentId":"8346f788-9b9b-439f-881e-5f91479036e4","start":1,"end":1,"label":""},{"id":"ae21f8dd-1b0d-456d-9e99-2d8219243e6e","parentId":"94cd2494-a6ee-4deb-8193-cf7ed5ef1edb","start":0,"end":0,"label":"补码"}],"boundaries":[{"id":"2516d503-c667-4a3a-beba-22466a23288a","parentId":"07b4bb25-fa93-4e46-b823-1f47abe8eccd","start":0,"end":1,"label":"MQ有辅助位，ACC、X均为双符号位"},{"id":"cf0174cf-8cba-4a5d-afe0-4a731f3a10bd","parentId":"be469c91-b5a8-4f9d-975e-52fa5e7ff6a0","start":0,"end":0,"label":"前提"}]}