Converting Numbers to Sign/Magnitude and Two's Complement Notation in 8 Digits

  • Thread starter Thread starter notorious9000
  • Start date Start date
  • Tags Tags
    Notation
Click For Summary

Discussion Overview

The discussion revolves around converting the number -5 into Sign/Magnitude and Two's Complement notation using 8 bits. Participants explore the steps involved in these conversions, including the binary representation of positive numbers and the process for negative numbers.

Discussion Character

  • Homework-related
  • Mathematical reasoning

Main Points Raised

  • One participant asks how to convert -5 into Sign/Magnitude and Two's Complement notation in 8 digits.
  • Another participant suggests that converting 5 into binary is the first step, indicating that 5 can be represented as 0101 in binary.
  • A participant proposes that the Sign/Magnitude representation of -5 is 1101, but seeks confirmation on this claim.
  • There is a description of the Two's Complement conversion process, including inverting bits and adding one, but it is not directly applied to -5 in the discussion.
  • An example is provided for converting 23 and -23 into Two's Complement, detailing the steps involved, but it does not directly resolve the original question about -5.

Areas of Agreement / Disagreement

Participants express uncertainty about the correctness of the Sign/Magnitude representation for -5 and do not reach a consensus on the Two's Complement conversion process for this specific number.

Contextual Notes

There are missing assumptions regarding the representation of numbers in binary and the specific steps for converting -5 into Two's Complement. The discussion does not clarify how many bits are needed for padding in the Two's Complement process.

notorious9000
Messages
11
Reaction score
0
Find (-5) to Sign / magnitude notation & Two's Complement in 8 digits
 
Last edited:
Physics news on Phys.org
notorious9000 said:
Find (-5) to Sign / magnitude notation & Two's Complement in 8 digits

What have you tried so far? Do you know how to convert 5 into binary? That's your first step.
 
xcvxcvvc said:
What have you tried so far? Do you know how to convert 5 into binary? That's your first step.

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 ?
 
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 ?
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.

Example: represent 23 and -23 in 2's complement

2's complement of 23:
step 1: find the binary representation of 23
23 base 10 = 10111 base 2
step 2: add at least one 0 in front to denote positivity. However, infinitely many is ok
answer = 010111 or 000010111, etc.

2's complement of -23:
step 1 find the binary representation of 23:
23 base 10 = 10111 base 2
step 2: pad the number with 0s (you need enough. 1 usually does it). Note, after we take the one's complement (inverting each bit), these 0s will become 1s. Remember, you can pad a negative number with infinitely many 1s.
00010111
step 3: invert each bit:
11101000
step 4: add 1 to the least significant bit:
11101001
 

Similar threads

Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 6 ·
Replies
6
Views
10K
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
17K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K