Powered By Blogger
READ THIS FIRST

Welcome to my blog. I had an academic obligation to write every now and then in 2010, but now there's no more pressure, so it'll be much harder to get myself to to write regularly.

--
On the right are navigation links.
Home is pretty self-explanatory. Fiction is a page dedicated to narrative passages that I write, fiction or not.
--
Any comments can be posted on my blog or emailed to
s-unit052@hotmail.com.
--Thanks.

21.2.09

Binary

On Friday we learnt binary at school. I learnt conversion of decimals(as in numbers of base 10) to binary before on my own from a book, but never really understood the system until now. At school, they taught us to break the decimal into powers of 2 to convert. The method I learnt earlier was to subtract the largest possible power of 2 from the decimal. If that was possible, it was represented by 1. If not, it would be represented by 0.

Example:
15 - 8 = 7 ==> 1
7 - 4 = 3 ==> 1
3 - 2 = 1 ==> 1
1 - 1 = 0 ==> 1

Therefore 15 = 1111 in binary or base 2

17 - 16 = 1 ==> 1
1 is too large to subtract 8 ==> 0
1 is too large to subtract 4 ==> 0
1 is too large to subract 2 ==> 0
1 - 1 = 0 ==> 1

Therefore 17 = 10001 base 2.
Then, of course, I noticed 16, 8, 4, 2, 1 are all powers of 2(1 = 2 power of 0).
I must really be a bit of a Charlie Gordon to have not noticed this earlier.

No comments:

Post a Comment