CPU 是如何识数的?
k8s技术圈
共 3096字,需浏览 7分钟
·
2021-05-11 18:32
先来看一个简单的问题:小孩子都知道数数:1,2,3,4,5,6,7,8,9,10,可为什么要这样数呢?为什么不是1,2,3,4,5,6,10呢?
一种比较流行的解释是因为人类有10个手指:
![](https://filescdn.proginn.com/f66da6b01c90bb484ada4cfa37a3f14b/11a71c59cf8fc9e7e78790b558c5116e.webp)
![](https://filescdn.proginn.com/5e37b45da2dbc4d38835b5ae6d182acc/d5b39e00fb386a952ad9ad49aa92c84f.webp)
![](https://filescdn.proginn.com/04b986b59b12ca9eb36a3cb32594b83e/723985d2020d20484206ce324bf1b656.webp)
![](https://filescdn.proginn.com/d2abd653d3e34701d1299bf8972628fc/0f935bc771335a12bed36af3be06b425.webp)
![](https://filescdn.proginn.com/118c658a28b7881e9f436042cdc2f33d/6a790ee341e895a16d4270d263b000d1.webp)
数字 0 与正整数
![](https://filescdn.proginn.com/dc6c8928130fcc37e683630ec33ea8c4/7cf74f0e93a30d118631b35802858639.webp)
![](https://filescdn.proginn.com/f9a5c90608a26894fedae4f2cf16a187/ec1f9a4b7a04d780afa1c1f7cb694d21.webp)
![](https://filescdn.proginn.com/79c806125f257be0819d382af5f60c40/fc917389753d4214794c882a9698685a.webp)
有符号整数
![](https://filescdn.proginn.com/4ce770b42939a83a16ad573ec6accca2/f5856e6b987ae181c87c3e2a5b0c5ec6.webp)
方法1:正数加上负号即对应负数
![](https://filescdn.proginn.com/b29a5af87ebcac983c09b1cd5c4e5774/87e2f84b7e7341da514154e3e5e2b53a.webp)
方法2:翻转
![](https://filescdn.proginn.com/97cf0b20bac025ee5be246100109a967/487ec666995159f54d1ca3156528ec0f.webp)
设计计算机很容易吗?
不简单的两数相加
![](https://filescdn.proginn.com/3c67938b5e9fcec6ac689f32484bd8f8/5fb976fde3dbfb4b3ee4913d4c282d39.webp)
![](https://filescdn.proginn.com/4f59f98ac926b45df66018ac3dd1e154/3365600d2e91c90cf68365bf1fc1304e.webp)
新的表示方法
![](https://filescdn.proginn.com/b16ee5d07cc18fd35bef48dee052eeb9/237a33ef74f970f797e07bf84fc19765.webp)
![](https://filescdn.proginn.com/7fbadd6069bfda860489c9711c50b972/62996fba571d90e7a1a29a8d66ed8966.webp)
![](https://filescdn.proginn.com/125725c882236d421029aaf685d65f8b/ee3c997cd2cac8ad9efa34a8e77b87d9.webp)
CPU真的识数吗?
![](https://filescdn.proginn.com/cdc1cbcf1452c9ea1e442f118ac15a44/669435680e04b58587db0db7edf4f91b.webp)
总结
评论