As computers are becoming more popular nowadays, so are programmers. But did you know that the only code that your computer can read is binary? That's right! Today you will learn how to read binary code (aka. the code of 1's and 0's).
First of all, let's look at our own number system, the Hindu-Arabic system. It is based on ten. So if we look at the number 328, it is actually another way of saying (3 X 100)+(2 X 10)+(8 X 1).
But if we look at the binary code, we realize that there are only two numbers, 1 and 0. That's why its starts with the prefix 'bi'. Bi means two.
Let's look at an example. Say we want to convert the number 0011.
If we look at this in our number system, we would look at it as another way of saying (1X10)+(1X1). But if we look at it from a binary perspective, we would say it was another way of saying (1X4)+(1X2).
So instead of looking at the number sequence as 1,10,100,1000 etc. we should look at it as 2,4,8,16 etc.
Usually binary is written in strings of four (on computers) but there are times when you will get a big line of it.
For more info, check out programing in C+ courses from alison.com.
DISCLAIMER: THIS IS NOT AN ADVERTISEMENT FOR ALISON FREE ONLINE COURSES, THIS IS WHERE I GOT THE INFORMATION FROM.
No comments:
Post a Comment