Deprecated: Return type of Config::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /webdata/wwwroot/www.zlnznjj.com/blog/zb_system/function/lib/config.php on line 26

Deprecated: Return type of Config::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /webdata/wwwroot/www.zlnznjj.com/blog/zb_system/function/lib/config.php on line 36

Deprecated: Return type of Config::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /webdata/wwwroot/www.zlnznjj.com/blog/zb_system/function/lib/config.php on line 31

Deprecated: Return type of Config::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /webdata/wwwroot/www.zlnznjj.com/blog/zb_system/function/lib/config.php on line 41

Deprecated: Return type of Config::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /webdata/wwwroot/www.zlnznjj.com/blog/zb_system/function/lib/config.php on line 17
二进制数的运算法则-众乐知识网

二进制数的运算法则

二进制数的运算法则是:遇1得1、二进制的与运算:遇0得0、二进制的非运算:各位取反。



二进制数的运算法则:



1、二进制加法运算法则:



0+0=0,0+1=1,1+0=1,1+1=10,也就是当两个相加的二进制位仅一位为1时,相加的结果为1;如果两个二进制位全是0,相加的结果仍为0;而如果两个相加的二进制位均为1,则结果为10(相当于十进制中的2),也就是“逢2进1”规则,与十进制中的“逢10进1”的道理一样。



2、二进制减法运算法则:



1-1=0,1-0=1,0-0=0,0-1=-1,也就是当两个相加的二进制位中同为0或1时,相减的结果为0;如果被减数的二进制位为1,而减数的二进制位为0,则相减的结果仍为1;而如果被减数的二进制位为0,而减数的二进制位为1,则需要向高位借1,但此时是借1当2,与十进制中的借1当10道理一样。




3、二进制乘法运算法则:



乘法法则: 0×0=0,0×1=0,1×0=0,1×1=1



4、二进制除法运算法则:



除法应注意: 0÷0 =0(无意义),0÷1 =0,1÷0 =0(无意义)



除法法则: 0÷1=0,1÷1=1



二进制(binary)在数学和数字电路中指以2为基数的记数系统,以2为基数代表系统是二进位制的。这一系统中,通常用两个不同的符号0(代表零)和1(代表一)来表示。




二进制数的表示法二进制是计算技术中广泛采用的一种数制。二进制数是用0和1两个数码来表示的数。它的基数为2,进位规则是“逢二进一”,借位规则是“借一当二”.二进制数也是采用位置计数法,其位权是以2为底的幂。例如二进制数110.11,其权的大小顺序为22、21、20、2-1、2-2。对于有n位整数,m位小数的二进制数用加权系数展开式表示,可写为:(N)2=an-1×2n-1+an-2×2n-2+……+a1×21+a0×20+a-1×2-1+a-2×2-2+……+a-m×2-m= 式中aj表示第j位的系数,它为0和1中的某一个数。二进制数一般可写为:(an-1、an-2…a1a0。a-1、a-2…a-m。)