Professional Documents
Culture Documents
Number System - is a set of numbers, (in the broadest sense of the word), together with one or more
operations, such as addition or multiplication.
Bit - is the basic unit of information in computing and telecommunications it is the amount of information
that can be stored by a digital device or other physical system that can usually exist in only two
distinct states.
Steps:
1. Get the last digit of the hex number, call this the currentDigit.
2. Make a variable, let’s call it power. Set the value 0.
3. Multiply the current with (2^power), store the result.
4. Increment power by 1.
5. Set the currentDigit to the previous digit of the number.
6. Repeat step 3 until all digits have been multiplied.
7. Sum the result of step 3 to get the answer number.
Example:
Convert Binary number 1010 to Decimal
0*(2^0) 0
1*(2^1) 2
0*(2^2) 0
1*(2^3) 8
ANSWER 10
Conversion Of Octal to Decimal
- To convert any octal number to Decimal we multiply the value in each position by its octal
weight and add each value.
Example:
Convert Octal number to Decimal
= 13009
Steps:
1. Get the last digit of the Hex number, call this digit as currentDigit.
2. Make a variable, let’s call it power. Set the value to 0.
3. Multiply the currentDigit with (16^power), store the result.
4. Increment power by 1.
5. Set the currentDigit to the previous digit to the hex number.
6. Repeat step 3 until all digits have been multiplied.
7. Sum the result of step 3 to get the answer number.
Example:
Convert the Hexadecimal number 589 to Decimal
9*(16^0) 9
8*(16^1) 128
5*(16^2) 1280
ANSWER 1417
Conversion of Decimal to Binary
Steps:
1. Determine if your decimal number is 0 or 1. If it is either of these numbers, the binary number
is the same as the decimal number.
2. Find the largest possible power of 2 that can be subtracted from the decimal number without
making it negative. Then, subtract it.
3. Write a "1" as the first digit of your binary number.
4. Decide whether you can subtract the next smallest power of 2 from what is left of the decimal
number without making it negative.
5. Deduct this power of 2 from the decimal number and write "1" as the next digit of your binary
number if your results were positive for Step 5. If they were negative, write "0" as the next digit of
your binary number.
6. Repeat Step 5 and 6 until you reach the number 0. The numbers you write down during this
process are the binary number.
Example:
Conversion Of Decimal to Octal
Steps:
1. Start with the highest power of 16 (hexadecimal) or 8 (octal) that is smaller than the number.
2. Divide the decimal number by that power, keeping only the integer part of the result.
3. Keep the remainder after the division is done, for the next step.
4. Repeat steps #1 to #3 until you get to the “ones” place, and then put there whatever is left after
the higher digits were done.
Example:
Answer: 178
Steps:
1. Divide the decimal number by 16. Treat the division as an integer division.
2. Write down the remainder (In hexadecimal).
3. Divide the result again by 16. Treat the division as an integer division.
4. Repeat step 2 and 3 until result is 0.
Example:
Convert Decimal number 256 to Hexadecimal
256/16 16 0
16/16 1 0
1/16 0 1
ANSWER 100
Binary Arithmetic:
Addition
The simplest arithmetic operation in binary is addition. Adding two single-digit binary numbers is
relatively simple, using a form of carrying:
0+0→0
0+1→1
1+0→1
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:
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:
1 1 1 1 1 (carried digits)
0 1 1 0 1
+ 1 0 1 1 1
-------------
= 1 0 0 1 0 0
Addition Table
0 1
0 0 1
1 1 10
Subtraction
0−0→0
0 − 1 → 1, borrow 1
1−0→1
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.
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 gives the final result.
Since there are only two digits in binary, there are only two possible outcomes of each partial multiplication:
1 0 1 1 (A)
× 1 0 1 0 (B)
---------
0 0 0 0 ← Corresponds to a zero in B
+ 1 0 1 1 ← Corresponds to a one in B
+ 0 0 0 0
+ 1 0 1 1
---------------
= 1 1 0 1 1 1 0
Multiplication Table
0 1
0 0 0
1 0 1
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 as that of decimal long division; here, the divisor 1012 goes into the first three digits
1102of 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:
1
___________
1 0 1 ) 1 1 0 1 1
− 1 0 1
-----
0 1 1
The procedure is then repeated with the new sequence, continuing until the digits in the dividend have
been exhausted:
1 0 1
___________
1 0 1 ) 1 1 0 1 1
− 1 0 1
-----
0 1 1
− 0 0 0
-----
1 1 1
− 1 0 1
-----
1 0