Wednesday, 1 May 2013

Chapter 2 : Data Representation

           Data Types
  • Represented in binary-coded form.
  •  Only have 0 & 1 to represent everything.


The Decimal Number System
·         The Base 10 number system uses the digit: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.

                      


Example : The number 81 means eight tens plus one:
                                     81=(8*10) + 1

           The Binary Number System
  •   A variable whose value may be either 0 or 1.
  • Bits are organized into groups of 8 called bytes.
  • Represented to the base 2

                   Example: 102 = ( 1 * 21 )  + ( 0 * 20 ) = 210

             The Octal Number System
  •  Base-8 number system
  • Uses the digits 0, 1, 2, 3, 4, 5, 6, 7.


           The Hexadecimal Number System 
  • The hexadecimal number system uses the following digits:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Number Conversion
 
Two’s complement benefit
  •  One representation of zero
  •  Arithmetic works easily
  • Range for a word length of n bits :  -(2n-1) à (2n-1 – 1)
















By     Kuan Wei Sern

No comments:

Post a Comment