Please write the details of your question here.
I don't know why 0b10000000 becomes -128 in an 8-bit environment with a sign.
Supplementary information (FW/tool version, etc.)
−127 = 0b10000001 0b100000000 (128) --0b01111111 (127) = 0b10000001 (-127) -1 is 0b100000000 (128) --0b00000001 (1) = 0b11111111 (-1) I understand that. That is, -127 to 127 It can be expressed by 0b10000001 to 0b11111111. But I don't understand why 0b10000000 is -128. 0b100000000 (128)-0b100000000 (128) = 0b000000000 (-128 ??) -128 ≠ 0b10000000 is not. Instead of calculating by calculation like this If -128 is expressed by 0b10000000, it will be possible to make effective use of bits (because the value that can be expressed by one increases). In an 8-bit environment, when signed Is it okay to recognize that I "decided" to express -128 as 0b10000000?
Fundamental Information Technology Engineer Examination N-ary question
Answer # 1
0b100000000 (128) --0b01111111 (127) = 0b10000001 (-127)
0b100000000 (128) --0b00000001 (1) = 0b11111111 (-1)
I don't know what the calculation is.
0b1_0000_0000 is 256 instead of 128, 128-127 is not -127 and 128-1 is not -1.
0b100000000 (128)-0b100000000 (128) = 0b000000000 (-128 ??)
Similarly, 0b1_0000_0000 is 256 instead of 128.
I don't know what you want to calculate, but if you set the first "128" to 0b1_0000_0000 (256) as above and the next "128" to 0b1000_0000, which is 128 correctly, wouldn't it be the result you want?
Answer # 2
It ’s a simple two's complement representation.
If you subtract 1 from -127, it's -128.
What do you know about this?
Answer # 3
All bits are written here. Can you understand if you look at the list?
List of 8-bit signed integers signed integer
Answer # 4
Negative numbers can be thought of as follows.
For example, if you add a number X to 127 and it becomes 0, you can think of X as -127.
When representing a number with 8 bits (ignoring numbers over 8 bits). It will be as follows.
0b0111'1111 (127) + X = 0b0000'0000 (0) ⇒ X = 0b1000'0001 (-127)
0b0111'1110 (126) + X = 0b0000'0000 (0) ⇒ X = 0b1000'0010 (-126)
0b0000'0001 (1) + X = 0b0000'0000 (0) ⇒ X = 0b1111'1111 (-1)
0b1000'0000 (128) + X = 0b0000'0000 (0) ⇒ X = 0b1000'0000 (-128)
I'm adding the same thing, so it feels a little strange. I don't think the idea is wrong.
- basic information engineer - computer binary number division
- regarding basic information engineer examination 2's complement expression
- basic information engineer - basic information processing test, logic circuit, formula
- basic information engineer - concept of casl cpl instruction
- basic information engineer - questions about index addressing and relative addressing
- basic information engineer examination algorithm
- basic information engineer examination python
- basic information engineer - take out a particular bit?
- basic information engineer - what does a small plus-like symbol read and what does it mean?
- applied information technology engineer h29 autumn afternoon programming
- basic information technician - processing when index-qualified addressing is used with caslⅡ ld instruction
- BeanDefinition basic information
- Jvm information jmap basic method tutorial
- How to display basic information after SSH login server
- MySQL connection and basic information view command summary
- Java method to obtain server basic information
- basic information engineer - is it possible to change the url displayed in the browser to any form?
- about past questions of basic information engineer examination
- [basic information engineer] algorithm
- [basic information engineer] hash function
- [basic information engineer examination] n-bit binary complement
- algorithm - is there a collection of web questions for afternoon questions of the basic information engineer examination?
- please give senior advice! a book that provides basic security skills it can also be used as a measure for basic and applied inf
- basic information engineer - when using weighted comprehensive evaluation method in system introduction evaluation
- basic information engineer - [array algorithm] two-dimensional array