Go Back   Gaming Gutter > Just Chat > Guides & Tutorials


Guides & Tutorials - Your gaming walk-thrus and tutorials.

» Site Navigation
» Home
» FAQ
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Advertisement
» Recent Threads
Go to first new post Selling a couple for...
Today 01:55 AM
Last post by Lanbo
Today 07:15 AM
2 Replies, 3 Views
Go to first new post INTERNETS NVR LIEZ.
Today 12:08 AM
Last post by XxXdemonaXxX
Today 07:14 AM
15 Replies, 16 Views
Go to first new post GamingGutter Chibis
08-10-2008 08:31 PM
by Li-Shun
Last post by Hodizzle
Today 07:14 AM
626 Replies, 627 Views
Go to first new post Fuck up ********.net
Yesterday 06:46 PM
by Connor
Last post by Kyo
Today 07:12 AM
7 Replies, 8 Views
Go to first new post Reviewing Format
08-30-2008 11:05 AM
by Googlrr
Last post by Connor
Today 07:11 AM
1 Replies, 2 Views
Reply
 
LinkBack Thread Tools Display Modes

 Binary to Decimal and back.
Old 07-01-2008, 06:47 AM   #1 (permalink)
FireWrath FireWrath is offline Gender Undisclosed
Banned
 
FireWrath is offline
Join Date: Oct 2007
Posts: 3,217
iTrader: 1 / 100%
FireWrath Total CelebrityFireWrath Total CelebrityFireWrath Total CelebrityFireWrath Total CelebrityFireWrath Total CelebrityFireWrath Total Celebrity
Rep Power: 0
Binary to Decimal and back.

I got the idea from Matt's guide where he explained the binary to ASCII deal on here. This is a simlar concept, but going from a base-two number (binary) to a base ten number (decimal).

Normally when you count you start with 0 and work your way up until you hit 9, then it starts over again, such as 1 then 2, 3, 4 up until you hit 9, then it goes back down to 10, 11 13. The same is done with binary, only it goes from 0 to one, then it starts over again.

Let's go with counting, to make it easy, and just to make it simply to follow, we'll go with binary:decimal.
0:0
1:1
10:2
11:3
100:4
101:5
110:6
111:7
1000:8
1001:9
1010:10
The concept is fairly easy, especially in counting, but how do you go from decimal to binary? Well this is where you have to put your basic math skills to a use. Easiest thing is to draw a table. The table should start at 1, then keep multiplying by 2 until the last number is equal to, greater than the number in decimal, and should go from left to right. Here's an example for 10:
16 8 4 2 1
Now that you have a table, you start with the left number (the biggest one). If that number is bigger than the decimal, stick a 0 in there and move on, otherwise place a 1. Subtract that number from the original, and keep going until the number reaches 0. Let's go back to the table:
16 8 4 2 1
0
Original number: 10. Ignore it. Move on.
16 8 4 2 1
0 1
Original number: 10. Subtract 8. Move on.
16 8 4 2 1
0 1 0
New number: 2. Ignore it. Move on.
16 8 4 2 1
0 1 0 1
New number: 0. Fill the rest with 0's. You're done.
16 8 4 2 1
0 1 0 1 0
Any zeros in the begining you can ignore, so the outcome is 1010. Looking back at when we counted from 0 to 10 to double check, that is in fact correct.

Now to go from binary to decimal you do a fairly simiar thing. Let's take a longer number like 1011001. Now draw the same chart again.
64 32 16 8 4 2 1
1 0 1 1 0 0 1
All you do is add everyone you see a 1, and the total is that binary number converted to decimal. So let's go step-by-step again:
64+16=80
80+8=88
88+1=89
And you're done.

Here's a picture of what a table would look like because making the correct spacing without the ability to have the extra spaces needed is hard. I know it's not straight, deal with it. http://img360.imageshack.us/img360/2729/binbq6.png
  Reply With Quote

 
Old 07-01-2008, 06:49 AM   #2 (permalink)
Wilfukguys Wilfukguys is offline Gender Male
Banned
 
Wilfukguys is offline
Join Date: Sep 2006
Location: MWHAHAHHAHA
Age: 18
Posts: 5,299
iTrader: 14 / 100%
Wilfukguys Is a Lord of AwesomenessWilfukguys Is a Lord of AwesomenessWilfukguys Is a Lord of AwesomenessWilfukguys Is a Lord of Awesomeness
Rep Power: 0
+rep (finally xDD)
  Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -7. The time now is 07:15 AM.


vBulletin skin developed by: eXtremepixels
The contents of this webpage are copyright © 2006-2008 GamingGutter.com. All Rights Reserved.

Page generated in 0.09225011 seconds (100.00% PHP - 0% MySQL) with 19 queries