## Reading binary code

Wait! Before you turn away thinking “uh, binary? No thanks this is NOT for me”, give me five minutes to explain** just how easy it is to read**.

After all, you never know, you may one day meet the man/woman of your dreams (albeit a very geeky one) at a party and want to impress him/her with your knowledge and intelligence…(admittedly very far fetched but just humour me here).

So here goes..let’s start.

The binary system is the number system recognised by computers. A computer understands only two values, 1 and 0 (they’re not particularly intelligent).

If computers could talk and you asked it ‘what are you thinking?’, it would probably say ‘Oh, nothing’ (because it deals with so many zeros..geddit?).

Computers read binary code to define system elements such as memory locations, monitor colours etc. Everything and anything.

- The first thing to realise is that binary is solely made up of just
**ones**and**zeros.** - The second is that you always read binary from
**right to left**– not the standard left to right (much like Arabic..feeling cultured already eh?).

Calculate binary by using the below scale. For simplification, this table only has the first 8 numbers. You’ll notice that each value or position is double the preceding value (i.e. the value to the right).

To formulate a decimal number you just add together all positions marked with a “1” and ignore the positions marked with a “0”.

For example, if you wanted to represent the decimal number **2** in binary, you would write the following:

10.

In this example, the “0” in the first binary position tells you to skip the first value (which represents the decimal number 1). You then move to the second value which represents the decimal number 2. The “1” says to count that number. Remember we’ve read the 10 **from right to left**.

“There are only 10 people in the world; those that understand binary and those that don’t”

So following the above, to represent the number 5 in binary, you would enter the following:

101.

In this example you count the 1st binary position (..decimal value 1), skip the 2nd (..2) and count the 3rd (..4). So 1 + 4 = **5**. Easy right!?

The number **43** is represented by **101011. **i.e. 1+2+8+32 = 43.

Taking a much bigger number – the binary representation of the decimal number 100,000 would be:

This takes a whopping 17 binary values to add together. 11000011010100000.

Check it yourself – add all the values represented by a 1, and you get 100,000.

And it really is that easy. All you need is the scale and a bit of time to plot out each ‘one’ and then add all the values together. In this way computers can deal with very big numbers easily and quickly (rather than having to count out 100,000 x 1’s for the value 100,000 for instance).

Next up is Hexadecimal code (which I’m just in the process of writing a post on), and how to convert between binary, hexadecimal and decimal systems (‘ooh, can’t wait’ I hear you say).

Take it from somebody who used to peruse memory dumps from various computers, you always read numbers from left to right. Even in countries where text is printed from right to left, the numbers are still read from left to right. In Hebrew, they print from right margin of page towards left, but 50g would be printed the same as here, not as g05.

When reading large numbers (including binary), it helps to arrange the digits in groups. Most people prefer groups of four (quartets) corresponding to hexadecimal notation. Some old timers still prefer groups of three (triplets) corresponding to octal notation. In any case, whether hex, octal or binary, you read from left to right.

To read binary i need to know on which side the LSD (least significant digit) resides. For me it is much easier to read binary with the LSD on the left. This is like a number line where we start with 1 and move forward to the right. I do not look at binary and say oh, 1101,1000 is 27 – see 1101,1000 which means nothing to me until I convert it.

Starting at the left I know we have an odd number or

1 + 2>1 + 0 + 2>3 + 2>4 + 0 + 0 + 0

or,

1 + 2 + 0 + 8 + 16 + 0 + 0 + 0

This is because I am not looking at a number in binary, I am translating (or reading) a set of digits to decimal. It is natural to “read” from left to right.

I binary coded a male last year on an airforce base has anyone heard of people coding each other?