Beyond base 10: Nondecimal based number system - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

Beyond base 10: Nondecimal based number system

Description:

Base 10 the commonly used number system. 10 unique symbols are used to represent values ... based number system. Base 'N' Employs 'N' number of unique symbols ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 23
Provided by: Jame72
Category:

less

Transcript and Presenter's Notes

Title: Beyond base 10: Nondecimal based number system


1
Beyond base 10 Non-decimal based number system
  • What exactly is decimal?
  • How do other number systems work (binary, octal
    and hex)
  • How to convert to and from non-decimal number
    systems

2
What is decimal?
  • Base 10 the commonly used number system
  • 10 unique symbols are used to represent values

Number of digits is based onnumber of digits
Largest value representable by a single digit 9
3
Binary
  • Base two
  • Employs two unique symbols (0 and 1)
  • Largest decimal value that can be represented by
    1 binary digit 1
  • The only language that the computer understands
    (machine language bits (binary digits)

0000 1001 0010 1111 1000 0000 1111 1010 0000 1111
0000 1111
4
Table of binary values
5
Problems with binary
  • A computer language not a people language!
  • e.g., 0000 1111 0000 1111 ? What is my computer
    doing?
  • Easier number systems later used
  • Octal
  • Hexadecimal

6
Octal
  • Base eight
  • Employs eight unique symbols (0 - 7)
  • Largest decimal value that can be represented by
    1 octal digit 7

7
Table of octal values
8
Hexadecimal (hex)
  • Base 16
  • Employs sixteen unique symbols (0 9 plus A, B,
    C, D, E, F)
  • Largest decimal value that can be represented by
    1 hex digit 15

9
Table of hex values
10
Arbitrary based number system
  • Base N
  • Employs N number of unique symbols
  • Largest decimal value that can be represented by
    1 digit in this base N - 1

11
Converting between different number systems
  • Binary to/from octal
  • Binary to/from hexadecimal
  • Octal to/from hexadecimal
  • Decimal to any base
  • Any base to decimal

12
Binary to Octal
  • 3 binary digits equals one octal digit (remember
    238)
  • Form groups of three at the decimal
  • For the integer portion start grouping at the
    decimal and go left
  • For the fractional portion start grouping at the
    decimal and go right
  • e.g. 101 1002 ???8

.
13
Octal to binary
  • Each octal digit forms three binary digits
  • e.g. 12.58 ???2

.
14
Binary to hexadecimal
  • 4 binary digits equals one hexadecimal digit
    (remember 248)
  • Form groups of four at the decimal
  • For the integer portion start grouping at the
    decimal and go left
  • For the fractional portion start grouping at the
    decimal and go right
  • e.g., 1000.01002 ???16

.
15
Hex to binary
  • Each hex digit forms four binary digits
  • e.g., A.316 ???2

.
16
Octal to/from hexadecimal
  • Convert to binary first!
  • e.g., 258 to ???16 (octal to hex)

17
Octal to/from hexadecimal
  • e.g., 1516 to ???8 (hex to octal)

18
Decimal to any base
  • Split up the integer and the rational portions
  • For the integer portion keep dividing by the
    target base until the remainder is less than the
    target base
  • For the rational portion keep multiplying by the
    target base until either the resulting product
    equals zero (or you have the desired number of
    places of precision)

19
Decimal to any base an example
.2
  • e.g., 910 to ???2

9 / 2 q 4 r 1
/ 2 q 2 r 0
/2 q 1 r 0
20
Any base to decimal
  • Multiply each digit by the base raised to some
    exponent1 and sum the resulting products.
  • i.e. d7 d6 d5 d4. d3 d2 d1b
  • Base b

3 2 1 0 -1 -2
-3
Position of digits
Number to be converted
Value in decimal (d7b3) (d6b2) (d5b1)
(d4b0) (d3b-1) (d2b-2) (d1b-3)
1 The value of this exponent will be determined
by the position of the digit.
21
Any base to decimal an example
  • e.g., 128 to ???10

1 2.
Value in decimal (181) (280) (18)
(21) 8 2 1010
22
Summary (important points)
  • How numbers are representing using different
    bases
  • How to convert a number from one base to another
  • Binary to/from octal
  • Binary to/from hexadecimal
  • Octal to/from hexadecimal
  • Any base to/from decimal
  • Decimal to/from any base
Write a Comment
User Comments (0)
About PowerShow.com