2.2 General Positional-Number-System Conversion Binary, octal or hexadecimal to decimal Examples Return Next
2.2 General Positional-Number-System Conversion Decimal to binary, octal or hexadecimal When D is a integer Return Back Next
2.2 General Positional-Number-System Conversion Divide D by r the remainder will be c0. Furthermore, the quotient Q has the same form as the oriental D. Therefore, successive divisions by 2 yield successive digits ci of D from right to left, until all the digits of d have been derived. Return Back Next
2.2 General Positional-Number-System Conversion Examples 252=12 remainder 1 c0 2=6 remainder 0 c1 2=3 remainder 0 c2 2=1 remainder 1 c3 2=0 remainder 1 c4 2510=110012 Return Back Next
2.2 General Positional-Number-System Conversion Simply 8 22 (3 179 2 89 (1 179 (LSB) 8 2 (6 8 (2 2 44 (1 2 22 (0 2 11 (0 17910=2638 2 5 (1 2 (1 16 11 (3 179 1 2 (0 16 (B 2 (1 (MSB) 17910=B316 17910=101100112 Return Back Next
2.2 General Positional-Number-System Conversion When D is a fraction Multiply D by r. Return Back Next
2.2 General Positional-Number-System Conversion The integer will be c-1. Furthermore, the fraction of the product P has the same form as the oriental D. Therefore, successive multiply by r yield successive digits c-i of D from left to right, until the error is satisfying. . Examples 0.625 2=0.25+1 integer 1 c-1 2=0.5+0 integer 0 c-2 2=0.0+1 integer 1 c-3 0.62510=0.1012 Return Back Next
2.2 General Positional-Number-System Conversion Converting with six significant digits. 0.7262 0.7268 1) 0.4522 5) 0.8088 0) 0.9042 6) 0.4648 1) 0.8082 3) 0.7128 1) 0.6162 5) 0.6968 1) 0.2322 5) 0.5688 0) 0.464 4) 0.544 0.72610 0.1011102 0.72610 0.5635548 Return Back Next
2.2 General Positional-Number-System Conversion Binary to octal or hexadecimal Examples 1000110011102 = 100 011 001 1102 = 43168 1000110011102 = 1000 1100 11102 = 8CE16 10.10110012 = 010.101 100 1002 = 2.5448 10.10110012 = 0010.1011 00102= 2.B216 Octal or hexadecimal to binary Examples 5.678= 101.110 111 3.A516= 11.1010 0101 Return Back Next
2.2 General Positional-Number-System Conversion bit, byte, word, and nibble bit –– one binary digit is called bit. byte –– 8 binary digits is called byte. word –– n-bit word means one word has n binary digits. nibble –– 4-bit or half-byte is called nibble. Example A hexadecimal number is 5678ABCD16 . How many binary digits has it? How many 8-bit bytes has it? What is the hexadecimal value of every 8-bit byte? How many 2-byte words has it? How many 32-bit words has it? Return Back Next
2.2 General Positional-Number-System Conversion Answer 5678ABCD16 =0101 0110 0111 1000 1010 1011 1100 11012 It has 32 binary digits. It has four 8-bit bytes. The hexadecimal values of four 8-bit bytes are 5616, 7816, AB16, CD16. It has two 2-byte words. It has one 32-bit word. A file’s size is 20bytes. How many 1-bit memory units need for saving this file? If a file’s size is 1kbytes? Return Back