简体   繁体   中英

151 as an 8-bit signed binary number

Converting base 10 to base 2 n = 8

A= 49 B= 151

By doing so 49 is 00110001 and -49 would be 11001111.

I am having problems with finding 151 and -151 because after the conversion it is already an 8-bit number. 151 is 10010111, but in signed binary doesn't the farthest left digit indicate whether its negative or positive. 1 is negative and I am trying to get positive 151, but within 8-bits. How would I go about this?

如果只有8位,则您的无符号范围是0到255,这使您的有符号范围为-128到127。因此,仅8位不能将-151或151表示为有符号数。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM