You are on page 1of 13

BASE NUMBER

There is much other numbering system - mostly associated with computers. These include: Binary Octal Hexadecimal Binary Coded Decimal (BCD)

THE DECIMAL SYSTEM


This is the system in everyday use; there are 10 digits (0 to 9 inclusive) so it has a 'base' of 10.

EXAMPLE:

1. Taking the number 7213, it can be written as: (7 x 1000) + (2 x 100) + (1 x 10) + (3 x 1) = (7 x 103 ) + (2 x 102 ) + (1 x 101) + (3 x 100) = 7213 Each digit is effectively multiplied by a power of 10

2. Note that to write 12.37 in power of 10 (1 x 10') + (2 x 100) + (3 x 10-1) + (7 x 10-2) = (10) + (2) + (0.3) + (0.07) = 12.37 Note that 10 0 = 1. ln fact any number to the power of zero = 1

BINARY SYSTEM
Let's look at base-two, or binary, numbers. How would you write, for instance, 1210 as a binary number? You would have to convert to base-two columns, the analogue of base-ten columns. In base two, you have 20 = 1, 21 = 2, 22 = 4, 23 = 8, 24 = 16, and so forth.

The first column in base-two math is the units column. But only "0" or "1" can go in the units column. When you get to "two", you find that there is no single solitary digit that stands for "two" in base-two math. Instead, you put a "1" in the twos column and a "0" in the units column, indicating "1 two and 0 ones". The base-ten "two" (210) is written in binary as 102.

Here is a listing of the first few numbers:

Decimal Binary (base 10) (base 2) 0 0 1 1 2 10 3 11 4 100 5 101 6 110 7 111 8 1000 9 1001 10 1010 11 1011 12 1100 13 1101 14 1110 15 1111 16 10000

0 ones 1 one 1 two and zero ones 1 two and 1 one 1 four, 0 twos, and 0 ones 1 four, 0 twos, and 1 one 1 four, 1 two, and 0 ones 1 four, 1 two, and 1 one 1 eight, 0 fours, 0 twos, and 0 ones 1 eight, 0 fours, 0 twos, and 1 one 1 eight, 0 fours, 1 two, and 0 ones 1 eight, 0 fours, 1 two, and 1 one 1 eight, 1 four, 0 twos, and 0 ones 1 eight, 1 four, 0 twos, and 1 one 1 eight, 1 four, 1 two, and 0 ones 1 eight, 1 four, 1 two, and I one 1 sixteen, 0 eights, 0 fours, 0 twos, and 0 ones

Converting between binary and decimal numbers is fairly simple, as long as you remember that each digit in the binary number represents a power of two.

EXAMPLE

1. Convert 1011001012 to the corresponding base-ten number List the digits in order, and count them off from the RIGHT, starting with zero: Digits Numbering : : 101100101 876543210

Use this listing to convert each digit to the power of two that it represents: (1 x 28 )+( 0 x 27 )+ (1 x 26 )+ (1 x 25 )+ (0 x 24)+(0 x 23 )+ (1 x 22)+ (0 x 21)+ (1 x 20) = = = (1 x 256) + (0 x 128) + (1 x 64) + (1 x 32) + (0 x 16) + ( 0 x 8) + (1 x 4) + (0 x 2) + (1 x 1) 256 + 64 + 32 + 4 + 1 357 Then 1011001012 convert to 35710 Converting decimal numbers to binaries is nearly as simple: just divide by 2.

Answer:

2. Convert 35710 to the corresponding binary number. To do this conversion, you need to divide repeatedly by 2, keeping track of the remainders as you go. Watch below: As you can see, after dividing repeatedly by 2, I ended up with these remainders
1 R0 2 2 R1 2 5 R1 2 11 R 0 2 22 R 0 2 44 R1 2 89 R 0 2 178 R1 2 357

These remainders tell us what the binary number is. Read the numbers from around the outside of the division, starting on top and wrapping your way around the right-hand side. As you can see: Answer: 35710 converts to 101 1001012

BINARY ARITHMETIC Arithmetic in binary is much like arithmetic in other numeral systems. Addition, subtraction, multiplication, and division can be performed on binary numerals.

Addition The simplest arithmetic operation in binary is addition. Adding two single-digit binary numbers is relatively simple: 0+0 0+1 1+0 1+1 0 1 1 0, carry 1 (since 1 + 1= 0 + 1 x 10 in binary)

Adding two "1" digits produces a digit "0", while 1 will have to be added to the next column. This is similar to what happens in decimal when certain single-digit numbers are added together; if the result equals or exceeds the value of the radix (10), the digit to the left is incremented 5+5 7+9 0, carry 1 (since 5 + 5 = 0 + 1 x 10) 6, carry 1 (since 7 + 9 = 6 + 1 x 10)

This is known as carrying. When the result of an addition exceeds the value of a digit, the procedure is to "carry" the excess amount divided by the radix (that is, 10/10) to the left, adding it to the next positional value. This is correct since the next position has a weight that is higher by a factor equal to the radix. Carrying works the same way in binary.

EXAMPLE 1 1 1 1 1 0 1 1 0 1 + = 1 0 1 1 1 1 0 0 1 0 0 (carried digits)

In this example, two numerals are being added together: 011012 (13-decimal) and 101112 (23 decimal). The top row shows the carry bits used. Starting in the rightmost column, 1 + 1= 102. The 1 is carried to the left, and the 0 is written at the bottom of the rightmost column. The second column from the right is added: 1 + 0 + 1 = 102 again; the list carried and is written at the bottom. The third column: 1 + 1 + 1 =112. This time ,a 1 is carried, and a 1 is written in the bottom row. Proceeding like this gives the final answer 1001002 (36 decimal)

Subtraction Subtraction works in much the same way: 00 01 10 11 0 1, borrow 1 1 0

Subtracting a "1" digit from a "0" digit produces the digit 1, while 1 will have to be subtracted from the next column. This is known as borrowing. The principle is the same as for carrying. When the result of a subtraction is less than 0, the least possible value of a digit, the procedure is to "borrow" the deficit divided by the radix (that is, 10/10) from the left, subtracting it from the next positional value.

EXAMPLE * 1 * * * 1 1 0 1 1 1 0 = 1 0 1 1 1 1 0 1 0 1 1 1 (carried digits)

Subtracting a positive number is equivalent to adding a negative number of equal absolute value; computers typically use two's compliment notation to represent negative values' This notation eliminates the need for a separate "subtract" operation. A - B = A +not B +1

Multiplication Multiplication in binary is similar to its decimal counterpart. Two numbers A and B can be multiplied by partial products: for each digit in B, the product of that digit-in A is calculated and written on a new line, shifted leftward so that its rightmost digit lines up with the digit in B that was used. The sum of all these partial products give the final result.

Since there are only two digits in binary, there are only two possible outcomes of each partial multiplication: lf the digit in B is 0, the partial product is also 0. lf the digit in B is 1, the partial product is equal to A

EXAMPLE

1.

For example, the binary numbers 1011 and 1010 are multiplied as follow:

2.

Binary numbers can also be multiplied with bits after a binary point:

Division Binary division is again similar to its decimal counterpart:

Here, the divisor is 1012, or 5 decimal, while the dividend is 110112, or 27 decimal. The procedure is the same is that of decimal long division; here, the divisor 1012 goes into the first three digits 1102 of the dividend one time, so a "1" is written on the top line. This result is multiplied by the divisor, and subtracted from the first three digits of the dividend; the next digit (a "1") is included to obtain a new three-digit sequence:

EXAMPLE

The procedure is then repeated with the new sequence, continuing until the digits in the dividend have been exhausted.

Thus, the quotient of 110112 divided by 1012 is 1012, as shown on the top line, while the remainder, shown on the bottom line, is 102. ln decimal, 27 divided bys is 5, with a remainder of 2.

OCTAL SYSTEM
An older computer base system is "octal" or base-B number system. The digits in octal are 0, 1,2,3,4,5,6 and 7. The value "eight" is written as 1 eight and 0 ones or 108

DECIMAL TO OCTAL CONVERSION Method used division by 8: Divide the quotient by eight and record the remainder. Repeat step until the quotient is equal to zero (0) The remainder is read from bottom to top

EXAMPLE

Convert 35910 to Octal:

Read from bottom to top Therefore, 35910 = 5478

OCTAL TO DECIMAL CONVERSION Method used: sum the digits after each has been multiplied by its associated weight

EXAMPLE

Convert 2378 to Decimal

BINARY TO OCTAL CONVERSION Method used : replace each octal digit with the appropriate three-bit binary number

EXAMPLE

Convert 138 to binary Solution = 001 0112

OCTAL TO BINARY CONVERSION Method use : Break the binary digits into groups of three from right/decimal point and convert each group into its appropriate octal digit.

EXAMPLE

Converting (010111)2 to Octal Solution: 111 = 7 010 = 2 (LSB) (MSB)

thus, (010111)2=(27)

HEXADECIMAL SYSTEM
Hexadecimal describes a base-16 number system. The hexadecimal numbers are 0-9 and then use the letters A-F. We show the equivalence of binary, decimal, and hexadecimal numbers in the table below. Binary 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 DECIMAL TO HEXADECIMAL CONVERSION Method used: division by 16: Divide the quotient by sixteen and record the remainder Repeat step until the quotient is equal to zero (0). The remainder is read from bottom to top Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F

EXAMPLE SOLUTION

: :

123410 to Hexadecimal

Read from bottom to top

Therefore, 1234 10 = 4D2H, or 4D216

HEXADECIMAL TO DECIMAL CONVERSION Method use: sum the digits after each has been multiplied by its associated weight

EXAMPLE

Convert 4D216 to Decimal

SOLUTION

HEXADECIMAL TO BINARY CONVERSION AND VISE VERSA Method use: The easiest wav is to use the table below

EXAMPLE

1.

Convert F816 to Binary Solution: F = 1111 8 = 1000 Thus, F816 = 1111 10002

2.

Convert 111010110102 to Hexadecimal Solution: Break the binary digits into groups of four from right/decimal point and convert each group into its appropriate hex digit

Thus, 111010110102 = 75A16

EXERCISE 5.1 :

1.

Convert the following decimal numbers to binary number a. b. c. 8410 12410 410

2.

Convert the following decimal numbers to octal numbers: a. b. c. 32410 7710 8510

3.

Express the following decimal numbers to hexadecimal numbers a. b. c. 17810 5510 20710

4.

Convert the binary numbers to decimal numbers a. b. c. 101112 1112 111012

5.

What would the following octal numbers be in decimal numbers? a. b. c. 14408 3728 748

6.

Convert the hexadecimal numbers to decimal numbers a. b. c. 3CE16 A0316 5616

7.

Calculate the octal numbers equivalent of the following binary numbers a. b. c. 1011112 1010102 110112

8.

Convert the following octal numbers to binary numbers: a. b. c. 13168 26548 5278

9.

Express the following numbers, which are in hexadecimal numbers, as octal numbers a. b. c. 2CD16 7A816 4EF 16

10.

Determine the value of the following binary numbers, using the binary method addition a. b. c. 111 + 101 1111 + 1111 10010 + 101 10

You might also like