Thursday, 21 November 2013

Number System and Operation

Number System 


From this subtopic, I have learned about the types of number system which has 4 system. The system are binary(base 2), octal(base 8), decimal(base 10), and hexadecimal(base 16).

In binary number,the number consist only two digit which are 0 and 1. Binary number can convert to decimal and hexadecimal.

Example:

Binary to Decimal


(100111.0101)₂

2⁵|2⁴|2³|2²|2¹|2⁰|.|2⁻¹|2⁻²|2⁻³|2⁻⁴|
1 | 0 | 0| 1| 1 | 1|.| 0 | 1  | 0 | 1
32+0+0+4+2+1+0+0.25+0.0625
=39.3125
:- (100111.0101)₂=(39.125)₁₀

Binary to Hexadecimal

(11110000.0011)₂

2³2²2¹2⁰  |  2³2²2¹2⁰   |.|2³2²2¹2⁰
1 1 1 1    |  0 0 0 0     |.|0 0 1 1
8+4+2+1| 0+0+0+0  |.|0+0+2+1
     15      |       0        |.|     3
      F       |       0        |.|     3
:-(11110000.0011)₂=(F0.3)₁₆

For decimal number system with base 10, the value assigned weight is composed by 10 digits starting from 0 until 9.  The decimal number can be converted into binary and hexadecimal number.
Example:

Decimal to Binary


(23.25)₁₀2 | 23

2 | 11-1
2 |  5-1                                                         0.25x2=0.5 - 0
2 |  2-1    (Read from below to top)         0.5x2= 1.0 - 1   (Read from top to below)
2 |  1-0
2 |  0-1
:- (23.25)₁₀=(10111.01)₂

Decimal to Hexadecimal


(999.125)₁₀

16 | 999
16 |  62  - 7                                                          0.125x16= 2
16 |   3   -  14 (E)   (Read from below to top)   
16 |   0   -  3
:-(999.125)₁₀=(3E7.2)₁₆

Last but not least, we have hexadecimal with base 16. Hexadecimal number composed number starts from 0 until 15. Starting from 10, we change it to A. That's mean, 10 is A,11 is B, 12 is C, 13 is D, 14 is E and 15 is F.We can changed hexadecimal number into decimal and binary.

Example:

Hexadecimal to Binary

(B4.C9)₁₆

2³2²2¹ | 2⁰2³2²2¹2⁰ |.| 2³2²2¹2⁰ | 2³2²2¹2⁰ |
   B     |       4         |.|       C      |      9       |
   11    |        4        |.|      12      |   9         |
1 0 1 1| 0 1 0 0      |.|  1 1 0 0   |  1 0 0 1 |
:- (B4.C9)₁₆=(10110100.11001001)₂
Hexadecimal to Decimal

(11.FF)₁₆
16¹ | 16⁰  |.| 16⁻¹ | 16⁻²
  1  |    1   |.|   F    |  F
16+1+0.9375+0.05859)
=(17.99609)₁₀
:-(11.FF)₁₆=(17.99609)₁₀


Created by:
AZIRA BT HAMDAN
B031310453
 

 2's COMPLEMENT NUMBER



·    Two's complement is a mathematical operation on binary numbers, as well as a binary signed number representation based on this operation. Its wide use in computing makes it the most important example of a radix complement.
·     A fixed number of bits are used to represent numbers.
·    The most significant bit is called the sign bit.
·    This same notation is used to represent both positive and negative numbers.
·     convert from 12510 to -12510
               
               1st step = convert decimal number to binary equivalent
                                       12510     -->     111 11012
               2nd step = 1st complement (0 change to 1,1 change to 0)
                                        0111 11012     -->     000 00102
               3rd step = 2nd complement (where have to +1 to the 1st complement)
                                                                                  0000 0010
                                                                            +                     1
                                                                                  0000 0011
               
            hence, the answer for the -125 is 1000 00112
·     this is because the +ve number the sign bits is 0, therefore when it converted to -ve number, the sign bits is 1. So, the answer 0000 00112 must convert to 1000 00112.




Created by,
AHMAD NUR FATHIN IZZAT BIN AZLI
B031310273




Binary Addition


Rules of the binary operation:





Binary Rules


Sum


Carry




0+0=0


0


0




0+1=1


1


0




1+0=1


1


0




1+1=1


0


1



Eg:
      11  1 <--- Carry bits ----->   11
     1001001                      1000111             
   + 0011001                    + 0010110              
   ---------                    ---------                
     1100010                      1011101   

         
 Binary Subtraction
  
  Rules of the binary operation:




Binary Rules


Sum


Carry




0-0=0


0


0




0-1=1


1


10




1-0=1


1


0




1-1=1


0


1


Image


Created by:
NUR FALAHI NABIHAH BINTI AHMAD SHAFRI
B031310253




Binary Multiplication




Binary rules


Multiply




0x0=0


0




0x1=1


0




1x0=1


0




1x1=1


1


Binary Division


Binary division is again very simple. As in the decimal system (or in any other number system), division by 0 is meaningless. Hence, the complete table for binary division is as follows: 1. Start from the left of the dividend. 2. Perform a series of subtractions in which the divisor is subtracted from the dividend.  3. If subtraction is possible, put a 1 in the quotient and subtract the divisor from the corresponding digits of dividend. 4. If subtraction is not possible(divisor is greater than remainder), record a 0 in the quotient. 5. Bring down the next digit to add to the remainder digits. Proceed as before in a manner similar to long division.   The division process is performed in a manner similar to decimal division. The rules for binary division are 







1. Divisor greater than 100, so put 0 in quotient.
2. Add digit from dividend to group used above.
3. Subtraction possible so put 1 in the quotient.
4. Remainder from subtraction plus digit from dividend
5. Divisor greater, so put 0 in quotient.
6. Add digit from dividend to group.
7. Subtraction possible, so put 1 in quotient.



Created by,
NOOR AZREEANI BINTI AZMAN
B031310566





HEXADECIMAL


Hexadecimal is the numeral system with a base of 16 and written using a numeral symbol 0 to 9 and A to F consequently. The alphabetical order represent the number after 9 such as A = 10, B = 11, C = 12, D = 13, E = 14, F =15.

HEXADECIMAL ADDITION


The addition of hexadecimal has no difference for other numeric bases. The basic are still the same just the difference is its bases (base 16).


 Just follow these simple step:
1.    Add the number column by column.
2.    Convert to decimal then add the numbers
3.    If the sum of the two number is larger than 16, subtract the sum with 16 then add 1 to the next column. (do this only if step 2 result more than 16)
Example:
A E 616 + 9 B 216 = 1 4 9 816






Another example (Harder than before):
B 8 9 4 E16 + C 7 5 A B16 = 1 7 F E F 916






HEXADECIMAL SUBTRACTION


 Subtraction of hexadecimal is also the same with other subtraction method.
 The steps are the same.

1.    Subtract the number column by column.
2.    Convert to decimal then subtract the numbers
3.    If the subtraction of the two number turns out negative, borrow from the number from the following column then add 16. Then continue subtraction. (do this only if step 2 result are negative)




Example 2:
A B C D E16 – D E F16 = A A E E F16






Created by,
EDDY FAZZIRRULLAH BIN AZMI
B031310313


No comments:

Post a Comment