Presentation is loading. Please wait.

Presentation is loading. Please wait.

Number Systems.

Similar presentations


Presentation on theme: "Number Systems."— Presentation transcript:

1 Number Systems

2 Number Systems We are using the decimal number system to represent numerical values Binary – Octal – Hexadecimal number systems are used in digital computer field Digital computers could not use decimal numbers in calculations

3 Decimal Number System The system has 10 symbols (0,1,2,3,4,5,6,7,8,9)
The base of the system = 10 Notice the difference between the values of the digit “1” in this number The value of any number is calculated by the base-position rule Ex: What is the value of ( )? Thousands Hundreds Tens Ones Tenths Hundredths 1 2 3 4 . 5 6 1000 100 10 0.1 0.01 Position Value 200 30 0.5 0.06 Number Value

4 Binary Number System The system has only 2 symbols (0,1)
The base of the system is “2” Examples of binary numbers: (101,111 , ) Binary number system is used in representing all characters and symbols by using Standard Code as: ASCII (7 bits = 128 characters) ANSI (8 bits = 256 characters) UNICODE (16 bits = characters)

5 Example on Binary number system
What is the value of this binary number ( )2 in decimal? X = 23.25

6 Octal Number System The system has 8 symbols (0,1,2,3,4,5,6,7)
The base of the system = 8 Examples of octal numbers: (171, 11.4 , 512) To find the value of octal number in our decimal system you should take care of the difference between the 2 bases. The number (17)8 is not (17) in decimal

7 Setting UNIX Access Rights
UNIX access rights are assigned to every file and directory on the server. Rights have the form: drwxrwxrwx d means if it is a directory or not r means read w means write x means execute There are three sets of rwx rights. These are for you, for those in your group and for everyone else. Each letter is one bit.

8 Example on Octal number system
What is the decimal value for this octal number (137.4)8 X = 95.5

9 Properties of Hexadecimal
A hexadecimal number is exactly one-half of a byte. Since a byte can be from in decimal, it also can be from #00 to #FF in hexadecimal. Use the pound sign (#) as a prefix for hexadecimal numbers. Binary and hexadecimal numbers carry to the other half of the same byte at the same time.

10 Uses of Hexadecimal On the Internet, documents are written in HTML, the hypertext markup language. All colors on computers are a combination of three colors; red, blue and green; known as RGB. In HTML, you set the values of RGB using hexadecimal numbers. The form for a color is: #RRGGBB

11 Some Hexadecimal HTML Color Codes

12 Hexadecimal Number System
The system has 16 symbols: (0,1,2,3,…,9,A,B,C,D,E,F) The base of the system = 16 Example of hexadecimal numbers: (1D9, 11B4 , 54F4.1A)

13 Example on Hexadecimal number system
What is the decimal value for this hexadecimal number (AB.4)16 AB.4 = 10*(16)1 + 11*(16)0 + 4*(16)-1 = 10* *1 + 4/16 = = (171.25)10

14 Conversion between number systems
Converting from any number to decimal Converting from decimal to any number system Converting from binary to octal and hexadecimal Converting from octal to hexadecimal system Converting from any number system to another

15 Conversion from any number system to decimal
Using Base and Position rule What is the decimal value of this number (A15.8)16 ? (A15.8)16 = A*(16)2 + 1*(16)1+5*(16)0 +8*(16)-1 = 10* *16 +5*1 + 8/16 = = (2581.5)10

16 Conversion from decimal to other systems
To get the digits of decimal number we can use the successive division by 10 (base) till there will be no reminder (Reminder = 0) Ex:

17 Conversion from decimal to other system (integer part)
We can use the successive division on the new base (2 in case of converting to binary system) till having no reminder The reminders (from bottom to up) are forming the number in the new number system Example: What is the value of (5)10 in binary system? The result is: (101)2 Reminders

18 Conversion from decimal to other system (fraction part)
We can use the successive multiplication by the new base (2 in case of converting to binary system) till having no fraction The integer numbers (from top to bottom) are forming the fraction number in the new number system What is the value of (0.125)10 in binary? fraction integer *0.125 *0.25 *0.5 The result is: (0.001)2

19 Conversion between Octal and binary
Octal number system uses 8(23) symbols where binary number system uses 2 (21) symbols Each octal digit will be converted to 3 consecutive digits to convert it to binary system Each 3 consecutive binary digits will be converted to 1 octal digit to convert it to octal system Ex: What is the value of (705.3)8 inbinary? (705.3)8 = = ( )2 Ex: What is the value of ( )2 in octal? ( )2 = ( )2 = ( )8 = (146.44)8

20 Conversion between Hexadecimal and binary
Hexadecimal number system uses 16 (24) symbols where binary number system uses 2 (21) symbols Each hexadecimal digit will be converted to 4 consecutive digits to convert it to binary system Each 4 consecutive binary digits will be converted to 1 hexadecimal digit to convert it to hexadecimal system Ex: What is the value of (AFC3.9E)16 in binary? (AFC3.9E)16 = = ( )2 Ex: What is the value of ( )2 in hexadecimal? ( )2 = ( )2 = (6 E . D 8)16 = (6E.D8)16

21 Conversion between Hexadecimal and Octal
We can convert the octal (hexadecimal) to binary and then convert the binary to the hexadecimal (octal) What is the value of this number (AFC3.9E)16 in octal? (AFC3.9E)16 = ( )2 = ( )2 = ( )8 = ( )8

22 Conversion from any system to another
We can use the binary system is an intermediate system or you can use the decimal as an intermediate number system 10 project 10 Ass 10 Lab First term 15 Second term 15 Final 40


Download ppt "Number Systems."

Similar presentations


Ads by Google