python定义二进制_什么是二进制(定义)?

python定义二进制

python定义二进制

Binary is a numbering system used to express numbers in 2 states. These two states are 0 and 1. The binary numbering system is very important for computer and IT systems because of the different types of hardware using a binary system like CPU, RAM, GPU, HDD, NIC, etc.

二进制是一种用于在两种状态下表示数字的编号系统。 这两个状态分别为0和1。二进制编号系统对于计算机和IT系统非常重要,因为使用二进制系统(例如CPU,RAM,GPU,HDD,NIC等)的硬件类型不同。

二进制值 (Binary Values)

Binary numbering system provides two values named and 1.  There is no number like 3, 5 or similar in binary. Computers mainly use these binary values in order to process, read, write data.

二进制编号系统提供两个名为1 。 没有像数35或二进制类似。 计算机主要使用这些二进制值来处理,读取和写入数据。

布尔逻辑 (Boolean Logic)

Binary numbers are highly related with the boolean logic. Boolean Logic is a logic which is mainly used in computers and mathematics. binary values are used to express the false logic where 1 is used to express the true logic. We can also use different logic operators like AND, OR, EXOR etc. Here are some Boolean Logic calculations with binary values.

二进制数与布尔逻辑高度相关。 布尔逻辑是一种主要用于计算机和数学的逻辑。 二进制值用于表示错误逻辑,其中1用于表示真实逻辑。 我们还可以使用不同的逻辑运算符,例如ANDOREXOR等。这是一些带有二进制值的布尔逻辑计算。

1 AND 1 = 1

1 OR 0 = 1

1 AND 0 = 0

1 XOR 0 =1

1 XOR 1 = 0

二进制和十进制数 (Binary and Decimal Numbers)

Binary numbers can cen be converted into decimal numbers and vise versa. For example 11 binary value is equal to 3 in decimal numbering system.

二进制数cen可以转换为十进制数,反之亦然。 例如,十进制编号系统中的11二进制值等于3

Decimal ValueBinary ValueBase-2 Representation
n/a
112
21021
31121 + 2
410022
510122+ 2
611022 + 21
711122 + 21 + 2
8100023
9100123 + 2
10101023 + 21
64100000026
25610000000028
102410000000000210
十进制值 二元值基本2表示
不适用
1个1个 2
2 10 2 1
3 11 2 1 + 2
4 100 2 2
5 101 2 2 + 2
6 110 2 2 + 2 1
7 111 2 2 + 2 1 + 2
8 1000 2 3
9 1001 2 3 + 2
10 1010 2 3 + 2 1
64 1000000 2 6
256 1亿 2 8
1024 10000000000 2 10
LEARN MORE  In Python Operator Usage Tutorial with Examples
在示例中进一步了解Python运算符用法教程

翻译自: https://www.poftut.com/what-is-binary-definition/

python定义二进制

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值