代表一个带符号的8位整数?

use*_*942 1 assembly

如果F6基数十六进制是带符号的8位整数,它以十进制表示多少?

Pow*_*ord 6

F6是二进制值11110110.

在二进制补码系统中,第一位用于指示符号.如果为0,则剩余的7位数字代表0-127.如果它是1,那么你使用按位不翻转其他7位,然后加1并否定结果.

所以:

11110110 // Negative, because the first position is 1
1110110 // Removed the leading 1
0001001 // Flip the remaining 7 bits
8 + 1 // Convert bits to decimal values (bits 4 and 1 from the right)
9 + 1 = 10 // Add the 1
Run Code Online (Sandbox Code Playgroud)

因此,F6是-10.


Jer*_*fin 5

假设"正常"2的补码,则为-10.在1的补码中它将是-11.签名幅度为-118.