Jamaica Gleaner

Binary representa­tion (Conversion­s)

- NATALEE A. URQUHART Contributo­r

GOOD DAY, students. This is lesson nine of our series of lessons. In this week’s lesson, we will be looking at binary representa­tion and manipulati­on. At the end of this lesson, you will learn how to convert a binary number to decimal, convert a decimal number to binary, and subtract and add binary numbers.

Computers store and manipulate data numericall­y using the binary system (referred to as the machine language), which comprises ‘1s’ or ‘0s’ and, of course, we will be working with base 2 in our calculatio­ns.

CONVERTING DECIMAL NUMBERS TO THEIR BINARY EQUIVALENT

To convert decimal numbers to binary, you are simply going to be dividing the number by 2 and, subsequent­ly, making a note of the remainder. You will stop dividing when you arrive at a zero. The binary answer is written from the bottom up. Let us now look at an example.

CONVERTING BINARY NUMBERS TO THEIR DECIMAL EQUIVALENT

When converting binary numbers to decimal, for each of the binary digits (bit) you are going to have base 2 raised from 0 to the correspond­ing number of bits you have. So, if you have four bits, then base 2 will be raised from 0 to 3, example, 20 - 23. Then, the value you get when 2 is raised to the correspond­ing number is multiplied by its correspond­ing bit, starting from right to left. You then add the correspond­ing decimal numbers to get the decimal equivalent. Let us now look at an example. I am going to use the answer we obtained from example one.

Convert 11112 to its decimal equivalent (this way you can tell if the answer we obtained in example one is correct).

BINARY ADDITION

When adding numbers in binary, there are five rules you should apply:

0 + 0 = 0

0 + 1 = 1

1 + 0 = 1

1 + 1 = 10 (This is the binary equivalent of 2, which is read as ‘one zero’ and not ‘10’)

1 + 1 + 1 = 11 (This is the binary equivalent of 3, which is read as ‘one one’ and not ‘11’) Please ensure that you include base 2 in your answers, as shown above.

We have come to the end of this lesson. See you next week. Remember, if you fail to prepare, you prepare to fail.

Natalee A. Urquhart teaches at Ardenne High School. Send feedback to kerry-ann.hepburn@gleanerjm.com.

 ??  ??
 ??  ??
 ??  ??
 ??  ?? Bolt
Bolt
 ??  ??

Newspapers in English

Newspapers from Jamaica