- #1
notorious9000
- 11
- 0
Find (-5) to Sign / magnitude notation & Two's Complement in 8 digits
Last edited:
notorious9000 said:Find (-5) to Sign / magnitude notation & Two's Complement in 8 digits
xcvxcvvc said:What have you tried so far? Do you know how to convert 5 into binary? That's your first step.
Yeah. The way I learned to take two's complement is if you have a positive number, it is simply that number with a 0 in front to denote positivity. If the number is negative, you take the positive binary representation, invert all of its binary digits, and add one. Remember, if the number is positive, if you can pad the the 2's complement with as many 0s in front as you want. Oppositely, if the number is negative, you can pad the 2's complement with as many 1s in front as you want.notorious9000 said:umm...
ex) for 4 digits
negative = 1000
positive = 0000
I guess 5 is a easy small number to make to binary
3210
-----
0101
is this right ?
so for Sign/Magnitude
1101 = -5
is this right ?
if this is right. how to convert this to Two's complement ?
Sign/magnitude notation is a way of representing a numerical value by separating the number into two parts: the sign and the magnitude. The sign indicates whether the number is positive (+) or negative (-), while the magnitude represents the absolute value of the number.
Sign/magnitude notation differs from other notations, such as standard form or scientific notation, because it explicitly shows the sign of the number. This can be useful when working with both positive and negative values.
The purpose of using sign/magnitude notation is to easily represent both positive and negative numbers in a clear and concise manner. It also allows for easier comparison and computation of values with different signs.
To convert a number from sign/magnitude notation to standard form, simply remove the sign and write the magnitude in front of the appropriate power of 10. For example, the number +3.25 in sign/magnitude notation would become 3.25 x 10^0 in standard form.
Yes, sign/magnitude notation can be used for both integer and non-integer numbers. The sign indicates the direction (positive or negative) and the magnitude represents the absolute value of the number, regardless of whether it is an integer or not.