| | |
Role of Binary
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
![]() |
•
•
Join Date: Jun 2009
Posts: 62
Reputation:
Solved Threads: 4
I'm going to try to say this simply and not go to deply into it.
Computer can only count 1 or 0. Because a computer can send an electrical message being 1.
A binary fragment is eight of ones or zeros like this 0001101 this represents a larger number 0 - 256.
each position represents a number if the number is the number is counted and added to the final sum
Here is a table
1 2 4 8 16 32 64
1 0 0 0 0 0 0 0 = 1
1 1 0 0 0 0 0 0 = 3
1 1 0 0 0 0 0 1 = 67
The answer to your question this is done to allow computer to count higher tan one making computer more efficient. 8 characters could mean one of 256 different things.
Computer can only count 1 or 0. Because a computer can send an electrical message being 1.
A binary fragment is eight of ones or zeros like this 0001101 this represents a larger number 0 - 256.
each position represents a number if the number is the number is counted and added to the final sum
Here is a table
1 2 4 8 16 32 64
1 0 0 0 0 0 0 0 = 1
1 1 0 0 0 0 0 0 = 3
1 1 0 0 0 0 0 1 = 67
The answer to your question this is done to allow computer to count higher tan one making computer more efficient. 8 characters could mean one of 256 different things.
•
•
Join Date: Aug 2007
Posts: 165
Reputation:
Solved Threads: 18
•
•
•
•
Hello, Can anyone please explain role of binary in computer?
Analog computers do (or did) exist. And they work well for what they do. But they aren't as flexible as digital computers.
Binary is popular because electronics most easily deal with ON and OFF, or HIGH and LOW, or POSITIVE and NEGATIVE. All digital computer operations can be traced to binary AND, OR, NAND and NOR logic.
RF-based digital communication (cable, cellular, et al) is rarely binary. Typically, a symbol (a unit of transmission, at one time called a baud) represents more than one bit, and may represent up to six bits of data.
There are many books available (though probably not in your native language) that can teach you the details and show you just why these things are. Google/Yahoo should help you dig up some solid reference materials that are almost as good as books.
•
•
Join Date: Jun 2009
Posts: 5
Reputation:
Solved Threads: 0
Modern computers are based on transistors, which are like light switches -- they are either on or off.
Binary means, roughly, "two", so we use that term to describe this on-off system.
All data processing ("thinking") in the computer is done with on-off switches. Each individual switch is called a "bit." Most computers group the switches into groups of eight, which we call "bytes." A byte can store any number between 0 and 255. A byte can't store any other number.
To store other things, such as letters or colors, you find a way to encode your data as raw numbers between 0 and 255. ASCII is a way of encoding English text as numbers between 0 and 255. RGB is a method of encoding a color as three colors: red, green and blue. Each individual color is stored as a number between o and 255.
Groups of bytes can be combined together to store numbers larger than 255.
8 bits (one byte) stores 256 possible values.
16 bits stores about 66,000 possible values.
32 bits stores about 4 billion possible values.
64 bits stores about 16,000,000,000,000,000,000 possible values.
There are about 60,000 words in the English language, so it might be possible to encode English words using only 16 bits, but 32 bits would be safer.
There are about 6 billion people on earth, so this number wouldn't fit in 32 bits; you'd have to use 64 bits.
In code, we write down binary numbers using ones and zeroes, like this:
00000100
It's customary to write a space between groups of eight (or groups of four) bits, like this:
00000100 10010010 01100110 11010100
A group of four bits is called a "nybble," which is a joke, because a nibble is a little bite.
Three important operations with binary numbers are "or", "and" and "xor" (pronounced "zor" or "x-or").
In the C language, you write "or" as |,
"and" is &
"xor" is ^
"Or" works like this:
0 | 0 = 0
0 | 1 = 1
1 | 0 = 1
1 | 1 = 1
In other words, if either (or both) is 1, the answer is 1.
"And" works like this:
0 & 0 = 0
1 & 0 = 0
0 & 1 = 0
1 & 1 = 1
In other words, if both are 1, the answer is 1.
"Xor" works like this:
0 ^ 0 = 0
1 ^ 0 = 1
0 ^ 1 = 1
1 ^ 1 = 0
In other words, if one or the other is 1, the answer is 1.
Binary means, roughly, "two", so we use that term to describe this on-off system.
All data processing ("thinking") in the computer is done with on-off switches. Each individual switch is called a "bit." Most computers group the switches into groups of eight, which we call "bytes." A byte can store any number between 0 and 255. A byte can't store any other number.
To store other things, such as letters or colors, you find a way to encode your data as raw numbers between 0 and 255. ASCII is a way of encoding English text as numbers between 0 and 255. RGB is a method of encoding a color as three colors: red, green and blue. Each individual color is stored as a number between o and 255.
Groups of bytes can be combined together to store numbers larger than 255.
8 bits (one byte) stores 256 possible values.
16 bits stores about 66,000 possible values.
32 bits stores about 4 billion possible values.
64 bits stores about 16,000,000,000,000,000,000 possible values.
There are about 60,000 words in the English language, so it might be possible to encode English words using only 16 bits, but 32 bits would be safer.
There are about 6 billion people on earth, so this number wouldn't fit in 32 bits; you'd have to use 64 bits.
In code, we write down binary numbers using ones and zeroes, like this:
00000100
It's customary to write a space between groups of eight (or groups of four) bits, like this:
00000100 10010010 01100110 11010100
A group of four bits is called a "nybble," which is a joke, because a nibble is a little bite.
Three important operations with binary numbers are "or", "and" and "xor" (pronounced "zor" or "x-or").
In the C language, you write "or" as |,
"and" is &
"xor" is ^
"Or" works like this:
0 | 0 = 0
0 | 1 = 1
1 | 0 = 1
1 | 1 = 1
In other words, if either (or both) is 1, the answer is 1.
"And" works like this:
0 & 0 = 0
1 & 0 = 0
0 & 1 = 0
1 & 1 = 1
In other words, if both are 1, the answer is 1.
"Xor" works like this:
0 ^ 0 = 0
1 ^ 0 = 1
0 ^ 1 = 1
1 ^ 1 = 0
In other words, if one or the other is 1, the answer is 1.
Just to clarify what sridhar said, read this http://www.wikihow.com/Convert-from-Decimal-to-Binary
And please learn to use a search engine.
And please learn to use a search engine.
Siddhant Sanyam
(Not posting much)
My Blog: Yatantrika
Migrate to Standard C++ :When to tell your C++ Code is Non-Standard.
Please Read before posting: How To Ask Questions The Smart Way
(Not posting much)
My Blog: Yatantrika
Migrate to Standard C++ :When to tell your C++ Code is Non-Standard.
Please Read before posting: How To Ask Questions The Smart Way
![]() |
Similar Threads
- Recursive binary search (C)
- decimal > binary > Oct > Hex (C++)
- binary file (C)
- The role of Females in society... (Geeks' Lounge)
- ASCII to BINARY, & VICA VERCA (C++)
Other Threads in the Computer Science Forum
- Previous Thread: help with this problem
- Next Thread: can get my vs project to copy to another folder
Views: 583 | Replies: 9
| Thread Tools | Search this Thread |
Tag cloud for Computer Science
ai algorithm algorithms amazon assignment assignmenthelp assignments automata battery binary bittorrent bizarre bletchleypark blogging bomb business cern codebreaker compiler computers computerscience computertrackingsoftware connect csc data dataanalysis dataintepretation development dissertation dissertations dissertationthesis dissertationtopic ebook employment energy extensions floatingpoint foreclosure foreclosuresoftware gadgets geeks givemetehcodez graphics hardware history homeowners homework homeworkassignment homeworkhelp humor ibm idea internet iphone ipod itcontracts laws lazy linkbait lsmeans mainframes marketing mining mobileapplication msaccess nano networking news os p2p parser piracy piratebay principles programming rasterizer sam-being-cute sas science sex simulation software spoonfeeding spying sql stephenfry student study supercomputer supercomputing sweden technology textfield tree turing turingtest uk virus warehouse ww2






