十進制轉成N進制( 2、8、16 )
方法:整數、小數,要 分開 算。
(1)整數部分:使用連除法,連除N,取餘數當答案,最後一個餘數是MSB 。
(2)小數部分:使用連乘法,連乘N,取整數當答案,最後一個整數是LSB 。
Ex: 100.125D = 1100100.001B
| 2 | 1 | 0 | 0 | | | | . | | | | 0 | . | 1 | 2 | 5 | | | | | | |
| | 2 | 5 | 0 | . | . | 0 | |
| | X | | | | | 2 | | | | | | |
| | 2 | 2 | 5 | . | . | 0 | | | 0 | ß | 0 | . | 2 | 5 | 0 | | | | | | |
| | 2 | 1 | 2 | . | . | 1 | | | | X | | | | 2 | | | | | | | |
| | | 2 | 6 | . | . | 0 |
| | 0 | ß | 0 | . | 5 | 0 | | | | | | | |
| | | 2 | 3 | . | . | 0 | | | | X | | | 2 | | | | | | | | |
| | | 2 | 1 | . | . | 1 | | | 1 | ß | 1 | . | 0 | | | | | | | | |
| | | | 0 | . | . | 1 | | | | | 0 | . | 0 | | | | | | | | |
| | | | | | M | S | B |
| | L | S | B | | | | | | | | | |
整數除至商為0止, 小數乘至小數點後為0止 ,若無法為0則依題目規定算至小數點後第幾位。 | ||||||||||||||||||||||
| | | | | | | | | | | | | | | | | | | | | | |
Ex: 100.125D = 144.1Q = 144.1O = 144.1(8)
| 8 | 1 | 0 | 0 | | | | . | | | | | | 0 | . | 1 | 2 | 5 | | | | | | |
| | 8 | 1 | 2 | . | . | 4 |
|
| | | | X | | | | | 8 | | | | | | |
| | 8 | | 1 | . | . | 4 | | | 1 | | ß | ß | 1 | . | 0 | 0 | 0 | | | | | | |
| | | | 0 | . | . | 1 | | | | | | | 0 | . | 0 | | | | | | | | |
| | | | | | M | S | B | | | | L | S | B | | | | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | |
整數除至商為0止, 小數乘至小數點後為0止 ,若無法為0則依題目規定算至小數點後第幾位。 |
Ex: 100.125D = 64.2H
1 | 6 | 1 | 0 | 0 | | | | . | | | | | | 0 | . | 1 | 2 | 5 | | | | | | |
| | 1 | 6 | 6 | . | . | 4 |
|
| | | | X | | | | 1 | 6 | | | | | | |
| | | | 0 | . | . | 6 | | | | | | | | | 7 | 5 | 0 | | | | | | |
| | | | | | | | | | | | | | | 1 | 2 | 5 | | | | | | | |
| | | | | | M | S | B | | 2 | | ß | ß | 2 | . | 0 | 0 | 0 | | | | | | |
| | | | | | | | | | | L | S | B | 0 | . | 0 | | | | | | | | |
整數除至商為0止, 小數乘至小數點後為0止 ,若無法為0則依題目規定算至小數點後第幾位。 |