This link should help you in solving your problem - it's pretty short and straight-forward:
http://www.cs.uwm.edu/classes/cs315/Bacon/Lecture/HTML/ch04s11.html
Short explanation of 8-bit signed magnitude:
Number in your desired format looks like this:
1000 0110, which is equal to -6 in decimal:
1*** **** - means that number HAS sign (which is minus),
*000 0110 - which contains binary representation of number.
When you have a positive number, you simply convert it to it's binary form:
(D) 7 = 0000 0111
(D) 20 = 0001 0100
When you have a negative number (e.g. -7), your highest bit is equal to 1:
1...
and the value is simply converted to binary form:
(D) 7 = 111 = 000 0111
Then you combine it:
(D) -7 = 1000 0111.
Note that in this format you can only save number ranged from -127 to 127 - you have just 7 lower bits left for value whereas 8th bit must be left for a sign.
1s complementary example:
(D) -7 = 1000 0111 in 8-bit signed.
When you add a number and it's 1s complementary, you should get: 1111 1111
1000 0111 - your number
0111 1000 + - your number's 1s complementary
^^^^^^^^^
1111 1111
Formally, you can do the following operation:
1111 1111
1000 0111 - - your number
^^^^^^^^^
... <- your number's 1s complementary
2s complementary:
When you calculated 1s complementary, simply add 1 to it:
1000 0111 - your number
0111 1000 - your number's 1s complementary
0111 1001 - your number's 2s complemetary
Try to do this yourself and post your answer - this way you will learn much more.