Tuesday, November 26, 2013

HEXADECIMAL OPERATION

Hexadecimal Addition
Here are the steps to calculate the addition of hexadecimal:
Step 1:  Add one column at a time.
Step 2: Convert the number into decimal and then add the number.
Step 3: If the sum of the numbers is greater than 1510, subtract the result from 16 and then carry 1 to the next column.
Step 3: If the sum of the numbers is less than 1510, convert the number into the hexadecimal.

Here are the examples of hexadecimal addition:

AC5A9+ED694


a. Add the hexadecimal

       A             C             5              A             9
       E              D             6              9              4






a. Add one column at a time
b. Convert to decimal and then add (9 + 4 = 13)

c. Decimal 13 is hexadecimal D


          A             C             5              A            9
          E             D             6              9            4
                                                                      D



a. Add next column
b. Convert to decimal and then add (10 + 9 = 19)
c. Subtract the result from 16 (19 – 16 = 3 carry a 1)

                                          
                                                           1
            A             C             5              A            9
            E             D             6              9            4
                                                                     D




a. Add next column
b. Convert to decimal and then add (1 + 5 + 6 = 12)
c. Decimal 12 is hexadecimal C

                                         
                                           1
            A             C             5              A            9
            E             D             6              9            4
                                          C                         D





a. Add next column
b. Convert to decimal & add (12 + 13 = 25)
c. Subtract the result from 16 (25 – 16 = 9 carry a 1)

                                         
                           1
            A             C             5              A            9
            E             D             6              9            4
                           5             C               3            D





a. Add next column
b. Convert and add (1 + 10 + 14 = 25)
c. Subtract the result from 16 (25 – 16 = 9 carry a 1)


            1
            A              C             5              A             9
            E              D             6              9             4
            9              9              C             3             D





a. Add next column
b. Convert and add (1 + 0 + 0 = 1)

 1    
           A              C             5              A              9
           E              D             6              9              4
 1         9             9             C              3              D






Hexadecimal Subtraction
Here are the steps to calculate the subtraction of hexadecimal:
Step 1: Convert the number into binary
Step 2: Take the 2’s complement of the binary number and change it to hexadecimal number.
Step 3: Both numbers are adding together to get the result.

Here are the examples of hexadecimal subtraction:

8416-2A16

a. Convert the hexadecimal (2A16) into binary number

                                2A16 = 001010102




a. Take 2’s complement of the binary 
b. Change to hexadecimal                         

                      0101010 =>                    11010101
                                                  +                      1
                                                           11010110 = D610        



a. Add both number together to get the result
b. Add (13+8=21)
c. Subtract the result from 16 (21-16=5)

                                                                                   8       4
                                                                            +    D      6
                                                                                  5        A

Post by  Lam Mun Hoo                     B031310223

                                                                                                                                              
                                                                                                                                                                                                                                                                                              


Monday, November 25, 2013

NUMBER SYSTEM AND OPERATION

Conversion of binary, decimal, hexadecimal

A number system is a basic symbol to represent a set of quantities. They are many type of number system. Here we only focus on the decimal, hexadecimal and binary number.

Decimal Number
·         Base of 10.
·         The value is composed by 10 digit starting from 0 until 9.

Binary Number
·         Base of 2.
·         The number consists only two digit 0 and 1 only.

Hexadecimal Number
·         Base of 16.
·         The composed number start from 0 until F.

·         The number is suitable to present in fours bit number.
    


    Number System Conversion


Formula for Whole Number



Whould Number


Example 1.0
Convert decimal number to binary number.

a) 50

                                                                       50 = 110010


b) 40


Example  1.1
Covert binary number to decimal number.


Example 2.0
Covert decimal number to hexadecimal number.


Read the answer from below  to top.

Example 2.1
Covert hexadecimal number to decimal number.


Example 3.0
To convert  hexadecimal   to binary , we must convert hexadecimal number to decimal number first, then covert it to binary number.

Covert hexadecimal number to binary number.
Step 1:

Convert hexadecimal number to decimal:


Step 2:
Convert decimal number to binary number:


 Example 3.1

Covert binary number to hexadecimal number.

Step 1:

Convert binary number to decimal number:


Step 2:
Convert decimal number to hexadecimal number:



Formula for Decimal Point

Example 4.0

Convert decimal number to binary number :

Step 1:
First, draw the table and  fill in the table with weight (1 ) and value represented (2).

Step 2 :
You have to test value represented one by one. For example, can  40 minus with 32. If can,  put number  1  at binary column. If cannot ( the operation produces negative number), put 0 at the binary column. Do the same step at 0.875.






Example 4.1

Convert binary number to decimal number :


Step 1 :
Put the binary number into the binary column. Circle the value represented if the value in the binary column is 1. 

    
Step 2 :
Add the value that has been circle.


                      32 + 8 = 40                                                          0.5 + 0.25 + 0.125 = 0




Example 5.0

Convert decimal number to hexadecimal number   :

Step 1 :
 You have to test value represented one by one. For example, can  51 minus with 32. If can,  put number  at binary column. If cannot ( the operation produces negative number), put 0 at the binary column. Do the same step at 0.3125.






Step  2:
The binary number  divide into 4 digit. As shown in figure below.



Example 5.1

Convert hexadecimal number to decimal number   :

Step 1 :

Convert  hexadecimal to binary , you can take from number system conversion table.





Post by Nur Amelina Binti Hassan B031310041









GROUP MEMBERS

1) Nur Amelina binti Hassan     B031310041
2) Sim Theong Seng                 B031310165
3) Chan Wilson                        B031310166
4) Lam Mun Hoo                     B031310223