Nadeem
2009-05-16 05:35:42
Hello Ladies & Gentlemen! :)
[Binary (Base2)]
This is the most depth down programming that exists, its is the FINAL actual result that ALL other languages are converted into before read by a computer. The principal of all programming.
[Calculating]:
Basically, Binary code are made up from the remainders of a sequence of numbers divided by 2, which is why its also called the Base2 code.
[Example]:
Base 10 Code: 26510
Step 1: Divide by 2.
Step 2: Take count of the remainder.
Step 3: Keep repeating step 1 until you reach 0.
265/2 = 132 R = 1 ^
132/2 = 066 R = 0 |
066/2 = 033 R = 0 |
033/2 = 016 R = 1 |
016/2 = 008 R = 0 |
008/2 = 004 R = 0 |
004/2 = 002 R = 0 |
002/2 = 001 R = 0 |
001/2 = 000 R = 1 | Read up this way.
Remainders put together: 100001001 ~ Now we need to divide them into chunks of 4 starting from the end, and fill in 0's to take place if we have remaining space.
Binary Code = 0001 0000 1001
[Decimal (Base10)]
This is basically the second another type of code that is later converted into the basic Binary before the computer reads it. It is more simpler and easier to understand from a code perspective compared to Binary.
[Calculating]:
This is a sequence that involves using power base of 2 on the Binary Code. If you noticed, we divided everything by 2 in order to convert from Decimal to Binary, therefore in order to revert back we must do the opposite of dividing which is powering it.
[Example]:
Base2 Code: 0100 1110
Step 1: You must assign a power by 2^count starting from the end to the beginning.
Step 2: Skip the 0's.
Step 3: Calculate the powered value.
Step 4: Repeat Step 3 until you reach the first value
Step 5: Add up the sum.
0 ~ 2^0 - Skip since this is a 0
1 ~ 2^1
1 ~ 2^2
1 ~ 2^3
0 ~ 2^4 - Skip since this is a 0
0 ~ 2^5 - Skip since this is a 0
1 ~ 2^6
0 ~ 2^7 - Skip since this is a 0
2^1 = 2
2^2 = 4
2^3 = 8
2^6 = 64
SUM = 78
Decimal Code = 7810
[Hexadecimal (Base16)]
This is the most commonly seen computer code. This is the type of code that is used to represent RGB colors. In Hexadecimal codes, usually we see letters aswell as numbers, these letters are used as a way to represent a block of 2 numbers. Since computer code can only read upto 1 block of number per slot. We cannot put something like '11' into one block of code since thats taking up 2 slots and will have a whole new different meaning, which is why we replace '11' with a capital 'B'.
[Legend]:
A = 10
B = 11
C = 12
D = 13
E = 14
F = 15
[Calculating]:
This is a basically the same method as calculating Binary and Decimal, except you use 16 instead of a 2.
[Example]:
Base10 Code: 24410
Step 1: Divide code by 16
Step 2: Take count of the closest division number that can go into the Base10 Code 16 times
Step 3: Then take the original Base10 Code you started with and subtract that by the number you got from Step 2
244 / 016 = 015 <— This is the number you'll need to replace with a letter since it is larger than 9 taking up 2 slots.
016 * 015 = 240 <— You need this for the last step.
244 - 240 = 004 <— The remainder is going to be the last digit.
Hexadecimal Put Together = F416
Hexadecimal Code = 0xF416 <— Standard way of represeting a Hexadecimal code, this code in RGB is known to print out a light gray color
Thank you for reading my tutorial! :D
- Nadeem
~NS
[Binary (Base2)]
This is the most depth down programming that exists, its is the FINAL actual result that ALL other languages are converted into before read by a computer. The principal of all programming.
[Calculating]:
Basically, Binary code are made up from the remainders of a sequence of numbers divided by 2, which is why its also called the Base2 code.
[Example]:
Base 10 Code: 26510
Step 1: Divide by 2.
Step 2: Take count of the remainder.
Step 3: Keep repeating step 1 until you reach 0.
265/2 = 132 R = 1 ^
132/2 = 066 R = 0 |
066/2 = 033 R = 0 |
033/2 = 016 R = 1 |
016/2 = 008 R = 0 |
008/2 = 004 R = 0 |
004/2 = 002 R = 0 |
002/2 = 001 R = 0 |
001/2 = 000 R = 1 | Read up this way.
Remainders put together: 100001001 ~ Now we need to divide them into chunks of 4 starting from the end, and fill in 0's to take place if we have remaining space.
Binary Code = 0001 0000 1001
[Decimal (Base10)]
This is basically the second another type of code that is later converted into the basic Binary before the computer reads it. It is more simpler and easier to understand from a code perspective compared to Binary.
[Calculating]:
This is a sequence that involves using power base of 2 on the Binary Code. If you noticed, we divided everything by 2 in order to convert from Decimal to Binary, therefore in order to revert back we must do the opposite of dividing which is powering it.
[Example]:
Base2 Code: 0100 1110
Step 1: You must assign a power by 2^count starting from the end to the beginning.
Step 2: Skip the 0's.
Step 3: Calculate the powered value.
Step 4: Repeat Step 3 until you reach the first value
Step 5: Add up the sum.
0 ~ 2^0 - Skip since this is a 0
1 ~ 2^1
1 ~ 2^2
1 ~ 2^3
0 ~ 2^4 - Skip since this is a 0
0 ~ 2^5 - Skip since this is a 0
1 ~ 2^6
0 ~ 2^7 - Skip since this is a 0
2^1 = 2
2^2 = 4
2^3 = 8
2^6 = 64
SUM = 78
Decimal Code = 7810
[Hexadecimal (Base16)]
This is the most commonly seen computer code. This is the type of code that is used to represent RGB colors. In Hexadecimal codes, usually we see letters aswell as numbers, these letters are used as a way to represent a block of 2 numbers. Since computer code can only read upto 1 block of number per slot. We cannot put something like '11' into one block of code since thats taking up 2 slots and will have a whole new different meaning, which is why we replace '11' with a capital 'B'.
[Legend]:
A = 10
B = 11
C = 12
D = 13
E = 14
F = 15
[Calculating]:
This is a basically the same method as calculating Binary and Decimal, except you use 16 instead of a 2.
[Example]:
Base10 Code: 24410
Step 1: Divide code by 16
Step 2: Take count of the closest division number that can go into the Base10 Code 16 times
Step 3: Then take the original Base10 Code you started with and subtract that by the number you got from Step 2
244 / 016 = 015 <— This is the number you'll need to replace with a letter since it is larger than 9 taking up 2 slots.
016 * 015 = 240 <— You need this for the last step.
244 - 240 = 004 <— The remainder is going to be the last digit.
Hexadecimal Put Together = F416
Hexadecimal Code = 0xF416 <— Standard way of represeting a Hexadecimal code, this code in RGB is known to print out a light gray color
Thank you for reading my tutorial! :D
- Nadeem
~NS