Can you explain why -15 (decimal numbers) can't fit into 4 bits? I believe the answer is because the highest decimal number that can fit in 4 bits is 7 but i'm not too sure.
- DixonLv 71 month ago
In the standard twos complement method of representing numbers the first bit is taken as the sign and the remaining bits are used for the value. With four bits there are three bits left for value and three bits have 8 discrete permutations, so the range covered is 7 (0 111) to 0 (0 000) and -1 (1 111) to -8 (1 000)
However, you can chose to represent any number you want with 4 bits or even 1 bit because digital electronics is symbolic, so if you decide 0001 (say) is going to represent -15 then that is your choice and just fine.
People often choose to represent numbers with twos complement because it is convenient and consistent with binary addition but then you have to work with the values allowed in that form of representation.
- ?Lv 71 month ago
The short answer is you need 1 bit for the sign.
in twos complement, + numbers go from 0000 to 0111 or 0 to 7. - numbers go from 1111 to 1000 or -1 to -8.
- PuzzlingLv 71 month ago
A 4-bit binary number can hold 16 possible values (2^4 = 16).
When you are storing negative numbers, however, you must use one bit for the sign. This leaves only 3 bits to hold the actual number and that's not enough to hold -15.
- King Cheat-ooLv 41 month ago
Representing negative numbers with twos complement takes one bit for the sign