So -- This is a programming language?

Started by
9 comments, last by Xai 15 years, 3 months ago
I'm a beginner. But I've been reading over some books, documents.. I want to make sure this is all correct. My computer only understands 1's and 0's In order to make my life easier, programming languages are invented, and one statement in a programming language, is equivalent to many 1's and 0's, since the compiler will decode them? If this is correct, I would also like some additional information, on how to better understand computers and their native language.
Advertisement
yep you are right. I can't tell you much more because I am somewhat of a beginner myself though.

What I can tell you is that people still sometimes use the ones and zeros whlie using a language. This is called binary code. while our number system is base 10. Meaning we use the numbers 0-9 to write it. Binary is base 2. This is much closer to how a computer thinks because all a computer really knows is if one of its (I believe it is called a tranzistor) is switched on or off.

hope this helps a little.

---------------------------------------------------------------------------------------Exercise, eat right and be the best you can be!Translation: Play video games for finger streangth and eat lots of hot pockets to be at top programming efficiency.
You may enjoy reading Evolution of Programming Languages and Binary - So Simple a Computer Can Do It.

Yes, like steveworks said, a computer is basically a bunch of tiny "switches". A switch is either on (1), or off (0), so a lot of on/off switches are written with 1's and 0's. The computer reads these 1's and 0's to know what switches it should turn on and off.
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
The 1s and 0s make up what is called machine language. The language is different for each processor type. When a processor is designed a machine language is created for that processor to implement. For any given machine language an assembly language can be derived. An assembly language is a more human readable version of the machine language. A single assembly instruction is converted to a single machine language instruction. In a language like c++ a single instruction can be converted to multiple assembly instructions.
My current game project Platform RPG
Quote:Original post by steveworks
...while our number system is base 10.

Funny you should mention that, because every number system is base 10! You just have to read that "10" using that number system. (Ex. in Binary 10 = 2 decimal, in hex 10 = 16 decimal, etc.)

Quote:Original post by bschneid
Quote:Original post by steveworks
...while our number system is base 10.

Funny you should mention that, because every number system is base 10! You just have to read that "10" using that number system. (Ex. in Binary 10 = 2 decimal, in hex 10 = 16 decimal, etc.)


[EDIT - Ignore the below]

No it isn't. The term base X corresponds to the number of unique states that a single digit can be in, or the number of values you can represent in a single column, hence 0-9 in our normal system is base 10, 0 and 1 in binary is base 2, 0-9 + A-F is base 16 in hexadecimal and so on.

Isodream - another thing to understand is that it is not literally 1's and 0's or even "on" and "off" that computers work with.

The concept of 1 and 0 refers to the distinction between two different levels of current. Electronics types would refer to these as high and low. Interestingly, on some hardware, the high state of current can represent 0 and the low state 1.

[Edited by - EasilyConfused on December 31, 2008 12:38:18 PM]
Quote:Original post by EasilyConfused
No it isn't. The term base X corresponds to the number of unique states that a single digit can be in, or the number of values you can represent in a single column, hence 0-9 in our normal system is base 10, 0 and 1 in binary is base 2, 0-9 + A-F is base 16 in hexadecimal and so on.


You missed his point; two in binary is written 10; sixteen in hexadecimal is written 10, etc. So every base is base 10 in its own notation - it just isn't base ten :)

Quote:Isodream - another thing to understand is that it is not literally 1's and 0's or even "on" and "off" that computers work with.


I can't imagine what it would even mean to "work with literal 1's and 0's". Numbers aren't tangible objects, after all. :)

Quote:The concept of 1 and 0 refers to the distinction between two different levels of current. Electronics types would refer to these as high and low. Interestingly, on some hardware, the high state of current can represent 0 and the low state 1.


Er, you mean levels of voltage.

To the OP: To understand this stuff properly requires taking a course in university. Fortunately, it is completely unnecessary to understand it in order to learn programming.
Quote:Original post by EasilyConfused
Quote:Original post by bschneid
Quote:Original post by steveworks
...while our number system is base 10.

Funny you should mention that, because every number system is base 10! You just have to read that "10" using that number system. (Ex. in Binary 10 = 2 decimal, in hex 10 = 16 decimal, etc.)


No it isn't. The term base X corresponds to the number of unique states that a single digit can be in, or the number of values you can represent in a single column, hence 0-9 in our normal system is base 10, 0 and 1 in binary is base 2, 0-9 + A-F is base 16 in hexadecimal and so on.

0-9 is base 10.
0-1 is base 10. 10 in that system means 2 in base 10 system.
0-F is base 10. 10 in that system means 16 in base 10 system.

Got it?
If you are really interested in this stuff, you should read
"Code: The Hidden Language of Computer Hardware and Software" by Charles Petzold
Ah. My apologies to bschneid. Subtle but important distinction between base 10 and base ten. [smile]

This topic is closed to new replies.

Advertisement