{"id":1462,"date":"2016-03-11T17:33:29","date_gmt":"2016-03-11T09:33:29","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=1462"},"modified":"2026-08-18T12:09:35","modified_gmt":"2026-08-18T04:09:35","slug":"%e5%8e%9f%e7%a0%81-%e5%8f%8d%e7%a0%81-%e8%a1%a5%e7%a0%81-%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=1462","title":{"rendered":"\u539f\u7801, \u53cd\u7801, \u8865\u7801 \u8be6\u89e3"},"content":{"rendered":"<section id=\"wenyan\" style=\"font-family: system-ui, 'Apple Color Emoji', 'Segoe UI', 'Segoe UI Symbol', 'Noto Sans', Roboto, sans-serif; line-height: 1.75; font-size: 16px; color: #000000; caret-color: #000000;\" data-provider=\"WenYan\">\n<p style=\"margin: 1em 0px;\">\u8ba1\u7b97\u673a\u91cc\u4e00\u4e2a\u6574\u6570\u53ef\u4ee5\u7528<strong style=\"color: #4870ac;\">\u539f\u7801\u3001\u53cd\u7801\u3001\u8865\u7801<\/strong>\u4e09\u79cd\u65b9\u5f0f\u7f16\u7801\u3002\u641e\u6e05\u695a\u5b83\u4eec\u600e\u4e48\u7b97\u3001\u673a\u5668\u4e3a\u4ec0\u4e48\u6700\u7ec8\u7528\u8865\u7801\uff0c\u4ee5\u53ca\u4e3a\u4ec0\u4e48\u8865\u7801\u52a0\u6cd5\u80fd\u5b8c\u6210\u539f\u7801\u51cf\u6cd5\uff0c\u5bf9\u7406\u89e3\u5e95\u5c42\u8fd0\u7b97\u5f88\u6709\u5e2e\u52a9\u3002<\/p>\n<p><!--more--><\/p>\n<h2 style=\"padding: 1px 12.5px; color: #ffffff; margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: #4870ac; font-size: 1.3em;\">\u4e00\u3001\u673a\u5668\u6570\u548c\u771f\u503c<\/h2>\n<p style=\"margin: 1em 0px;\">\u4e00\u4e2a\u6570\u5728\u8ba1\u7b97\u673a\u4e2d\u7684\u4e8c\u8fdb\u5236\u8868\u793a\u53eb\u505a<strong style=\"color: #4870ac;\">\u673a\u5668\u6570<\/strong>\u3002\u673a\u5668\u6570\u5e26\u7b26\u53f7\uff1a\u6700\u9ad8\u4f4d\u5b58\u653e\u7b26\u53f7\uff0c\u6b63\u6570\u4e3a 0\uff0c\u8d1f\u6570\u4e3a 1\u3002\u5b57\u957f 8 \u4f4d\u65f6\uff0c+3 \u662f 00000011\uff0c-3 \u662f 10000011\uff0c\u8fd9\u4e24\u4e2a\u5c31\u662f\u673a\u5668\u6570\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u56e0\u4e3a\u7b2c\u4e00\u4f4d\u662f\u7b26\u53f7\u4f4d\uff0c\u673a\u5668\u6570\u7684\u5f62\u5f0f\u503c\u4e0d\u7b49\u4e8e\u771f\u6b63\u7684\u6570\u503c\u3002\u4f8b\u5982\u6709\u7b26\u53f7\u6570 10000011\uff0c\u6700\u9ad8\u4f4d 1 \u4ee3\u8868\u8d1f\uff0c\u771f\u503c\u662f -3\uff0c\u800c\u4e0d\u662f\u628a\u6574\u4e32\u5f53\u6210\u65e0\u7b26\u53f7\u6570\u5f97\u5230\u7684 131\u3002\u5e26\u7b26\u53f7\u4f4d\u7684\u673a\u5668\u6570\u5bf9\u5e94\u7684\u771f\u6b63\u6570\u503c\uff0c\u53eb\u505a\u673a\u5668\u6570\u7684<strong style=\"color: #4870ac;\">\u771f\u503c<\/strong>\uff1a0000 0001 \u7684\u771f\u503c = +1\uff0c1000 0001 \u7684\u771f\u503c = -1\u3002<\/p>\n<h2 style=\"padding: 1px 12.5px; color: #ffffff; margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: #4870ac; font-size: 1.3em;\">\u4e8c\u3001\u539f\u7801\u3001\u53cd\u7801\u3001\u8865\u7801<\/h2>\n<p style=\"margin: 1em 0px;\">\u539f\u7801\u3001\u53cd\u7801\u3001\u8865\u7801\u662f\u673a\u5668\u5b58\u50a8\u4e00\u4e2a\u5177\u4f53\u6570\u5b57\u7684\u7f16\u7801\u65b9\u5f0f\u3002<\/p>\n<table style=\"display: table; text-align: left; overflow: auto; border-collapse: collapse; margin: 1.4em auto; max-width: 100%; table-layout: fixed; overflow-wrap: break-word; word-break: break-all;\" width=\"800\">\n<thead>\n<tr>\n<th style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: #4870ac; background: #f7f7f7;\">\u7f16\u7801<\/th>\n<th style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: #4870ac; background: #f7f7f7;\">\u6b63\u6570<\/th>\n<th style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: #4870ac; background: #f7f7f7;\">\u8d1f\u6570<\/th>\n<th style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top; text-align: center; font-weight: bold; color: #4870ac; background: #f7f7f7;\">\u4f8b\u5b50\uff08-1\uff09<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u539f\u7801<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u7b26\u53f7\u4f4d + \u7edd\u5bf9\u503c<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u7b26\u53f7\u4f4d 1 + \u7edd\u5bf9\u503c<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">1000 0001<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u53cd\u7801<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u7b49\u4e8e\u539f\u7801<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u7b26\u53f7\u4f4d\u4e0d\u53d8\uff0c\u5176\u4f59\u53d6\u53cd<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">1111 1110<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u8865\u7801<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u7b49\u4e8e\u539f\u7801<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">\u53cd\u7801\u672b\u4f4d +1<\/td>\n<td style=\"border: 1px solid #d9dfe4; padding: 9px 12px; font-size: 0.75em; line-height: 22px; vertical-align: top;\">1111 1111<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin: 1em 0px;\">8 \u4f4d\u539f\u7801\u7684\u53d6\u503c\u8303\u56f4\u662f [1111 1111, 0111 1111]\uff0c\u5373 [-127, 127]\u3002\u539f\u7801\u6700\u8d34\u8fd1\u4eba\u8111\uff1b\u8d1f\u6570\u7684\u53cd\u7801\u3001\u8865\u7801\u901a\u5e38\u8981\u5148\u8f6c\u56de\u539f\u7801\u624d\u80fd\u770b\u51fa\u6570\u503c\u3002<\/p>\n<h2 style=\"padding: 1px 12.5px; color: #ffffff; margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: #4870ac; font-size: 1.3em;\">\u4e09\u3001\u4e3a\u4f55\u673a\u5668\u7528\u8865\u7801<\/h2>\n<p style=\"margin: 1em 0px;\">\u6b63\u6570\u4e09\u79cd\u7f16\u7801\u76f8\u540c\uff0c\u4e0d\u5fc5\u591a\u89e3\u91ca\u3002\u8d1f\u6570\u5219\u5b8c\u5168\u4e0d\u540c\u3002\u4eba\u8111\u770b\u89c1\u7b26\u53f7\u4f4d\u5c31\u77e5\u9053\u8be5\u52a0\u8fd8\u662f\u8be5\u51cf\uff0c\u4f46\u8ba9\u8ba1\u7b97\u673a\u8fa8\u522b\u7b26\u53f7\u4f4d\u4f1a\u8ba9\u7535\u8def\u590d\u6742\u3002\u51cf\u6cd5\u53ef\u4ee5\u6539\u6210\u300c\u52a0\u4e0a\u4e00\u4e2a\u8d1f\u6570\u300d\uff1a1 &#8211; 1 = 1 + (-1)\u3002\u5982\u679c\u7b26\u53f7\u4f4d\u4e5f\u53c2\u4e0e\u8fd0\u7b97\uff0c\u673a\u5668\u5c31\u53ef\u4ee5\u53ea\u505a\u52a0\u6cd5\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u7528\u539f\u7801\u7b97 1 &#8211; 1\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">[00000001]\u539f + [10000001]\u539f = [10000010]\u539f = -2   \/\/ \u9519<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u7528\u53cd\u7801\uff1a\u771f\u503c\u90e8\u5206\u5bf9\u4e86\uff0c\u5374\u5f97\u5230 -0\uff0c\u5e76\u4e14 0 \u6709 [0000 0000] \u548c [1000 0000] \u4e24\u4e2a\u7f16\u7801\u3002\u8865\u7801\u89e3\u51b3 0 \u7684\u7b26\u53f7\u95ee\u9898\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">[0000 0001]\u8865 + [1111 1111]\u8865 = [0000 0000]\u8865\n(-1) + (-127) = [1111 1111]\u8865 + [1000 0001]\u8865 = [1000 0000]\u8865  \/\/ -128<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">[1000 0000]\u8865 \u8868\u793a -128\uff0c\u5b83\u6ca1\u6709\u5bf9\u5e94\u7684\u539f\u7801\u548c\u53cd\u7801\u3002\u56e0\u6b64 8 \u4f4d\u539f\u7801\/\u53cd\u7801\u8303\u56f4\u662f [-127, +127]\uff0c\u8865\u7801\u662f [-128, 127]\u300232 \u4f4d int \u7528\u8865\u7801\u65f6\u8303\u56f4\u4e3a [-2^31, 2^31-1]\u3002<\/p>\n<h2 style=\"padding: 1px 12.5px; color: #ffffff; margin: 1.2em 0px 1em; border-radius: 4px; display: inline-block; background-color: #4870ac; font-size: 1.3em;\">\u56db\u3001\u600e\u4e48\u6c42\u8865\u7801\uff0c\u4ee5\u53ca ~6 \u4e3a\u4ec0\u4e48\u662f -7<\/h2>\n<p style=\"margin: 1em 0px;\">\u6b63\u6570\u7684\u539f\u7801\u3001\u53cd\u7801\u3001\u8865\u7801\u90fd\u662f\u5b83\u672c\u8eab\u3002\u8d1f\u6570 -15 \u7684\u8ba1\u7b97\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 12px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 12px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; overflow-x: auto; margin: 0.5em; padding: 3px 5px; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">\u539f\u7801\uff1a1 0001111\n\u53cd\u7801\uff1a1 1110000   \/\/ \u7b26\u53f7\u4f4d\u4e0d\u53d8\uff0c\u5176\u4f59\u53d6\u53cd\n\u8865\u7801\uff1a1 1110001   \/\/ \u53cd\u7801\u672b\u4f4d +1<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">Java \u4e2d int \u662f 4 \u5b57\u8282\u30026 \u5728\u673a\u5668\u91cc\u662f 0000\u20260110\uff0c\u6309\u4f4d\u53d6\u53cd <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; color: #4870ac; font-size: 0.9em; font-weight: normal; overflow-wrap: break-word; padding: 2px 4px; border-radius: 3px; margin: 2px; background-color: #f6f8fa; word-break: break-all;\">~6<\/code> \u5f97\u5230 1111\u20261001\u3002\u6700\u9ad8\u4f4d\u4e3a 1\uff0c\u8fd9\u662f\u8865\u7801\u8868\u793a\u7684\u8d1f\u6570\u3002\u8fd8\u539f\u539f\u7801\uff1a\u7b26\u53f7\u4f4d\u4e0d\u53d8\u3001\u5176\u4f59\u53d6\u53cd\u5f97 1000\u20260110\uff0c\u518d\u672b\u4f4d\u52a0 1 \u5f97 1000\u20260111\uff0c\u5373 -7\u3002<\/p>\n<p style=\"margin: 1em 0px;\">\u539f\u6587\u51fa\u5904\uff1a<a id=\"cb_post_title_url\" class=\"postTitle2\" href=\"http:\/\/www.cnblogs.com\/zhangziqiu\/archive\/2011\/03\/30\/ComputerCode.html\">\u539f\u7801, \u53cd\u7801, \u8865\u7801 \u8be6\u89e3<\/a><\/p>\n<blockquote style=\"display: block; font-size: 0.9em; border-left: 3px solid #4870ac; padding: 0.5em 1em; margin: 0px; background: #f6f8fa; color: #40464f;\">\n<p style=\"margin: 1em 0px;\"><strong style=\"color: #4870ac;\">\u4e00\u53e5\u8bdd\u603b\u7ed3\uff1a\u673a\u5668\u53ea\u7528\u8865\u7801\u505a\u52a0\u51cf\uff0c\u8fd9\u6837 0 \u53ea\u6709\u4e00\u79cd\u7f16\u7801\uff0c\u8fd8\u80fd\u591a\u8868\u793a\u4e00\u4e2a\u6700\u5c0f\u503c\uff1b~n \u7b49\u4e8e -(n+1)\u3002<\/strong><\/p>\n<\/blockquote>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u8ba1\u7b97\u673a\u91cc\u4e00\u4e2a\u6574\u6570\u53ef\u4ee5\u7528\u539f\u7801\u3001\u53cd\u7801\u3001\u8865\u7801\u4e09\u79cd\u65b9\u5f0f\u7f16\u7801\u3002\u641e\u6e05\u695a\u5b83\u4eec\u600e\u4e48\u7b97\u3001\u673a\u5668\u4e3a\u4ec0\u4e48\u6700\u7ec8\u7528\u8865\u7801\uff0c\u4ee5\u53ca\u4e3a\u4ec0\u4e48\u8865\u7801\u52a0\u6cd5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[30],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1462"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1462"}],"version-history":[{"count":3,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1462\/revisions"}],"predecessor-version":[{"id":1480,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1462\/revisions\/1480"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}