9 Years
Discussion Span
Last Post by darkphotn

Did you do any research before posting here? What did you find and why wasn't it sufficient?


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.


Hello, Can anyone please explain role of binary in computer?

In short:

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.


Yeah, obviously they can recognise only two states on or off. But it may undergo radical changes in future. Read about quantum computers. :)


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:


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.


Hi Guys,
Still I am confused, how to calculate binary. For example this is the (455555) number, how I calculate this number. Please help....

Thank you.


Divide the numbers continuously by 2 until you get 0 as the quotient. The net remainder you get is a binary number.


In decimal, "45" = 4x10 + 5.

In binary, "101101" = 32 + 8 + 4 + 1.

Memorize this sequence:
1, 2, 4, 8, 16, 32, 64, 128, 256.

Then go to Google or Bing. You need to learn how to search for basic coding questions, because there's already a lot of tutorials out there that explain this.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.