卖逼视频免费看片|狼人就干网中文字慕|成人av影院导航|人妻少妇精品无码专区二区妖婧|亚洲丝袜视频玖玖|一区二区免费中文|日本高清无码一区|国产91无码小说|国产黄片子视频91sese日韩|免费高清无码成人网站入口

二進(jìn)制求和運(yùn)算 二進(jìn)制反碼運(yùn)算求和?

二進(jìn)制反碼運(yùn)算求和?算法實(shí)現(xiàn): unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) { uns

二進(jìn)制反碼運(yùn)算求和?

算法實(shí)現(xiàn): unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) { unsigned int sum __asm__ __volatile__( "movl (%1), %0 n" "subl , %2 n" "jbe 2f n" "addl 4(%1), %0 n" "adcl 8(%1), %0 n" "adcl 12(%1), %0 n" "1: adcl 16(%1), %0 n" "lea 4(%1), %1 n" "decl %2 n" "jne 1b n" "adcl , %0 n" "movl %0, %2 n" "shrl , %0 n" "addw %w2, %w0 n" "adcl , %0 n" "notl %0 n" "2: n" : "=r" (sum), "=r" (iph), "=r" (ihl) : "1" (iph), "2" (ihl) : "memory") return(sum) } 擴(kuò)展資料二進(jìn)制反碼求和工作原理 :0和0相加是0,但要產(chǎn)生一個進(jìn)位1,0和1相加是1,1和1相加是0.若最高位相加后產(chǎn)生進(jìn)位,則最后得到的結(jié)果要加1。(0)反 (0)反 = 1 1 = 10(1)反 (0)反=0 1 =1(1)反 (1)反 = 0 0 = 0

二進(jìn)制反碼求和是怎樣求的?

兩個數(shù)進(jìn)行二進(jìn)制反碼求和的運(yùn)算,它的規(guī)則是從低位到高位逐列進(jìn)行計算。0和0相加是0但要產(chǎn)生一個進(jìn)位1,0和1相加是1,1和1相加是0。若最高位相加后產(chǎn)生進(jìn)位,則最后得到的結(jié)果要加1。 舉例:已知X = 1101 , Y = 0110 , 用反碼計算Z = X-Y。 [X]反 = 01101 [-Y]反 = 11001 則[Z]反 =[X]反 [-Y]反 = 01101 11001 1(循環(huán)進(jìn)位)= 00111 其真值為Z = 0111