PDA

View Full Version : binary



Pages : [1] 2

webturtle0
11-28-2002, 08:45 PM
I've always wondered, is binary a programming language? I always thought it was.

neo_strife
11-28-2002, 09:10 PM
Binary is the lowest form of code and the only thing computers can really understand. I think it is a programming language however not a practical one. It would take way to long to write a decent program in binary.

Eibro
11-28-2002, 09:46 PM
Enter assembler.
Assembler is a simplified version of programming in pure "binary". Basically a search-and-replace with macros representing different CPU operatons. That's about as low as most people go.

Polymorphic OOP
11-28-2002, 10:11 PM
Originally posted by neo_strife
I think it is a programming language however not a practical one.

Binary is in no way a programming language.

If you were to consider binary a language, then you'd just as well be saying that the arabic base 10 number system was a programming language. Binary just happens to be the medium.

npc
11-29-2002, 12:25 AM
in terms of the computer, "binary" usually refers to either the binary number system (as poly mentions), or actual bits ('0' and '1'). in terms of bits, "binary" then can mean data that a program would use, or the actual cpu instructions that make up that program. so in a sense, yes, "binary" can be thought of as a programming language (although many might object to this claim). basically when you design a cpu, you also must provide a set of instructions for this cpu. without too much detail, a cpu consists of some internal memory ("registers", to temporarily store binary data), an alu (which peforms arithmetic and logic operations on binary data), an input/output unit (to exchange data with the outside world) and a control unit. it this control unit that the set of instructions, you provide for your cpu, depend upon. this control unit basically manages the way binary data moves about between these various units mentioned above (alu, registers, i/o, ...). it would be nice for a programmer to be able to tell the control unit what to do (for example, take this binary data which represents some number, give it to the alu and tell the alu to multiply this number by 2, then send the result over to the main memory at such and such memory address...). thus you design your control unit to be able to accept various instructions that perform these operations, that a programmer would like a cpu to do. when designing your control unit, you find it best to represent these instructions as "binary" strings (strings of '0's and '1's, i.e. 1001101101), after all your cpu can only understand binary (so in this case, you design a decoding unit to decode these binary strings into control signals that perform operations that programmers would like cpu's to do).

so in that sense, yes, "binary" could be thought of as a programming language. you have this cpu that comes with a set of instructions that it can execute. these instructions are encoded as binary strings. you create a program composed out of these cpu instructions and store them in memory. set up the cpu to start executing the first instruction, and let her rip.
really this is what assembly language is. we would create this "assembly" language for our cpu that would represent these instructions encoded as binary strings in a nicer way
(i.e. "0011011001011001" vs. "move.b #5,d0"; 16-bit cpu in this case). in this sense, neo_strife is correct in thinking that programming in binary is not practical.

Polymorphic OOP
11-29-2002, 12:33 AM
No, that's like saying our alphabet is a language.

Just because you can use the alphabet to create a language doesn't make it a language by itself! The alphabet is simply a medium upon which languages can be created. They are two entirely different things.

npc
11-29-2002, 12:53 AM
that's a good point. i supposed then that the language would really be defined in terms of its grammar (for rules to produce meaningful sentences), rather than the actual alphabet (or binary strings) it uses. but then why do some people say "assembly language" when assembly language is really nothing but a set of symbols with a one-to-one correspondence with the instructions of a particular cpu? you cannot create new cpu instructions out of the blue using some grammar of a language, there are only a finite number of sentences (instructions). perhaps it is an abuse of the word "language" in this case?

Polymorphic OOP
11-29-2002, 01:13 AM
That's because the cpu provides the language which uses the "alphabet" and numbering system of binary. Assembly languages are just a more abstract language that get converted to the cpu's language.

So you could look at different machine code and assembly languages as languages, just not binary.

If I said write a narrative in english, you could do it.

If I said write a narrative in italian, you could do it.

If i said write a narrative using the letters A through Z, you could write in spanish, italian, english, etc. (that is, if they actually did have the exact same alphabet). But then, when someone said "read that narrative in the language defined by the letters A through Z" you can interperet that as any of the languages above (and an infinite number of others)

Now -- if you said write a program in x86 Assembly, you could do it.

If you said write a program using a particular type of machine code, you could do it.

If you said write a program in binary, what would one do? Like the "A through Z" example you are stuck, only in this case it's even more cryptic, because a number system has no beginning or end, while an alphabet does.

That's why machine code can be looked at as languages and that's why assembly languages are considered languages, and that's why binary is not. It's when you can take a medium such as an alphabet or a nubmer system and use it in such a way that you define what combinations of "letters" mean, and grammar, etc. that it becomes a language.

npc
11-29-2002, 01:41 AM
poly you are right, thanks for the insight.

Polymorphic OOP
11-29-2002, 01:45 AM
no problem, npc, it's a common misconception. I just think it's kind of neat why things are called what they are. Glad I was actually able to explain the reasoning behind it.

Cgawd
11-29-2002, 09:45 AM
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=binary

Eibro
11-29-2002, 09:50 AM
Originally posted by Cgawd
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=binary
Wow, that helps! Thanks! Wait, no it doesn't. It has no relevance on the original question. Like someone said, binary is the medium, and all that link to google is going to provide is information about binary; NOT opcodes or programming with binary.

Posts++ I guess. See if you can get 100 in one day, maybe you'll overtake Ride -or- die.

Cgawd
11-29-2002, 09:53 AM
maybe you'll overtake Ride -or- die.

hehe , im not trying to up my post count, and if you actually click on some of those links you would see the answer to the question. jeese, some people:rolleyes:

adrianxw
11-29-2002, 01:59 PM
How do you thing people entered code into machines before they had cute languages/assemblers to make it easier?

I can well remember long sessions in front of a desk with a big row of up/down switches, where you set the switches and then pressed the "Clk" button to read that BINARY in, and repeat for HOURS. Then when you figured you'd got it all in right, you pressed "Exec" or something and watched while nothing happened.

Of course you can program in binary, (or hex if you have the relative luxury of a hex keypad).

Brian
11-29-2002, 04:34 PM
binary isn't the only way you can write programs at the lowest level
you could write programs in hex i guess since one hex character will represent one half-byte

so FF
would be
1111 1111

hexedecimal makes things so much easier.


on another note, a simple hello world program written in dos debug can be as small as 23 bytes, but one compiled in mingw is 11905 bytes. So if everybody who wrote hello world programs had written them in assembler, that would be a saving of many megabytes. yay.

Eibro
11-29-2002, 05:00 PM
Originally posted by adrianxw
How do you thing people entered code into machines before they had cute languages/assemblers to make it easier?

I can well remember long sessions in front of a desk with a big row of up/down switches, where you set the switches and then pressed the "Clk" button to read that BINARY in, and repeat for HOURS. Then when you figured you'd got it all in right, you pressed "Exec" or something and watched while nothing happened.

Of course you can program in binary, (or hex if you have the relative luxury of a hex keypad).
You ancient programmers and your crazy stories. Have any others? :)

Magos
11-29-2002, 05:49 PM
Originally posted by adrianxw
How do you thing people entered code into machines before they had cute languages/assemblers to make it easier?

I can well remember long sessions in front of a desk with a big row of up/down switches, where you set the switches and then pressed the "Clk" button to read that BINARY in, and repeat for HOURS. Then when you figured you'd got it all in right, you pressed "Exec" or something and watched while nothing happened.
You don't try lots of random combinations when programming low level circuits, there is a lot of fine math behind that.
That would be the same as randomizing lots of letters hoping it would end up in a C/C++ program...

lightatdawn
11-29-2002, 06:42 PM
I can well remember long sessions in front of a desk with a big row of up/down switches, where you set the switches and then pressed the "Clk" button to read that BINARY in, and repeat for HOURS. Then when you figured you'd got it all in right, you pressed "Exec" or something and watched while nothing happened.

I follow a simular process with my VC compiler.

Long sessions in front of a desk... Check.
Repeat for hours... Check.
Press 'Exec' when you figure you got it right... Check.

But then the 'nothing happening' part is replaced by a horrible display of cascading errors and eventual system lock and crash resulting in multiple reboots and backup restorations. Just goes to show how much better we've got it now, hey? None of this 'nothing happened' junk. Pfft. Whos got time for that?

adrianxw
11-30-2002, 03:44 AM
>>> I follow a simular process with my VC compiler.

Yeah, that's about right!

>>> Have any others?

How about this. Another system I used many years ago, (a Ferranti Argus computer), was programmed, (again in binary), by pulling out trays each of which was a large matrix of small round holes. To program the thing, you put a small ferrite bead in a hole to make a 0, or left it empty to make a 1. A small design flaw with the system meant you could pull the tray out all the way thus the back fell to the floor and all the little beads fell out and rolled away.

>>> >>> Have any others?

Dozens probably - give me my 2.5 GHz P4, and my VC++ any day. The old systems were fun at times, but for the most were tedious, irritating and unreliable.

BTW...

>>> ancient programmers

I am not ancient yet, I may be older than some in here, true.

adamviper
12-02-2002, 07:21 AM
Well you will never learn binary and i feel that it is a programing language.

Polymorphic OOP
12-02-2002, 07:39 AM
Well than you missed the whole first part of the topic. It's not a matter of opinion -- Binary is not a language, it's just a nubmer system on which languages can be formed.

sentienttoaster
12-02-2002, 12:41 PM
Originally posted by Polymorphic OOP
Well than you missed the whole first part of the topic. It's not a matter of opinion -- Binary is not a language, it's just a nubmer system on which languages can be formed.

Binary is one of our first programming languages, aside from machine and assembly. More modern languages evolved from those three, and eventually became more text based programming. Just because binary is numbers, doesn't mean that it isn't a language. We write c/c++ with words. By your reasoning, using "cout<<" cannot be deemed a language. see where I'm going with this?

Polymorphic OOP
12-02-2002, 01:25 PM
Yes, actually it does mean it's not a language, as I already explained if you would have happened to read my earlier posts in this topic.

If you think that binary is a language, than you DON'T have an understanding of what it really is.

Binary is a medium where other languages are formed. If you can't undestand that after my explanations at the beginning of the topic, then, well, get help.

There is no binary language. There's machine codes, assembly languages, etc. If you think binary is a language then you probably falsly think of machine code as "binary language."

webturtle0
12-02-2002, 01:33 PM
Originally posted by Polymorphic OOP
Yes, actually it does mean it's not a language, as I already explained if you would have happened to read my earlier posts in this topic.

If you think that binary is a language, than you DON'T have an understanding of what it really is.

Binary is a medium where other languages are formed. If you can't undestand that after my explanations at the beginning of the topic, then, well, get help.

There is no binary language. There's machine codes, assembly languages, etc. If you think binary is a language then you probably falsly think of machine code as "binary language."

How very true.

adamviper
12-02-2002, 01:39 PM
toaster you are kinda right but your crazy

Fordy
12-02-2002, 02:30 PM
Hmm....

Polymorphic OOP
12-02-2002, 02:33 PM
ha

Magos
12-02-2002, 03:08 PM
http://www.hyperdictionary.com/dictionary/binary


binary
5 entries found.

From Webster's Revised Unabridged Dictionary (1913) [web1913]

Binary \Bi"na*ry\, a. [L. binarius, fr. bini two by two, two at
a time, fr. root of bis twice; akin to E. two: cf. F.
binaire.]
Compounded or consisting of two things or parts;
characterized by two (things).

{Binary arithmetic}, that in which numbers are expressed
according to the binary scale, or in which two figures
only, 0 and 1, are used, in lieu of ten; the cipher
multiplying everything by two, as in common arithmetic by
ten. Thus, 1 is one; 10 is two; 11 is three; 100 is four,
etc. --Davies & Peck.

{Binary compound} (Chem.), a compound of two elements, or of
an element and a compound performing the function of an
element, or of two compounds performing the function of
elements.

{Binary logarithms}, a system of logarithms devised by Euler
for facilitating musical calculations, in which 1 is the
logarithm of 2, instead of 10, as in the common
logarithms, and the modulus 1.442695 instead of .43429448.


{Binary measure} (Mus.), measure divisible by two or four;
common time.

{Binary nomenclature} (Nat. Hist.), nomenclature in which the
names designate both genus and species.

{Binary scale} (Arith.), a uniform scale of notation whose
ratio is two.

{Binary star} (Astron.), a double star whose members have a
revolution round their common center of gravity.

{Binary theory} (Chem.), the theory that all chemical
compounds consist of two constituents of opposite and
unlike qualities.

From Webster's Revised Unabridged Dictionary (1913) [web1913]

Binary \Bi"na*ry\, n.
That which is constituted of two figures, things, or parts;
two; duality. --Fotherby.

From WordNet (r) 1.6 [wn]

binary
adj 1: of or pertaining to a number system have 2 as its base; "a
binary digit"
2: consisting of two (units or components or elements or terms)
or based on two; "a binary star is a system in which two
stars revolve around each other"; "a binary compound";
"the binary number system has two as its base"
n : a system of two stars that revolve around each other under
their mutual gravitation [syn: {binary star}, {double
star}]

From The Free On-line Dictionary of Computing (13 Mar 01) [foldoc]

binary

1. <mathematics> {Base} two. A number representation
consisting of zeros and ones used by practically all computers
because of its ease of implementation using digital
electronics and {Boolean algebra}.

2. <file format> Any file format for {digital} {data} encoded
as a sequence of {bit}s but not consisting of a sequence of
printable {characters} ({text}). The term is often used for
executable {machine code}.

Of course all digital data, including characters, is actually
binary data (unless it uses some (rare) system with more than
two discrete levels) but the distinction between binary and
text is well established.

3. <programming> A description of an {operator} which takes
two {arguments}. See also {unary}, {ternary}.

(1998-07-29)



From Internet Dictionary Project [idp_italian]

binary
binario

Sebastiani
12-02-2002, 03:15 PM
Poly, what is meant by programming in binary "as a language" is simply to write the opcodes and such out in their rawest form. I had an uncle that programmed oil-refinery equipment this way back in the 50's. This was literally writing a program like:
3F 99 5B A2, etc.
The fact that the term binary refers to the number system, as well as the data streams associated with computing doesn't invalidate this use of the word.

Polymorphic OOP
12-02-2002, 07:03 PM
Yes, it does, because there is no BINARY LANGAUGE. If there was a binary language you could program in it, but you can't. You can program in machine code, but that varies. The machine codes are different languages, NOT binary.

You write with letters, that doesn't make our ALPHABET a language, does it? Just because you can deal with the language in binary doesn't mean a thing.

dP munky
12-02-2002, 07:40 PM
if real programmers program in binary, how come what he's programming, translates to (4 ?

Krush
12-02-2002, 07:45 PM
110101010101010111000110011001010100110010100100 ?

0101010101011000011100 !!!!!!

dP munky
12-02-2002, 07:50 PM
01101011011100100111010101110011011010000010110000 10000001111001011011110111010100100000011000010111 00100110010100100000011000010010000001100011011011 11011011010111000001101100011001010111010001100101 00100000011001100111010101100011011010110111010001 1000010111001001100100

hey krush what the hell does UeLUX mean??

jdinger
12-02-2002, 08:39 PM
Originally posted by Polymorphic OOP
Yes, it does, because there is no BINARY LANGAUGE. If there was a binary language you could program in it, but you can't. You can program in machine code, but that varies. The machine codes are different languages, NOT binary.

You write with letters, that doesn't make our ALPHABET a language, does it? Just because you can deal with the language in binary doesn't mean a thing.

But you're mistakenly using the arguement that the alphabet is seperate from the language that a person can write a the same information using the letters A-Z (standard english alphabet) and write the same thing in any other language using those letters when in fact many of the world's languages have their own unique alphabets.

True I can write something in english with A-Z and then re-write MOST of it in german, but the german alphabet has letters that aren't included in the english alphabet.

Polymorphic OOP
12-02-2002, 10:16 PM
The alphabet is not completely separate from a language, but that does NOT make them the same thing. The alphabet is of course related but they are in not way anywhere near both langauges. A language means that you have to have a way of understanding the code that is written universally.

If someone writes out a series of binary bits and asked you to interperet what it meant, you can't say for certain.

However, if someone writes out a series of binary bits and says "this is in this particular type of machine code," then you could do it. The machine code is the language, the binary is just the medium.

You can rewrite the binary in HEX -- does that make hexadecimal a language? You can rewrite the hex in the arabic base 10 number system.

For instance -- if binary were a language, you would be able to tell me, without a doubt, what this meant

1101000101101010111

The fact of the matter is, you have no idea. The fact that it's binary means nothing. It's just the medium for communication.

Now, tell me what this means:

874463692348572

It's a number, just like binary. You can use binary, hexadecimal, or decimal as an "alphabet," but that doesn't change the fact that it, itself, is not a language.

Binary is not a language because by itself it IS just a number system. Many different languages can be made using a number system, but that doesn't make it a language itself.

If you don't understand it by now, I'll repeat it many many many more times. Calling binary a "programming language" is not valid by any means.

no-one
12-02-2002, 11:00 PM
i think we need Sayeh or Salem to open a can of woopass in here since none of you seem to take a gentle hint from those who've already tried.

your arguements are pure semantics...

dP munky
12-03-2002, 01:38 AM
:confused: :confused: :confused: who's arguments??? :confused: :confused: :confused:

adrianxw
12-03-2002, 06:57 AM
>>> your arguements are pure semantics...

Correct.

If you have no means of entering a program other than by entering raw binary, then you are programming in binary. True, the binary represents machine code instructions, but equally, machine code instructions could be said to represent binary. Semantics.

dP munky
12-03-2002, 01:02 PM
but binary in and of itself is not a language

mepaco
12-03-2002, 01:44 PM
Binary is not a programming language. In fact, by definition, if you are programming in binary codes you are not using a programming language. Here are the definitions:


machine language
n.
A set of instructions for a specific central processing unit, designed to be usable by a computer without being translated. Also called machine code.



programming language
n.
An artificial language used to write instructions that can be translated into machine language and then executed by a computer.


Since a programming language is an aritifical language that can be TRANSLATED into machine language then programming in binary is not using a programming language. Binary is a number system, nothing more nothing less.

Sebastiani
12-03-2002, 02:03 PM
If I were to say to you "I am programming in assembly" one might argue that I am "using assembly" not "in assembly". Why split hairs? Context is more important than technicality, you know.

mepaco
12-03-2002, 02:13 PM
Assembly is a language that has correspondence to binary numbers. Assembly requires translation, though it is a one-to-one translation. Binary is a number system.


I've always wondered, is binary a programming language? I always thought it was.

We split hairs because the question was asked.

lightatdawn
12-03-2002, 02:25 PM
>>Why split hairs? Context is more important than technicality, you know.

Finally; Someone said it. You people ever feel like going outside? ;)

You know you've been programming too much, and actually interacting with your own species too little, when you get worked up about the possible definitions of binary in its various possible uses.

No, really: Go. Out. Side. ... Now.

j/k Peace

>>We split hairs because the question was asked.

Its a good a reason as any.

no-one
12-03-2002, 07:36 PM
>No, really: Go. Out. Side. ... Now.

no no no!! its freezing out there...

webturtle0
12-04-2002, 10:57 AM
Originally posted by lightatdawn
>>We split hairs because the question was asked.

Its a good a reason as any.

And I still didn't get a straight answer....

dP munky
12-04-2002, 12:34 PM
Originally posted by Polymorphic OOP
Binary is in no way a programming language.

If you were to consider binary a language, then you'd just as well be saying that the arabic base 10 number system was a programming language. Binary just happens to be the medium.

i thought he made it pretty clear w/this quote right here!

Sebastiani
12-04-2002, 02:50 PM
>>And I still didn't get a straight answer....

Sure you did. It's not a language. However, the term is sometimes used to refer to machine level programming.

DavidP
12-04-2002, 04:29 PM
Well than you missed the whole first part of the topic. It's not a matter of opinion -- Binary is not a language, it's just a nubmer system on which languages can be formed.


Stop being so anal, Poly. Binary is not only a number system, but in the computer world it is also a slang form of machine code. We all know that officially the lowest level of programming is "machine code", but we like to call it binary. So just stop being so anal about it.

Oh and also, in objection one of your earlier posts, you made an analogy to binary being the alphabet. No it's not. 1 and 0 is the alphabet, just like A and B. Binary is the "language" that uses the alphabet. Ha.

DavidP
12-04-2002, 04:39 PM
For instance -- if binary were a language, you would be able to tell me, without a doubt, what this meant

1101000101101010111


your right i cant because im not fluent in binary...but i sure can tell you what this means:

10111000000100110000000011001101000100001011101000 00011001011110011111111100000000101110100000000000 00000010001000110010001100110100010000111000101111 10101011010011001101000101101011100000000011000000 0011001101000100001100110100100001

what it means:

initialize 13h
call put pixel function
start loop
tell coordinates and color of pixel
plot pixel
go back to start of loop until loop counter hits 0
wait until a key is pressed
go back to text mode
end program

Polymorphic OOP
12-04-2002, 05:25 PM
Originally posted by DavidP
Stop being so anal, Poly.

We're being anal because the question asked was very specific -- is binary a language?

The answer is no!


Originally posted by DavidP
your right i cant because im not fluent in binary...but i sure can tell you what this means:

10111000000100110000000011001101000100001011101000
00011001011110011111111100000000101110100000000000
00000010001000110010001100110100010000111000101111
10101011010011001101000101101011100000000011000000
0011001101000100001100110100100001

what it means:

initialize 13h
call put pixel function
start loop
tell coordinates and color of pixel
plot pixel
go back to start of loop until loop counter hits 0
wait until a key is pressed
go back to text mode
end program

No, in binary it's a number. Even if you were to say "binary is slang for machine code" the fact is that not all "machine code" is the same. Saying "the value above in binary means [such and such] set of instructions in the programming language of binary" is not accurate at all. Not all "machine code" is the same. If you were to say "in this type of machine code, this means..." then you would be accurate. It's not even being that anal! It's just like the analogy between an alphabet and a language. If you understand that, then I can't see how you don't understand this.