Number Systems – Binary

Binary is formed of 2 digits either a 1 or a 0.

Denary is the numbers that we see every day like 1,2,3,4,5,6,7,8,9,10 etc. But how do we convert binary to denary, add binary and subtract binary?

Converting Binary and Denary

128    64    32    16    8    4    2    1

0     1           0     0     0   1    0     0    = 64+4= 68

01000100 in Binary = 68 in Denary.

Adding Binary

001001 = 9
100101 = 37
101101 = 46

37+9=46

binadd

To add binary you simply add a 1 when there is a 0 in the other number and if there is already a 1 there, you put 0 and carry the 1 to the next number. If at the end of the number you have any left overs you simply ignore it.

Subtracting Binary

Subtracting Binary is harder and there are 2 ways you can go about it.

a. you do a 1s compliment and a 2s compliment and add the results

b. you convert the numbers to binary, subtract them and convert them back to binary

Option b often takes longer and you may not have enough time to do that in an exam

A.

10011 = 19
01111 = 15

1s compliment – invert the number your subtracting

0 1 1 1 1
1 0 0 0 0

2s compliment – +1 to this new binary number

1 0 0 0 1

Then add them both

10011
10001
00100

remove the left over 1

00100

19-15+4

00100 = 4

16  8  4  2  1

0  0  1   0   0 = 4

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s