Beruflich Dokumente
Kultur Dokumente
Dr. Shadi A. Alboon Electronics Engineering Department Hijjawi Faculty for Engineering Technology Yarmouk University, Irbid 21163, Jordan shboon@yu.edu.jo
Voltage Level
Numbers systems
Decimal Radix 10 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
ELE 574
Binary Radix 2 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Octal Radix 8 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17
Hex Radix 16 0 1 2 3 4 5 6 7 8 9 A B C D E F
5
ELE 574
Binary
The word binary is derived from the Latin root bini (or two by two). Binary number has base 2, we use only two symbols, Each digit is one of two numbers: 0 and 1 0,1,10,11,100,101 etc Each digit is called a bit Eight binary bits make a byte Each position in a binary number represents 2n Thus 10101= 1 X 20 + 0 X 21 + 1 X 22 +0 X 23 + 1 X 24
ELE 574 Dr. Shadi Alboon 7
Binary
Integers
ELE 574
Binary
Example
The following shows that the number (11001 11001) )2 in binary is the same as 25 in decimal decimal. . The subscript 2 shows that the base is 2.
Binary
Real
Example The following shows that the number (101 101. .11 11) )2 in binary is equal to the number 5.75 in decimal decimal. .
ELE 574
10
Octal
The word octal is derived from the Latin root octo (eight). Octal numbers has base 8 We use eight symbols to represent a number. Each digit is a number from 0 to 7 Each digit represents 3 binary bits Was used in early computing, but was replaced by hexadecimal
ELE 574 Dr. Shadi Alboon 11
Octal
Integers
ELE 574
12
Octal
Example The following shows that the number (1256) 1256)8 in octal is the same as 686 in decimal decimal. .
13
Hexadecimal
The word hexadecimal is derived from the Greek root hex (six) and the Latin root decem (ten). Hexadecimal numbers has base 16 16 DIGITS 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Note that the symbols A, B, C, D, E, F are equivalent to 10, 11, 12, 13, 14, and 15 respectively. Numbers go 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20 etc
ELE 574 Dr. Shadi Alboon 14
Hexadecimal
Integers
ELE 574
15
Hexadecimal
Example The following shows that the number hexadecimal is equivalent to 686 in decimal decimal. . (2AE) AE)16 16 in
16
ELE 574
17
Each bit represents a power of 2 Every binary number is a sum of powers of 2 Decimal Value = (dn-1 2n-1) + ... + (d1 21) + (d0 20) Binary (10011101)2 = 27 + 24 + 23 + 22 + 1 = 157
5 4 3 2 1 0
1
27
0
26
0
25
1
24
1
23
1
22
0
21
1
20
18
37 = (100101)2
most significant bit stop when quotient is zero
ELE 574 Dr. Shadi Alboon 19
10111
1 X 16
0X8
1x4
1x2
1X1
16 + 0 + 4 + 2 + 1 = 23
ELE 574 Dr. Shadi Alboon 21
22
ELE 574
23
422 = (1A6)16
ELE 574
Important Properties
How many possible digits can we have in Radix r ? r digits: 0 to r 1 What is the result of adding 1 to the largest digit in Radix r? Since digit r is not represented, result is (10)r in Radix r Examples: 12 + 1 = (10)2 78 + 1 = (10)8 910 + 1 = (10)10 F16 + 1 = (10)16 What is the largest value using 3 digits in Radix r? In binary: (111)2 = 23 1 In octal: (777)8 = 83 1 In Radix r: In decimal: (999)10 = 103 1 largest value = r3 1
ELE 574 Dr. Shadi Alboon 25
rn values: 0 to rn 1
26
Representing Fractions
A number Nr in radix r can also have a fraction part: Nr = dn-1dn-2 d1d0 . d-1 d-2 d-m+1 d-m 0 di < r Integer Part Fraction Part Radix Point The number Nr represents the value: Nr = dn-1 rn-1 + + d1 r + d0 +
Nr =
ELE 574
di ri
i=0
dj rj
j = -m
Dr. Shadi Alboon 27
= 2103 + 4102 + 9 + 810-1 + 710-2 = 23 + 22 + 20 + 2-1 + 2-4 = 13.5625 = 782 + 3 + 68-1 + 48-2 = 451.8125 = 10162 + 16 + 15 + 816-1 = 2591.5 = 452 + 25 + 3 + 5-1 = 113.2 Digit 6 is NOT allowed in radix 6
Dr. Shadi Alboon 28