Navi

Number Bases

  • Binary [Base 2]
  • Octal [Base 8]
  • Decimal [Base 10]
  • Hexadecimal [Base 16]

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

The Decimal Number System (denary representation) uses base 10. It includes the digits from 0 through 9. The weighted values for each position is as follows:




Therefore Radix = 10
Decimal value of the number depending on the position of each digit in the sequence:
Sequence: dn-1, .... d2, d1, d0
Value: dn-1-rn-1 + .... d2.r2 + + d0.r0 d1.r1
Examples of Decimal Numbers:
4785 = 4 x 103 + 7 x 102 + 8 x 101 + 5 x 100
         = 4 x 1000 + 7 x 100 + 8 x 10 + 5 x 1 
         = 4000 + 700 + 80 + 5.

Decimal number
Reduce power by 1 each time moving to the right point radix. Examples of Decimal Numbers
0543 = 0 x 100 + 5 x 10-1 + 4 x 10-2 + 3 x 10-3
          = 0 x 1/1 + 5 x 1/10 + 4 x 1/100 + 3 x 1/1000 = 0 + 5 x 0.1 + 4 x 0:01 + 3 x 0,001 
          = 0 + 0.5 +0.04 + 0,003.


The Binary Number System

1. In the computer, the data is encoded in electrical signals. Binary coding is commonly used for:
2. Computer or electronic device circuit can mewakilikan two conditions state (bistable device).
3. Binary coding in accordance with Boolean algebra.


Problem with Binaries number
1. Difficult to read or easy to make mistakes.
2. Binaries elusive man.
3. Example: When henyak state memory address.

  • To specify the address of a variable. If there is a 64KB memory area.
  • Therefore, there are 64 x 1024 memory cell (location)
  • 65,536 locations with addresses from 0 to 65.535.
  • If the binary, from = 0 to 00000000 00000000 11111111 11111111 = 65,535.

4.    This makes it difficult for programmers who want to specify the address of a variable.

Solution:

1. Use decimal numbers.
2. Use a bit more space.
3. Readable.
4. Programming but sometimes want to know certain bits in a 'bit location'.
5. example:

  • Do MSD for 289 510 is on OR off?.
  • What is 4 Left-Most bit to 289 510
  • To know, we have to change the whole number of decimal to binary. Difficult!


6.   Use the number system "to describe a group of digits bits".

  • Example: 3-bit or 4-bit.



       Although 910 = 10012, the number 9 is not necessarily represented by 1001 only the    
       computer, this might be represented by a number (still a combination of 0 & 1) are    
       longer. To get: -


  • Pleasure manipulate numbers. If the numbers are marked, all arithmetic operations can be produced by mixing only.
  • Density and efficiency. A little bit more, more compact, shorter circuit, faster.
  • Accuracy. many bits, to be exact.
  • Compromise with density. Therefore, the need to use different formats for different data types.
  • Data communication standard. data should be compatible with various devices that carry it.



The Octal Number System

1. Alphabet consisting of octal numbers 0, 1, 2, 3, 4, 5, 6, 7
2. Therefore, Radix = 8
3. Each octal digits can be represented by 3 bits
4. Converting a binary number to octal
5. Collect in compilation 3 bits (beginning with radix point)
6. Example: 11001001110111102

001
100
100
111
011
110
1
4
4
7
3
6

by the 11001001110111102 = 1447368 Is the MSB of 21 578? 28 = 25 178 0102 by the MSB is 0 What is 4 Left-Most bit of 25 178? 18 = 0012 and 78 = 1112 So, the Left-Most Bit 4 is 25 178 1111.


 The Hexadecimal number system

Ø  Alphabet consisting of hexadecimal numbers 0, 1, 2, 3, 4, 5, 6, 7.8, 9, A, B, C, D, E, F
Ø  Therefore, Radix = 16
Ø  Each digit HEX can be represented by 4 bits
Ø  Converting binary to Hex.
Ø  Collect in assembly 4 bits (start from point radix)
Ø  Example: 11001001110111102


1100
1001
1101
1110
C
9
D
E

Ø  Therefore, 11001001110111102 = C9DE16
Ø  Hex numbers in accordance with memory storage unit.
Ø  A cell = 1 byte = 2 groups of 4 bits (nibble) = 2 digit Hex
Ø  Therefore, the address for the memory size of 256 bytes can be represented from     00 to FF.



0 comments: