Presentation is loading. Please wait.

Presentation is loading. Please wait.

Number Systems Ron Christensen CIS 121.

Similar presentations


Presentation on theme: "Number Systems Ron Christensen CIS 121."— Presentation transcript:

1 Number Systems Ron Christensen CIS 121

2 Positional Notation “Positional Notation”
Value of a digit depends on the position of the digit Positional Notation permits unique representation of Integers

3 Positional Notation Decimal numbers are “Base 10 positional notation”
Base 10 means that the value of any position is a multiple of a power of 10 Binary numbers are “Base 2 Positional notation” Octal numbers are “Base 8 Positional notation” Hexadecimal numbers are “Base 16”

4 Positional Notation The value of digit n is baseN
N0 = 1 no matter what N is In decimal notation the value of digit N is 10N “19” = 1x x100

5 Base 10 Base 10 uses ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
This is called a decimal number system and is the one with which people are most familiar.

6 Why Binary? Build Transistor

7 Base 2 Base 2 has exactly two symbols: 0 and 1.
This is called a binary system and all numbers must be formed using these two symbols.

8 Base 8 Base 8 uses eight symbols: 0, 1, 2, 3, 4, 5, 6, and 7.
This is called an octal number system and is a convenient shorthand for base 2 numbers. One octal digit is the equivalent of three binary digits.

9 Base 16 Base 16 uses sixteen symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. This system is called hexadecimal and can also serve as a shorthand for the binary number system.

10 Converting Number Systems
It is sometimes necessary or more convenient to convert numbers in one system to those in another.

11 Converting Base 2 (Binary) to Base 10 (Decimal)
In binary notation the value of digit N is 2N “1011” = 1x24 + 0x23 + 1x21 + 1x20 = = 11 What is the decimal value of ? 1x28 + 1x27 + 1x25 + 1x24 + 1x20 = = 433

12 Converting Base 2 to Base 8
To convert base 2 to base 8, combine the binary digits from the right in groups of three and convert. 111 101 001 011 7 5 1 3

13 Converting Base 2 to Base 16
To convert base 2 to base 16, combine the binary digits from the right in groups of four and translate. 1111 0100 1011 F 4 B

14 Converting Base 8 to Base 2
To convert base 8 to base 2, convert each octal digit into 3 binary digits. 7513 111 101 001 011

15 Converting Base 8 to Base 16
To convert base 8 to base 16, first translate into base 2 then into base 16. 7513 111 101 001 011 1111 0100 1011 F 4 B

16 Converting Base 10 to Base 2
To convert base 10 to base 2, divide the number repeatedly by 2; use remainders as answer. On your own, try: 2363.

17 Practice What is the binary value of 120?
First division is 120/2. Q=60, R=0 Second division is 60/2. Q=30, R=0 Third division is 30/2. Q=15, R=0, Fourth division is 15/2. Q=7, R=1 Fifth division is 7/ Q=3, R=1 Sixth division is 3/2. Q=1, R=1 Seventh division = 1 / 2. Q=0, R=1 Quotient is zero, so we stop. 12010 =

18 Converting Base 10 to Base 8
To convert base 10 to base 8, divide the number repeatedly by 8; use remainders as answer. On your own, try: 2363.

19 Converting Base 10 to Base 16
To convert base 10 to base 16, divide the number repeatedly by 16; use remainders as answer. On your own, try: 2363.

20 Converting Base 16 to Base 2
To convert base 16 to base 2, translate each hexadecimal digit to 4 binary digits. On your own, try: 4BC.

21 Converting Base 16 to Base 8
To convert base 16 to base 8, translate to base 2 then to base 8. On your own, try: 4BC.

22 Converting Base 16 to Base 10
To convert base 16 to base 10, expand the number and translate base 16 digits to base 10. On your own, try: 4BC.

23 Practice The number “123DF” in decimal is
1x x x x x160 = 74719

24 Conversions are done with calculators
Number Systems Binary is used by hardware Hex numbers are used in many places HTML color codes Decimal numbers appear in user interfaces Conversions are done with calculators

25 Binary Encoding – Data Binary numbers work well for positive integers
Not all data is positive integer: Negative integers Real numbers, e.g. decimal points Characters


Download ppt "Number Systems Ron Christensen CIS 121."

Similar presentations


Ads by Google