Signed vs. Unsigned Binary: Those Tricky Numbers!

We're diving into the murky world of binary numbers. You know, those ones and zeros that computers love to chew on? Well, it turns out they're not all the same. We've got signed and unsigned binary, and they're about as different as a peas you are about to eat and peas you have passed.

Unsigned binary? Easy peasy. It's all positive, like a puppy with a bone. But signed binary? That's where the trouble starts. See that first bit, the one on the left? If it's a 1, BAM, you've got a negative number. Like a digital slap in the face.

Now, you might be thinking, "Why bother?" Well, in exams, they love to throw this at you. They'll ask if a number is signed or unsigned. If they don't tell you, just assume it's unsigned. Better safe than sorry, eh?

Negative Numbers in Binary: Not as Scary as Your Brother's Toenail Collection

Right then, buckle up buttercups, because we're plunging headfirst into the slightly bonkers world of representing negative numbers in binary. You know, those strings of ones and zeros that make computers tick (and sometimes throw a digital tantrum).

Now, you might think binary is all sunshine and rainbows, counting upwards like a well-behaved toddler. But hold your horses! We've got ways to show the naughty numbers too – the ones below zero. Two main methods for this trickery are sign and magnitude and that fancy-pants two's complement.

Listen up, because exam time loves a bit of this! Usually, the folks marking your hard work will tell you which method is being used. If not, and they want you to go negative, they'll probably give you a nudge in the right direction. So, keep your peepers peeled!

Sign and Magnitude: A Bit of a Give-Away!

So, first up in our negative number shenanigans is something called 'sign and magnitude'. It's about as subtle as a slap with a wet fish.

Check out the very first bit on the left – the big cheese of the binary bunch. This little fella doesn't actually count towards the number itself. Nope! It's purely there to tell you if the number is playing nicely (positive) or being a right menace (negative).

If that first bit is a big fat 1, then BOOM! You've got a negative number on your hands. Think of it as a tiny digital warning sign. But if it's a nice, round 0, then you're in positive territory – as cheerful as a pig in muck.

Now, here's the sneaky bit. When you're actually working out the value of the number, you completely ignore that first 'sign' bit if it's a 1. Just pretend it's not even there and treat the rest of the binary like your regular, run-of-the-mill base 2 stuff. Easy peasy, right? Well, mostly...

Worked Examples Icon Worked examples

Convert sign and magnitude number 00111110 into a decimal number.

Step 1: work out the decimal value ignoring the sign bit 00111110 = 62

Step 2: is the first bit 1 or 0? If it is 1 add a '-'.
It is 0 so the number is positive 62

Convert sign and magnitude number 11001011 into a decimal number.

Step 1: work out the base 2 (unsigned binary) ignoring the sign bit 11001011 = 75

Step 2: is the first bit 1 or 0? If it is 1 add a '-'.
It is 1 so the number is negative as a decimal number it is -75

Convert the decimal number 105 into a sign and magnitude number (using 8 bits).

Step 1: work out the base 2 (unsigned binary) value. 105 = 1101001

Step 2: is the number positive or negative? It is positive, so add a 0 at the front to give 01101001.

Convert the decimal number -48 into a sign and magnitude number (using 8 bits).

Step 1: work out the base 2 (unsigned binary) value of the magnitude. 48 = 110000

Step 2: is the number positive or negative? It is negative, so add a 1 at the front to give 10110000.

Note: Using 8 bits, we pad with 0s other than for the sign bit.

Guide Icon Guided Practice

Copy out the workings and complete the answers on a separate piece of paper.

1. Convert the sign and magnitude number 01010101 into a decimal number.

Step 1: work out the decimal, ignoring the first bit. (__)(1010101)2 = __10

Step 2: Is the first bit (in brackets in Step 1) a 1 or a 0? If 1, the number is negative, if a 0, it's positive.

Answer: 85

2. Convert the sign and magnitude number 11100011 into a decimal number.

Step 1: work out the decimal, ignoring the first bit. (__)(1100011)2 = __10

Step 2: Is the first bit a 1 or a 0? Is the number positive or negative?

Answer: -99

3. Convert the decimal number 78 into a sign and magnitude number (assuming 8 bits).

Step 1: work out the base 2 value.

7810 = __ __ __ __ __ __ __2

Step 2: Is the number positive or negative? If positive, add a 0 at the front, if negative, add a 1.

Answer: 01001110

4. Convert the decimal number -91 into a sign and magnitude number (assuming 8 bits).

Step 1: work out the base 2 value of the absolute number.

9110 = __ __ __ __ __ __ __2

Step 2: Is the number positive or negative? Add a 0 or a 1 to the front.

Answer: 11011011

Task List Icon Independent Practice

  1. Convert the sign and magnitude number 01001 into a decimal number.
  2. Convert the sign and magnitude number 10110 into a decimal number.
  3. Convert the sign and magnitude number 0110010 into a decimal number.
  4. Convert the sign and magnitude number 1001111 into a decimal number.
  5. Convert the decimal number 37 into a sign and magnitude number (using 6 bits).
  6. Convert the decimal number -23 into a sign and magnitude number (using 6 bits).
  7. Convert the decimal number 98 into a sign and magnitude number (using 8 bits).
  8. Convert the decimal number -115 into a sign and magnitude number (using 8 bits).

Answers

  1. +9
  2. -6
  3. +50
  4. -15
  5. 010101
  6. 101101
  7. 01100010
  8. 11110011