

07302006, 04:09 PM

#1

Daemon Poster
Join Date: Nov 2004
Posts: 1,246

Binary / Machine Language
With the amount of computer geeks on here (including myself) someone should be able to help me :P. Im trying to understand processors to its full extent. And i'm starting out by getting an understanding of binary, how it works, and how you use it.
I can count in binary (check me out)
Quote:
Originally Posted by "me counting in binary :D
0  0
1  1
2  10
3  11
4  100
5  101
6  110
7  111
8  1000
9  1001
10  1010

Anyways is their a trick to using your logic to determine the binary value of a random decimal number? Like if I were doing addition, and added these to binary numbers "1001 [9]" to "1000 [8]" which i know is 17, is their anyway of manually finding out what the binary equivalent of 17 is without counting all the way up to 17 in binary?
__________________
__________________
Karma/rep is always appreciated
01010010011001010110010001100010011001010110000101 11001001100100
010011110111010101110100
There are only 10 kinds of people in this world. Those who can read binary, and those who can't.



07302006, 04:24 PM

#2

Fully Optimized
Join Date: May 2005
Posts: 4,775

Re: Binary / Machine Language
yeah there is a way but it's not exactly as mathematical as you might think. This is the method that I use. To convert a number like 17 to binary you need to divide by 2 until you reach 0 and take note of whether or not 2 divides in evenly (is there a remainder or not?). Here is how it is done:
17/2 = 8 R(remainder)1
8/2 = 4 R 0
4/2 = 2 R 0
2/2 = 1 R 0
1/2 = 0 R 1 > and this is where you would stop dividing because you get a zero
You then take all remainders starting from the last one and writing them down backwards to get '10001'.
And here's 100 for another example:
100/2 = 50 R 0
50/2 = 25 R 0
25/2 = 12 R 1
12/2 = 6 R 0
6/2 = 3 R 0
3/2 = 1 R 1
1/2 = 0 R 1
And you get '1100100'
__________________
__________________
Killing under the cloak of war is no different than murder
Kein Alkohol ist auch keine Lösung!



07302006, 05:16 PM

#3

Daemon Poster
Join Date: Nov 2004
Posts: 1,246

Re: Binary / Machine Language
wow, thats ingenuis. did you think of that yourself? or did you get that from a website? haha i've been playing around with that looking for exceptions but it seem to work. thanks for the neat trick.
EDIT:
wait... if i wanted to convert to say, o iunno, base 3 system, would i just divide by 3 and use the same trick with the remainders? seems to work right?
does anyone know any tricks for multiplying, or dividing binary numbers?
__________________
Karma/rep is always appreciated
01010010011001010110010001100010011001010110000101 11001001100100
010011110111010101110100
There are only 10 kinds of people in this world. Those who can read binary, and those who can't.



07302006, 08:52 PM

#4

Fully Optimized
Join Date: May 2005
Posts: 4,775

Re: Binary / Machine Language
naw, i didnt think of it myself although it would have been impressive to say that i did! That's something i've learned in university (yes i learned something!). I'm a second year computer science major.
If I can remember correctly there may be a different approach needed to use different bases (unless you say you've got the base 3 working the same way). However using, say, hexadecimal requires a little bit of a modified version (which of course I can't remember at the moment but i can dig it up if you want).
I think to multiply and divide would be much easier to just convert the binary to base 10 and do it like normal then convert back to binary because I can't think of a simple way to do it differently.
__________________
Killing under the cloak of war is no different than murder
Kein Alkohol ist auch keine Lösung!



07302006, 09:11 PM

#5

Daemon Poster
Join Date: Nov 2004
Posts: 1,246

Re: Binary / Machine Language
wow a computer science major? i dont know how much you know about processors, and their architechture in particular. I'm not sure if your computer science courses cover hardware, but if any of your books you have have any diagrams of a detailed architechture of any aspect of an actual processor that would be cool. not just the blackboxes, but a small portion of the blueprints of the actual gates and transistors on the processor. i've started a new thread on the subject in the processors section so if you know anything please post their!
__________________
Karma/rep is always appreciated
01010010011001010110010001100010011001010110000101 11001001100100
010011110111010101110100
There are only 10 kinds of people in this world. Those who can read binary, and those who can't.



07302006, 09:16 PM

#6

Fully Optimized
Join Date: May 2005
Posts: 4,775

Re: Binary / Machine Language
Quote:
Originally Posted by mayorredbeard
wow a computer science major? i dont know how much you know about processors, and their architechture in particular. I'm not sure if your computer science courses cover hardware, but if any of your books you have have any diagrams of a detailed architechture of any aspect of an actual processor that would be cool. not just the blackboxes, but a small portion of the blueprints of the actual gates and transistors on the processor. i've started a new thread on the subject in the processors section so if you know anything please post their!

Well, i will be able to help you....but that is of course the future tense. I have a course called Computer Architecture that I will be taking but it won't be until my second semester (which will not be until next year). I think that will cover what you are asking about but as you have already figured out im sure, I cant help you on that yet. I've only officially completed one year of university so my knowledge is still quite insufficient on the subject.
__________________
Killing under the cloak of war is no different than murder
Kein Alkohol ist auch keine Lösung!



08012006, 09:38 PM

#7

Bogan
Join Date: Feb 2006
Location: Australia
Posts: 8,471

Re: Binary / Machine Language
will i have 2 know all this 4 my Computing course????=(
__________________
Desktop:BitFenix Survivor~Gigabyte GAP67AUD3R~ i7 2600K @ 4hz~AMD 6870 1GB~12gb Team Elite DDR3 1333~3xWD In RAID5~W7 Ult
Laptop:Alienware M11x~ i72637M 1.7GHz~16GB 1333MHz DDR3~GeForce GT 540M~W7 Ult



08012006, 09:40 PM

#8

Daemon Poster
Join Date: Jan 2005
Posts: 609

Re: Binary / Machine Language
Uh, can't you add the binary digits together?
1001
+1000
_____
10001
__________________
Athlon FX55 San Diego 2.6GhZ OCed to 3.0GhZ  Mushkin Redline XP 2x1GB PC4000 DDR500 3328 OCed to 250MhZ  Seagate Barracuda SATA 400GB 7200RPM HDD  evGA GeForce 6800GT 350/1000 OCed to 425/1150



08012006, 10:45 PM

#9

Fully Optimized
Join Date: May 2005
Posts: 4,775

Re: Binary / Machine Language
Quote:
Originally Posted by Kuberr
Uh, can't you add the binary digits together?
1001
+1000
_____
10001

yes, there is a little bit more to know about adding and subtracting in binary but what you've got there is correct.
__________________
Killing under the cloak of war is no different than murder
Kein Alkohol ist auch keine Lösung!



08012006, 11:05 PM

#10

Daemon Poster
Join Date: Nov 2004
Posts: 1,246

Re: Binary / Machine Language
peforming mathematical operations in binary itself seems kind of silly, much easier just to convert using these lil tricks and do it in our decimal system.
is their a trick for going from binary to decimal? i tried doing your trick backwards, but that doesnt really work out :p
__________________
__________________
Karma/rep is always appreciated
01010010011001010110010001100010011001010110000101 11001001100100
010011110111010101110100
There are only 10 kinds of people in this world. Those who can read binary, and those who can't.





Thread Tools 
Search this Thread 


Display Modes 
Linear Mode

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off




» Recent Threads 
















