Presentation is loading. Please wait.

Presentation is loading. Please wait.

Number Representation. Representing numbers n Numbers are represented as successive powers of a base, or radix.

Similar presentations


Presentation on theme: "Number Representation. Representing numbers n Numbers are represented as successive powers of a base, or radix."— Presentation transcript:

1 Number Representation

2 Representing numbers n Numbers are represented as successive powers of a base, or radix

3 Representing numbers n Numbers are represented as successive powers of a base, or radix n The powers increment upwards to the left, starting with zero to the far right

4 Representing numbers n Numbers are represented as successive powers of a base, or radix n The powers increment upwards to the left, starting with zero to the far right n For any base, b: b 0 b 1 b 2 b 3 etc....

5 Representing numbers n We typically use a base of 10 (presumably because we have ten fingers), the decimal system 10 0 1 2 3 etc.... ones column tens column hundreds column thousands column

6 Representing numbers n For any base b, there are b digits

7 Representing numbers n For any base b, there are b digits n In base 10, there are 10 digits – 0 through 9

8 Representing numbers n For any base b, there are b digits n In base 10, there are 10 digits – 0 through 9 10 0 1 ones column tens column When we want to represent a value greater than the highest digit, we have to make a change in the appropriate column to the left 1234567891708920 etc....

9 Representing numbers n In any base b, if we have n digits, the range of values we may represent is b n n If we have two digits in base 10, b=10 and n=2 n With two digits, we can represent 10, or 100, values – 0 through 99 2

10 Representing numbers in computers n Computers may store and transmit numbers in the form of circuits

11 Representing numbers in computers n Computers may store and transmit numbers in the form of circuits n A circuit has two states: ON and OFF

12 Representing numbers in computers n Computers may store and transmit numbers in the form of circuits n A circuit has two states: ON and OFF n Computers are therefore able to represent numbers in a system that has two digits

13 Representing numbers in computers n Computers may store and transmit numbers in the form of circuits n A circuit has two states: ON and OFF n Computers are therefore able to represent numbers in a system that has two digits n Base two, the binary system, fits this description

14 Representing numbers in computers n Computers may store and transmit numbers in the form of circuits n A circuit has two states: ON and OFF n Computers are therefore able to represent numbers in a system that has two digits n Base two, the binary system, fits this description n The binary number system has the digits 0 and 1

15 Binary numbers n Binary numbers have only two digits

16 Binary numbers n Binary numbers have only two digits n But that distinction aside, the system of representing numbers is exactly the same as in the decimal system: 2 0 2 1 2 2 2 3 etc.... ones column twos column fours column eights column 2 4 sixteens column

17 Binary numbers n With only two digits, a sequence of binary numbers changes columns more quickly than a series of decimal numbers: Decimal Binary 0 0 1 1 2 10 3 11 4 100 5 101 6 110 7 111 8 1000 etc....

18 Essential terminology n When a binary number is used by a computer, a single digit is called a bit (short for binary digit) 10110010 bit n Numbers (computer words) are often stored in sequences of eight bits, called a byte byte n A sequence of four bits is called a nibble nibble

19 Essential terminology n The bit that represents the lowest power is called the least significant bit 10110010 least significant bit n The bit that represents the highest power is called the most significant bit most significant bit

20 Essential terminology n Larger numbers need to be represented with two or more bytes (16 bits form a two-byte word) 10110010 least significant byte n The byte that represents the lower powers of the number is called the least significant byte most significant byte 10110010 n The byte that represents the higher powers of the number is called the most significant byte

21 Bit resolution n A computer system is often referred to as an “n bit system,” meaning it represents numbers with n digits

22 Bit resolution n A computer system is often referred to as an “n bit system,” meaning it represents numbers with n digits n In a binary system, b=2, so this is a statement to describe the resolution of the system

23 Bit resolution n A computer system is often referred to as an “n bit system,” meaning it represents numbers with n digits n In a binary system, b=2, so this is a statement to describe the resolution of the system n An 8-bit system can represent 2, or 256, values 8

24 Bit resolution n A computer system is often referred to as an “n-bit system,” meaning it represents numbers with n digits n In a binary system, b=2, so this is a statement to describe the resolution of the system n An 8-bit system can represent 2, or 256, values n A 16-bit system can represent 2, or 65,136 values 8 16

25 Hexadecimal notation n Base 16, the hexadecimal system, is often used in computer parlance

26 Hexadecimal notation n Base 16, the hexadecimal system, is often used in computer parlance n Since our Arabic number system does not have digits to represent values greater than 9, alphabetic characters are used: DecimalHexadecimal 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 A 11 B 12 C 13 D 14 E 15 F

27 Hexadecimal notation n Hexadecimal notation is a convenience

28 Hexadecimal notation n Hexadecimal notation is a convenience n A four-bit nibble can be expressed as one hexadecimal bit

29 Hexadecimal notation n Hexadecimal notation is a convenience n A four-bit nibble can be expressed as one hexadecimal bit n An eight-bit byte can be expressed as two hex bits 10100110 A6 To convert to decimal, multiply the most significant nibble by 16, then add the least significant nibble: (10 * 16) + 6 = 166


Download ppt "Number Representation. Representing numbers n Numbers are represented as successive powers of a base, or radix."

Similar presentations


Ads by Google