Presentation is loading. Please wait.

Presentation is loading. Please wait.

Number systems, Operations, and Codes

Similar presentations


Presentation on theme: "Number systems, Operations, and Codes"— Presentation transcript:

1 Number systems, Operations, and Codes
1- Decimal Numbers The decimal number system has ten digits . These are : 0 , 1 , 2 , 3, 4 , 5 , 6 , 7 , 8 , 9 . The decimal number system has the base = 10 Example -1- Example -2- Example -3- : Express the decimal number as a sum of the value of each digit.

2 2- Binary Numbers The binary number system has two digits (bits) .
These are : 0 , 1. The binary number system has the base = 2 The weight of a bit increases from right to left in a binary whole number

3 Decimal to Binary Conversion
Method : To get the binary number for a given decimal number , divide decimal number by 2 until the quotient is 0 . Remainders form the binary number . Example -1- Example -2- : convert the following decimal numbers into binary :

4 Binary to Decimal Conversion
Method : Add the weights of all “1”s in a binary number to get the decimal values Example -1- Example -2- Example -3- : convert the following binary numbers , into decimal number ?

5 Convert Decimal Fraction to binary
Method : Repeated multiplication by 2 until fractional part is zero Example -1- Example -2- : convert the following decimal numbers into binary :

6 3- Octal Numbers The Octal number system has 8 digits.
These are : 0 , 1, 2 , 3, 4 , 5 , 6, 7 The Octal system has the base = 8 Assignment: How could we convert Octal to decimal ? give an example . How could we convert Decimal to Octal ? give an example . How could we convert Binary to Octal ? give an example . How could we convert Octal to Binary ? give an example .

7 Convert Decimal to Octal
Divide the given decimal number by base 8 and write the reminders starting first reminder from right to left Example: (57)10 = (?)8 Answer: (71)8 Or using polynomial of weights, like: … Example: (413)10 = Where: (635)8 = = = = (413)10

8 4- Hexadecimal Numbers The hexadecimal number system has 16 digits.
These are : 0 , 1, 2 , 3, 4 , 5 , 6, 7 , 8 , 9, A , B , C , D , E , F The hexadecimal system has the base = 16

9 Convert Decimal to Hexadecimal
Divide the given decimal number by base 16 and write the reminders starting first reminder from right to left Example: (57)10 = (?)16 Answer: (39)16 Or using polynomial of weights, like: … Example: (413)10 = D Where: (19D)16 = D = = (413)10

10 Convert between different Number systems
Base of binary system is 2 = 21 Base of Octal System is 8 = 23 Base of Hexadecimal system is 16 = 24 It means each Hexadecimal digit ~ 4 binary digits, and each Octal digit ~ 3 binary digits Examples: Convert the binary value To the corresponding Octal and hexadecimal value = Octal = 662C Hexadecimal!

11 Hexadecimal Numbers (cont.)
Binary to hexadecimal Method: Break the binary number into 4-bit groups starting at the right-most bit , Then: Replace each 4-bit group with the equivalent hexadecimal symbol.

12 Hexadecimal Numbers (cont.)
hexadecimal to Binary Method : Replace each hexadecimal symbol with the appropriate four bits.

13 Hexadecimal Numbers (cont.)
hexadecimal to Decimal Method Convert the hexadecimal to binary then convert from binary to decimal.

14 Hexadecimal Numbers (cont.)
Decimal to hexadecimal Method : Repeated division of a decimal number by 16 .

15 Arithmetic Operations 1st and 2nd Complement
1st complement : Method : Invert each bit to get the 1st complement Example -1- Example -2- : Determine the first complement of the following binary 2nd complement : Method -1- : nd complement = 1st complement Example -1-

16 Arithmetic Operations 1st and 2nd Complement (cont.)
Method -2- : Change all the bits to the left of the least significant 1 to gets the 2nd complement Example -1- : Determine the 2nd complement of the following binary Application Example


Download ppt "Number systems, Operations, and Codes"

Similar presentations


Ads by Google