Upload
armand-bean
View
17
Download
1
Embed Size (px)
DESCRIPTION
Base ‘b’ number. In general a number system can have any base b the digit used are 0, 1, … , b-1 The weight of i th place is b i The conversion formula from base b into decimal number is Commonly used base are 2, 3, 8, 10, 16,. for i = 0 to n – 1 for an n digit quantity. - PowerPoint PPT Presentation
Citation preview
1
• In general a number system can have any base b
• the digit used are 0, 1, … , b-1
• The weight of ith place is bi
• The conversion formula from base b into decimal number is
• Commonly used base are 2, 3, 8, 10, 16, ...
Base ‘b’ number
for i = 0 to n – 1
for an n digit quantity
1
0
ni
i
iixb
2
Bases 2, 8, and 16 are related
Binary Decimal Octal Hexadecimal0000 0 0 00001 1 1 10010 2 2 20011 3 3 30100 4 4 40101 5 5 50110 6 6 60111 7 7 71000 8 10 81001 9 11 91010 10 12 A1011 11 13 B1100 12 14 C1101 13 15 D1110 14 16 E1111 15 17 F
3
• From binary to octal– make groups of 3 bits from right to left
01 110 1102 1668
• From octal to binary– make each digit as 3 bits sequence
2768 010 111 1102
• From binary to hexadecimal– make groups of 4 bits from right to left
0111 01102 7616
• From hexadecimal to binary– make each digit as 4 bits sequence
3716 0011 01112
Conversion
4
• Convert from base b1 to decimal
• Convert from decimal to base b2
• Direct conversion from base b1 and base b2
– we will not pursue this anymore• Decimal to Hexadecimal
– Divide by 16 recursively and collect digit from right to left from the remainders.
– Example 347110 = D8F16
• 3471 divided by 16 gives 216, remains 15 (F)
• 216 divided by 16 gives 13, remains 8 (8)
• 13 divided by 16 gives 0, remain 13 (D)
More on Conversion