Binary

clacker

BSOD
Messages
582
Please understand I'm young and here to learn.

Can someone please explain Binary as simple as they can please.

I have looked at some explanations and I go as far as understanding it is a code with the digits 0 and 1 used in keyboards but then as I go on I get lost.

Please help
 
Binary is a very large topic so you're going to need to be a little more specific on what you want to learn. We could spend an entire thread just on Binary math, or even things like how a network signal works or even how binary is used to send data from a CPU to RAM and back.
 
Binary is a very large topic so you're going to need to be a little more specific on what you want to learn. We could spend an entire thread just on Binary math, or even things like how a network signal works or even how binary is used to send data from a CPU to RAM and back.


How is it involved in computers and how you work out the code?
 
Perhaps the simplest way of thinking about it is as a number base. Normally we work in base 10, using 10 different digits (0-9). In binary we only use two digits, 0 and 1.

Think of numbers as columns of digits. In base 10, say we have the number 159, that's made of 3 columns. The first number (the right most column) will be 9*10^0, the second 5*10^1, the third 1*10^2. To get the resulting number we add those values together, which gives us (unsurprisingly in this case) 159! (9 + 50 + 100.)

We can apply this same logic to base 2, with a number such as:

10110.

So, from the right we have 0*2^0 + 1*2^1 + 1*2^2 + 0*2^3 + 1*2^4. This gives us 0 + 2 + 4 + 0 + 16, which gives us 22. So 10110 in binary is 22.

Using the above system you can represent any (whole positive) number in binary. (There's methods of representing floating point numbers and negative numbers as well, but I won't confuse you with those for now!)

How is it involved in computers? Well it's useful because each binary digit represents either on or off, which corresponds very neatly to how any electronic circuit works, by means of switches. In computers these switches are called transistors, there's millions of them that make up a CPU and they turn on and off millions of times a second to perform all the calculations you require. So at the core of a PC everything gets translated into binary 1s and 0s, this in turn gets translated to analogue voltage levels (5V and 0V for instance) which turn the transistors on and off, which perform calculations.

There is of course a lot more to it than that, but that's the basics of how it all links together.
 
Perhaps the simplest way of thinking about it is as a number base. Normally we work in base 10, using 10 different digits (0-9). In binary we only use two digits, 0 and 1.

Think of numbers as columns of digits. In base 10, say we have the number 159, that's made of 3 columns. The first number (the right most column) will be 9*10^0, the second 5*10^1, the third 1*10^2. To get the resulting number we add those values together, which gives us (unsurprisingly in this case) 159! (9 + 50 + 100.)

We can apply this same logic to base 2, with a number such as:

10110.

So, from the right we have 0*2^0 + 1*2^1 + 1*2^2 + 0*2^3 + 1*2^4. This gives us 0 + 2 + 4 + 0 + 16, which gives us 22. So 10110 in binary is 22.

Using the above system you can represent any (whole positive) number in binary. (There's methods of representing floating point numbers and negative numbers as well, but I won't confuse you with those for now!)

How is it involved in computers? Well it's useful because each binary digit represents either on or off, which corresponds very neatly to how any electronic circuit works, by means of switches. In computers these switches are called transistors, there's millions of them that make up a CPU and they turn on and off millions of times a second to perform all the calculations you require. So at the core of a PC everything gets translated into binary 1s and 0s, this in turn gets translated to analogue voltage levels (5V and 0V for instance) which turn the transistors on and off, which perform calculations.

There is of course a lot more to it than that, but that's the basics of how it all links together.


That helped thanks I understand it a bit more now.

Still having trouble with that code though.
 
What parts are you having trouble with? Try and explain what you know, it often helps things sink in that way.
 
*2^0 + 1*2^1 + 1*2^2 + 0*2^3 + 1*2^4. This part I dont understand how that turns into 0 + 2 + 4 + 0 + 16.

Sorry if i'm being a bit of a idiot.
 
Take each individual part of that sum (each bit that's being added) in the first and just work it out. The bit on the left is 0, then 2, then 4, then 0, then 16. It's just showing a simplified step before we end up at the final answer.
 
the basics of binary as i understand them:

-Binary works in powers of 2 (e.g. 1, 2, 4, 8, 16 and so on)

-a binary 1 is a 'bit' and a 0 represents when a power is not present.
-Binary works usually from right to left in ascending order, but it is read from left to right.

a quick example.

here is a binary number : 111000

you can see it has 6 digits, so it will be in 6 spaces on a numbered line. the first 1 has to go 6 numbers in from the right, like this:


128 64 32 16 8 4 2 1

1

as you can see, this represents 32, so we currently have a total of 32 after the first 1. The rest of the binary figure can be put into the spaces to the right of the number.

182 64 32 16 8 4 2 1

1 1 1 0 0 0

so, where we have 1's, we have numbers, and where there are 0's, there is nothing. so right now, we have 32, 16 and 8.

32+16+8 = 56.

therefore, 111000 = 56.


hope this helps and isnt just confusing, its a wide topic with many uses, and can be hard to grasp first time round.

just recognise that binary (powers of two, dotted decimal) is different entirely to hexadecimal (powers of 16, hexadecimal)

:)
 
the basics of binary as i understand them:

-Binary works in powers of 2 (e.g. 1, 2, 4, 8, 16 and so on)

-a binary 1 is a 'bit' and a 0 represents when a power is not present.
-Binary works usually from right to left in ascending order, but it is read from left to right.



a quick example.

here is a binary number : 111000

you can see it has 6 digits, so it will be in 6 spaces on a numbered line. the first 1 has to go 6 numbers in from the right, like this:


128 64 32 16 8 4 2 1

1

as you can see, this represents 32, so we currently have a total of 32 after the first 1. The rest of the binary figure can be put into the spaces to the right of the number.

182 64 32 16 8 4 2 1

1 1 1 0 0 0

so, where we have 1's, we have numbers, and where there are 0's, there is nothing. so right now, we have 32, 16 and 8.

32+16+8 = 56.

therefore, 111000 = 56.


hope this helps and isnt just confusing, its a wide topic with many uses, and can be hard to grasp first time round.

just recognise that binary (powers of two, dotted decimal) is different entirely to hexadecimal (powers of 16, hexadecimal)

:)

That did help a bit but I'm sure I will understand it with a bit more studying.
 
Back
Top Bottom