Jamaica Gleaner

Binary representa­tion and manipulati­on

- Contributo­r Natalee A. Johnson teaches at Ardenne High School. Send questions and comments to kerry-ann.hepburn@gleanerjm.com NATALEE A. JOHNSON

GOOD DAY, students. This is lesson 11 in our series. In this week’s lesson, I will continue to look at binary representa­tion and manipulati­on.

FINDING THE ONES COMPLEMENT OF AN INTEGER NUMBER

The ones complement representa­tion simply involves flipping the bits of a given number. You flip zeros to ones and ones to zeros. Ensure the number is in its positive form, whether four or eight bits, before you find the ones complement of the number.

FINDING THE TWOS COMPLEMENT OF AN INTEGER NUMBER

This is another method of representi­ng integers. This enables subtractio­n to be performed by a modified form of addition, which is easier to execute in the computer.

If the number is positive or negative, do the following:

Step 1: Write the number in its positive sign and magnitude form. Step 2: Flip the bits (find its one complement). Step 3: Add one (1) to the number obtained in step 2. Step 4: The result is the number in its two’s complement notation. Step 4: -17 = 11101111 (twos compliment notation)

CONVERTING A TWOS COMPLEMENT INTEGER TO DECIMAL

To carry out this conversion, you would apply the same concept you learnt in lesson 8, in terms of converting binary numbers into decimal.

Let us use the twos complement value of -17 we obtained above to be converted to decimal.

CODING SCHEMES ASSOCIATED WITH DATA REPRESENTA­TION

The combinatio­ns of 0s and 1s used to represent characters are defined by patterns, called a coding scheme. Using one type of coding scheme, the number one is represente­d as 00110001. Two popular coding schemes are American Standard Code for Informatio­n Interchang­e (ASCII) and Extended Binary Coded Decimal Interchang­e Code (EBCDIC). ASCII is used mainly on personal computers, while EBCDIC is used primarily on mainframe computers. 3. Add the binary equivalent of 2 to the ASCII representa­tion of ‘h’ as shown below.

Here are the answers to the practice questions you were given in the previous lesson on BCD. Did you complete the questions correctly? If you did, keep up the good work. 1. (a) 8978 = 1000100101­111000 or 1010100010­0101111000 (b) -62 = 1011011000­10 (c) 4560 = 0100010101­100000 2. (a) 0001/0101/1000 = 158 (b) 1011/0111/0000/0101 = - 305

We have come to the end of this lesson. See you next week, when we will continue to look at binary representa­tion and manipulati­on. Remember, if you fail to prepare, you prepare to fail.

 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??

Newspapers in English

Newspapers from Jamaica