PDA

View Full Version : Binary Digit System



Ninjabear
20-07-2012, 12:21 AM
Hi Guys

Trying to figure out the binary digit and how it works

http://www.wikihow.com/Convert-from-Decimal-to-Binary

I came across this page

I don't understand the video

It's trying to convert 56 to binary

What does it mean when the video says if "54 can fit into 32"?
I dont get she meant by if it "fits into?

Speedy Gonzales
20-07-2012, 12:29 AM
*

Agent_24
20-07-2012, 01:17 AM
Similarly to decimal, it's represented by a place-weighted value.
Take the number 289 in decimal, it has Two "hundreds" eight "tens" and nine "ones"


But instead of going up by powers of ten, in binary, you go up in powers of two.
Therefore you get such a number as 1101 which shows we have one "eight" one "four" , no "two" and one "one"
For each value's place, you either have that number (it shows a 1) or you don't (there's a 0 there) - you can't have two "eights", instead you would have one "sixteen"



When converting decimal to binary, you can basically break the number down into pieces starting with the highest place value it can fill.

54 can't be represented by a 1 in the "sixty-four" place because it's smaller than 64, it would be the wrong answer if we put a 1 there, because that would be saying we had at least 64 when we don't.


So, instead, we put a 1 in the 32's place (the next highest) - which now indicates we have one lot of 32.

Of course, since 32 < 54 we have some left over. 54 - the 32 we already wrote in gives us 22. We can also fill the 16's place, which leaves us with 6. That can't fill the 8's place completely, so we have to go lower and break it down some more. We can fill the 4's place but we still have more left over - but this time we have an exact 2, which goes in the 2's place, leaving us with the final answer:

110110

Which can be understood as One 32 + One 16 + no 8 + One 4, One Two and no One.

(you can remove the leading zeros as they mean nothing, just like in decimal, but when you are talking about a specific electronic system, say a 16-bit address bus, it's typical to write the entire number of bits even when they contain leading zeros, so there is less confusion about the width etc - although if you were talking about an address bus, you may well be writing in Hex instead)


Hope that helps, if not, just keep reading, make sure you read from different places, sometimes it's easier to understand from one person than it is from someone else.

pctek
20-07-2012, 09:48 AM
Yeah, it's actually quite easy once you get the concept.

At tech we had to do calculations in it. Generally we went between Hex, Binary and decimal.

Ninjabear
20-07-2012, 08:30 PM
Hi

I don't get how 32 can fit into 54 and 22 into 16?

Agent_24
20-07-2012, 08:38 PM
This might help

http://www.khanacademy.org/science/computer-science/v/binary-numbers

Paul.Cov
20-07-2012, 09:49 PM
I got taught this in maths 30 years ago. What the hell are the schools doing now?

Understanding binary is right at the core of digital nerd-dom.

Imagine a binary byte, an 8 digit 'word' made up of 8 characters. The characters can be 0 or 1.

Counting them off from the right, each chatacter space has a maximum value of... 1, 2, 4, 8, 16, 32, 64, 128
Or presented in the order the bits are read from left to right, 128, 64, 32, 16, 8, 4, 2, 1

Each places value is double that of its neighbour on the right side, and half the value of the place on the left side.
However, the 'place' is only worth this amount if the place is marked with a 1. If it is marked with a zero then it is worth 0.

128, 64, 32, 16, 8, 4, 2, 1

1 0 0 1 1 0 0 1


The above binary number, 1001 1001 (a byte) has a value of 128 + 16 + 8 + 1 = 153

When trying to find a binary equivalent for a decimal number, like your 56 you have to first assign a 1 to the position that gives the largest number which is less than or equal to your target number of 56. In this case 32 is the biggest number (represented by 0010 0000)
This is what they mean when they say 32 will 'fit' into 56. simply, 32 is smaller than 56. You can't fit an elephant into a wardrobe coz the elephant is bigger than the wardrobe, similarly you can't 'fit' the next step of 64 into 56, coz 64 is too big.

Anyway, if you construct your number 56 this way...

0010 0000 = 32
0001 0000 = 16
0000 1000 = 8 Now just add up each column of digits
----------------
0011 1000 = 56

If you've done it right you'll never have more than a single 1 in any single column (unless you're adding binary numbers)

Clear as mud?
It gets more tricky once dealing with negative numbers when one of these places is sacrificed to be a signal that the number is a negative and no longer counts as a bit in the number sequence.

pcuser42
20-07-2012, 09:51 PM
It gets more tricky once dealing with negative numbers when one of these places is sacrificed to be a signal that the number is a negative and no longer counts as a bit in the number sequence.

Unless you're using two's complement but we won't go into that...

decibel
22-07-2012, 07:20 PM
There are only 10 types of people in the world - those who understand binary and those who don't.

Nick G
22-07-2012, 07:32 PM
There are only 10 types of people in the world - those who understand binary and those who don't.
:lol: Now where's that +1 button?

Richard
23-07-2012, 10:35 AM
Very clever! :thumbs: