Computer Science Canada turing to binary |
Author: | person [ Sun Jan 30, 2005 11:12 am ] |
Post subject: | turing to binary |
how do i convert turing code to binary, or binary to turing code by hand? |
Author: | Bacchus [ Sun Jan 30, 2005 11:13 am ] |
Post subject: | |
wat are you trying to do? see other ppls code still? |
Author: | person [ Sun Jan 30, 2005 11:29 am ] |
Post subject: | |
Quote: wat are you trying to do? see other ppls code still?
no, im just curious on how a computer works only reading binary btw, even if i were trying to see other ppls codes, this method would probably take too long |
Author: | Delos [ Sun Jan 30, 2005 11:44 am ] |
Post subject: | |
Well.... Considering that "Turing code" is nothing more than plain text, which an interpretter turns into instructions a computer can understand... You'd probably be working w/ ASCII here. Each character is assigned an 8-digit binary number (the first is used for something...umm...non-ID Related, AFAIK), so there's 128 possible characters. Of course, with more advanced things like Unicode and the like more than 128 are possible. Anyway, all of that is irrelevant. The point here is the that you convert any given character into a corresponding integer, and convert that integer into its binary equibalent. And there you have it. Text to binary. So good it's gotta be fattening. |
Author: | person [ Sun Jan 30, 2005 12:00 pm ] |
Post subject: | |
Quote: Well....
Considering that "Turing code" is nothing more than plain text, which an interpretter turns into instructions a computer can understand... You'd probably be working w/ ASCII here. Each character is assigned an 8-digit binary number (the first is used for something...umm...non-ID Related, AFAIK), so there's 128 possible characters. Of course, with more advanced things like Unicode and the like more than 128 are possible. Anyway, all of that is irrelevant. The point here is the that you convert any given character into a corresponding integer, and convert that integer into its binary equibalent. And there you have it. Text to binary. So good it's gotta be fattening. i sort of get it, but im also sort of slow, so can u give me an example of an alphabetical letter such as "a" converted into binary? thanx in advance |
Author: | basketball4ever [ Sun Jan 30, 2005 1:27 pm ] |
Post subject: | |
person wrote: Quote: Well....
Considering that "Turing code" is nothing more than plain text, which an interpretter turns into instructions a computer can understand... You'd probably be working w/ ASCII here. Each character is assigned an 8-digit binary number (the first is used for something...umm...non-ID Related, AFAIK), so there's 128 possible characters. Of course, with more advanced things like Unicode and the like more than 128 are possible. Anyway, all of that is irrelevant. The point here is the that you convert any given character into a corresponding integer, and convert that integer into its binary equibalent. And there you have it. Text to binary. So good it's gotta be fattening. i sort of get it, but im also sort of slow, so can u give me an example of an alphabetical letter such as "a" converted into binary? thanx in advance an easy way to learn binary (but i don't see why you actually want that) is to convert it using a binary converter. Theres ALOT of these on the web, just search on google, binary converter and u'll find one for sure, i guarntee it. As for why you need it, i think it actually might work, if you can convert a program into binary, then convert it back to text and play it on any other program language processor... meaning... if you get something in binary for turing... maybe you can even make it into a c++ game ![]() ![]() |
Author: | person [ Sun Jan 30, 2005 2:54 pm ] |
Post subject: | |
thanx, but i just want to know how to do it by hand |
Author: | basketball4ever [ Sun Jan 30, 2005 3:15 pm ] |
Post subject: | |
person wrote: thanx, but i just want to know how to do it by hand
a better question is... why would u want to do binary by hand... ??? i just dont see the point in that. |
Author: | md [ Sun Jan 30, 2005 3:36 pm ] |
Post subject: | |
turing is compiled to binary code by translating each turning instruction into one or more assembly instructions; which are then converted into binary strings which tell the cpu what to do. Just a note:Binary instructions are different for each procesor architecture. delos wrote: Well.... Considering that "Turing code" is nothing more than plain text, which an interpretter turns into instructions a computer can understand... You'd probably be working w/ ASCII here. Each character is assigned an 8-digit binary number (the first is used for something...umm...non-ID Related, AFAIK), so there's 128 possible characters. Of course, with more advanced things like Unicode and the like more than 128 are possible. Anyway, all of that is irrelevant. The point here is the that you convert any given character into a corresponding integer, and convert that integer into its binary equibalent. And there you have it. Text to binary. So good it's gotta be fattening. er... infact ASCII character are 8 bits becuase there are 256 possible characters... the standard simply defines the frist 128... and by converting a character into an integer all your doing is getting it's ascii code; which happens to be how it is stored anyway... and if you then store that in binary, guess what! you get THE VERY SAME BIT PATTERN THAT WAS USED TO REPRESENT THAT CHARACTER! Your description simple tells how to convert a text file to *GASP* A TEXT FILE! Bravo! basketball4ever wrote: an easy way to learn binary (but i don't see why you actually want that) is to convert it using a binary converter. Theres ALOT of these on the web, just search on google, binary converter and u'll find one for sure, i guarntee it. As for why you need it, i think it actually might work, if you can convert a program into binary, then convert it back to text and play it on any other program language processor... meaning... if you get something in binary for turing... maybe you can even make it into a c++ game Question though i also think thats useless and well... chances are it doesn't work Very Happy This does not work, not should it as it's based upon some VERY flawed ideas. However you say that you don't hink it should work, so I hold out some hope for you. As for the original question, you would need to know assembly, and probably the operating system's interfaces. Then you can translate turning to assembly, and then to binary. This will take you a VERY long time, as most turing instructions must be turned into a lot of assembly instructions. |
Author: | basketball4ever [ Sun Jan 30, 2005 4:49 pm ] |
Post subject: | |
Quote: This does not work, not should it as it's based upon some VERY flawed ideas. However you say that you don't hink it should work, so I hold out some hope for you.
![]() but if i were to someone hack into a program, and look at the binary functions. I'm sure theres a complier that rewrites the binary form, into a c++ or java format. It's not impossible, its just time consuming and not worth it.[/quote] |
Author: | person [ Sun Jan 30, 2005 4:56 pm ] |
Post subject: | |
can someone give me an example of turning something with an ASCII value of...o i dont know...lets say...97 into binary please, or where i can find an example of something turned into binary by hand. |
Author: | md [ Sun Jan 30, 2005 5:28 pm ] |
Post subject: | |
to turn ASCII text into binary strings simply turn each characters decimal number into a binary number... |
Author: | person [ Sun Jan 30, 2005 6:43 pm ] |
Post subject: | |
so let me get this straight, "10" in binary should be "111110", right? or would it be something else? ![]() |
Author: | basketball4ever [ Sun Jan 30, 2005 8:15 pm ] |
Post subject: | |
Nope. "10" is actually two binary numbers... 1 and 0. To make 10 ![]() 00110001 00110000 00110001 = 1 00110000 = 0 ![]() |
Author: | person [ Sun Jan 30, 2005 8:49 pm ] |
Post subject: | |
sorry, i meant an ASCII value of 10 EDIT: nvm, i know that my previous value was wrong |
Author: | cycro1234 [ Mon Jan 31, 2005 10:06 am ] |
Post subject: | |
If u got an ASCII converter and a binary converter, wouldn't ur life be much easier? |
Author: | person [ Mon Jan 31, 2005 10:11 am ] |
Post subject: | |
Quote: If u got an ASCII converter and a binary converter, wouldn't ur life be much easier?
it would, but i just wanted to learn how to do it by hand. and also, where would i get those converters now that uv mentioned it? ![]() |
Author: | cycro1234 [ Mon Jan 31, 2005 10:16 am ] |
Post subject: | |
Just go to www.google.ca and search for "Binary to text converter" and click "I'm Feeling Lucky" That should do it ![]() |
Author: | typon [ Mon Jan 31, 2005 2:36 pm ] |
Post subject: | |
uhh why would you do it in he first place? |
Author: | md [ Mon Jan 31, 2005 3:38 pm ] |
Post subject: | |
This entire thread seems kinda pointless... the OP didn't even give a good description of what he was trying to do, and his subsiquent posts have simply confused the issue. If you would like some information on a specific area then, by all means ask away, but please ask a specific question and stick to it. |
Author: | basketball4ever [ Mon Jan 31, 2005 3:41 pm ] |
Post subject: | |
its also weird... how this kinda question.. is postedin "turing Help" forum... this has nothing at all to do with turing... request: move/delete |
Author: | person [ Mon Jan 31, 2005 4:13 pm ] |
Post subject: | |
Quote: its also weird... how this kinda question.. is postedin "turing Help" forum... this has nothing at all to do with turing...
request: move/delete read the original question please |
Author: | basketball4ever [ Mon Jan 31, 2005 4:21 pm ] |
Post subject: | |
person wrote: Quote: its also weird... how this kinda question.. is postedin "turing Help" forum... this has nothing at all to do with turing...
request: move/delete read the original question please i read the orginial post, turing --> binary, binary --> turing. But its irrelevant to turing programming help. "Discussion of programming in Turing" i dont see how binary is gonna help you learn how to code/improve coding. |
Author: | Trojan Man [ Mon Jan 31, 2005 6:33 pm ] |
Post subject: | |
Quote: can someone give me an example of turning something with an ASCII value of...o i dont know...lets say...97 into binary please, or where i can find an example of something turned into binary by hand. 97 in binary code is 1100001. Quote: so let me get this straight, "10" in binary should be "111110", right? or would it be something else? 10 in binary code is 1010 Quote: sorry, i meant an ASCII value of 10 The ASCII value of 10 is 49, 48. Did you know that a simple command in Turing called ord does it? Quote: but if i were to someone hack into a program, and look at the binary functions. I'm sure theres a complier that rewrites the binary form, into a c++ or java format. It's not impossible, its just time consuming and not worth it. Its possible to convert from binary to c++ or java, etc. But, think about it. As cornflake said before the intrepeter of c++\java converts the code into assembly (a low level language), then converts into binary. Converting back is not that easy. Let's use a human language as an example. Let's say you have a sentence in chinese, then you convert into english, then into a language let's say sauvages used, then if you translate back you might not even get the main idea of the sentence. Besides: Quote: Binary instructions are different for each procesor architecture. Its actually quite simple to convert integers into binary. You just need to know the powers of 2. Here's one way: 97=64+32+1. 64(1 x 2 to the power of 6)+32(1 x 2 to the power of 5)+0 (0 x 2 to the power of 4)+0 (0 x 2 to the power of 3)+0 (0 x 2 to the power of 2)+0 (0 x 2 to the power of 1)+1 (1 x 2 to the power of 0). And then you just record what were the the numbers that you had to miltiply with to get the value (E.g: 64(1 x 2 to the power of 6) its "1" here). So this is how we get 1100001... If you understand this, you also understand what my signature says. By the way: you don't have to do this by hand, your Windows calculator can do it for you in like a thousandth of a second. |
Author: | basketball4ever [ Mon Jan 31, 2005 6:37 pm ] |
Post subject: | |
the binary stuff you said... isn't there a difference between what bit it is in... because i know theres various amounts of different types of binary? |
Author: | 1337_brad [ Mon Jan 31, 2005 6:53 pm ] |
Post subject: | There is know ASCII value for 10... |
There is no ASCII value for numbers since... they are alreayd numberS? o.o; ASCII values convert non-numerical values such as 'a' or the enter key, into numerical values. If you want an ASCII list, there is one in the turing help file. Now, if you want binary, just search on google "binary converter" and you will find tons of programs that convert text into binary. Although this would not work for the transforming turing into C++ because the Turing compiler does not change the actual code into binary (ie "put "hi"" is not converted) it reads these tags which have set commands in the compiler, and then a procedure in the compiler writes the actual computer code (in binary) to the computer... if that makes any sense I would be suprised, you see I know what I am saying, yet how to get it across in simple terms I have no clue. |
Author: | person [ Mon Jan 31, 2005 7:22 pm ] |
Post subject: | |
Quote: There is no ASCII value for numbers
of course there is 0 = 48 1 = 49 2 = 50 3 = 51 4 = 52 5 = .. 6 = .. 7 = .. 8 = .. 9 = 57 |
Author: | basketball4ever [ Mon Jan 31, 2005 7:27 pm ] |
Post subject: | |
1337_brad, person is right.... theres an ascii for every single thing you see on your keyboard. plus all the extended ascii stuff. |
Author: | [Gandalf] [ Tue Feb 01, 2005 12:37 pm ] |
Post subject: | |
Is there ASCII for Chinese letters? Or things like the *tm sign - would they be in there too? Or would it be just a "t" and a "m"? I don't really know much about ASCII except what it is and some of the letters/numbers. |
Author: | person [ Tue Feb 01, 2005 12:43 pm ] |
Post subject: | |
1) there is no ASCII value for chinese letters 2) ASCII is just a numerical value assigned to each button on the keyboard |
Author: | md [ Tue Feb 01, 2005 6:15 pm ] |
Post subject: | |
Trojan Man wrote: Its possible to convert from binary to c++ or java, etc. But, think about it. As cornflake said before the intrepeter of c++\java converts the code into assembly (a low level language), then converts into binary. Converting back is not that easy. Let's use a human language as an example. Let's say you have a sentence in chinese, then you convert into english, then into a language let's say sauvages used, then if you translate back you might not even get the main idea of the sentence. Besides: Quote: Binary instructions are different for each procesor architecture. It's actually a wee bit more complex than that... ![]() ![]() person wrote: 1) there is no ASCII value for chinese letters 2) ASCII is just a numerical value assigned to each button on the keyboard the ASCII standard specifies those characters needed to display common english text, and specific characters used to comunicating with serial devices. It has also been updated to include some layout and drawing characters (numbers 128-255). Not all the characters in the ASCII table are on your keyboard... There is another format that uses two bytes to represent characters. This is the standard used for languages that can't be written using the standard ASCII symblos (for some reason the name escapes me...); note that programs must specifically be written to use the double wide character format. basketball4ever wrote: the binary stuff you said... isn't there a difference between what bit it is in... because i know theres various amounts of different types of binary? I'm not sure exactly what you mean by this, but if you reword it I'll answer your question... |
Author: | typon [ Tue Feb 01, 2005 6:50 pm ] |
Post subject: | |
basketball4ever wrote: i know theres various amounts of different types of binary? not to be mean or anything, but ![]() |
Author: | basketball4ever [ Tue Feb 01, 2005 8:14 pm ] |
Post subject: | |
well ionno 1.i suck at binary 2. i dont care about binary but theres two different waysto write binary... 1. you write it out number by number so 10= binary for 1 binary for 0 or 2. your way which i never even heard of. tehrefore... its not a question, but a statement |
Author: | cycro1234 [ Tue Feb 01, 2005 8:19 pm ] |
Post subject: | |
01000011011110010110001101110010011011110000110100001010 <-- That's Cycro in binary ![]() |
Author: | Bacchus [ Tue Feb 01, 2005 9:31 pm ] |
Post subject: | |
what are the last 2 characters? you got 16 numbers to many for just Cycro |
Author: | cycro1234 [ Tue Feb 01, 2005 9:50 pm ] |
Post subject: | |
01000011 01111001 01100011 01110010 01101111 I got it off the internet :S |
Author: | Bacchus [ Tue Feb 01, 2005 9:55 pm ] |
Post subject: | |
ya thats right, but i dont kno how 2 other characters came with that (the last 16 0's and 1's) |
Author: | cycro1234 [ Tue Feb 01, 2005 10:31 pm ] |
Post subject: | |
I probly typed some extra characters by mistake, stupid tpyos :\ |
Author: | Bacchus [ Wed Feb 02, 2005 12:49 am ] |
Post subject: | |
here, this is a handy little binary converter i whipped up at midnight ![]() |
Author: | cycro1234 [ Wed Feb 02, 2005 11:29 am ] |
Post subject: | |
Cool program! Will be useful. I have an exam in about 1 hour and a half. WISH ME LUCK ![]() |
Author: | Bacchus [ Wed Feb 02, 2005 11:39 am ] |
Post subject: | |
lol i finished all mine (last one yesterday) and then a found out i got the highest on one of my exams ![]() |
Author: | person [ Wed Feb 02, 2005 11:51 am ] |
Post subject: | |
u should definitely but it under turing submissions this is actually quite useful |
Author: | Bacchus [ Wed Feb 02, 2005 12:19 pm ] |
Post subject: | |
ok will do, if ne one else needs it, it will be there instead of here |
Author: | cycro1234 [ Wed Feb 02, 2005 2:52 pm ] |
Post subject: | |
OK |
Author: | Trojan Man [ Thu Feb 03, 2005 2:52 pm ] |
Post subject: | |
Cornflake wrote: There is another format that uses two bytes to represent characters. This is the standard used for languages that can't be written using the standard ASCII symblos (for some reason the name escapes me...); note that programs must specifically be written to use the double wide character format. You mean like Unicode? Cycro wrote: 01000011011110010110001101110010011011110000110100001010 01000011 01111001 01100011 01110010 01101111 ![]() |
Author: | cycro1234 [ Thu Feb 03, 2005 3:04 pm ] |
Post subject: | |
%43%79%63%72%6F That's Cycro in hexadecimal ![]() |
Author: | md [ Thu Feb 03, 2005 3:32 pm ] |
Post subject: | |
Trojan Man wrote: Cornflake wrote: There is another format that uses two bytes to represent characters. This is the standard used for languages that can't be written using the standard ASCII symblos (for some reason the name escapes me...); note that programs must specifically be written to use the double wide character format. You mean like Unicode? That's the one, for some reason I just couldn't remember the name ![]() |
Author: | Zaneo [ Tue Dec 16, 2008 9:04 pm ] |
Post subject: | RE:turing to binary |
Converting Decimal "base ten" to binary. e.g. 50=110010 50/2= 25 no remainder so =0 25/2= 12 with one remainder =1 12/2= 6 no remainder so =0 6/2 = 3 no reaminder so =0 3/2 = 1 with one remainder =1 1/2 = 0 with one remainder =1 Then you take the last one and make it the first so, 010011 becomes 110010 You divide it to the nearest whole, and carry the remainder. |