Big Brain - Decimal-hexadecimal conversion.

Hacker #06
 Decimal-hexadecimal conversion.         .BIG BRAIN 
                                                                
  TABLE 1. Decimal equivalents of hexadecimal           
             Numbers in each position.                            
  ╔══════════════════════════╦ ════════════════════════════╗     
  ║ First position ║ Second position ║ ▓▓  
  ║ (shes) (des)(shes) (des) ║ (shes) (des) (shes) (des) ║ ▓▓  
  ║ # ...0 0 # ...8 8 ║ # ..0.   0#..8. 128 ║ ▓▓  
  ║ # ...1 1 # ...9 9 ║ # ..1.  1b #..9. 144 ║ ▓▓  
  ║ # ...2 2 # ...A 10 ║ # ..2.  32#..A. 1b0 ║ ▓▓  
  ║ # ...3 3 # ...At 11 ║ # ..3.  48#..V. 17b ║ ▓▓  
  ║ # ...4 4 # ...С 12 ║ # ..4.  b4 # ..S. 192 ║ ▓▓  
  ║ # ...5 5 # ...D 13 ║ # ..5.  80#..D. 208 ║ ▓▓  
  ║ # ...b b # ...E 14 ║ # ..b.  9b #..E. 224 ║ ▓▓  
  ║ # ...7 7 # ...F 15 ║ # ..7. 112#..F. 240 ║ ▓▓  
  ╠══════════════════════════╬ ════════════════════════════╣ ▓▓  
  ║ Third position ║ Fourth position ║ ▓▓  
  ║ (shes) (des) (shes) (des)║ (shes) (des) (shes) (des) ║ ▓▓  
  ║ # .0.. 0 # .8.. 2048 ║ # 0... 0 # 8... 327b8 ║ ▓▓  
  ║ # .1.. 25b # .9.. 2304 ║ # 1... 409b # 9..W 3b8b4 ║ ▓▓  
  ║ # .2.. 512 # .A.. 25b0 ║ # 2... 8192 # A... 409b0 ║ ▓▓  
  ║ # .3.. 7b8# .V.. 281b ║ # 3... 12228 # V... 4505b ║ ▓▓  
 ║ # .4.. 1024 # .S.. 3072 ║ # 4... 1b384 # S... 49152 ║ ▓▓  
  ║ # .5.. 1280 # .D.. 3328 ║ # 5... 20480 # D... 53248 ║ ▓▓  
  ║ # .b.. 153b # .E.. 3584 ║ # b... 2457b # E... 57344 ║ ▓▓  
  ║ # .7.. 1792 # .F.. 3840 ║ # 7... 28b72 # F... b1440 ║ ▓▓  
  ╚══════════════════════════╩ ════════════════════════════╝ ▓▓  
    ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓  
                                                                
    Here's how to use these tables to:    
 convert hexadecimal number to decimal number.    
 Let's take, for example, the number #5CFE. Find∓m in the table each    
 Hexadecimal Digit in accordance with the e∓ position and after    
 Let's add up the decimal values:                              
                                                                
   E in the first position is 14                              
   F in the second position is 240                             
   C in the third position is 3072                            
   5 in the fourth position is 20480                           
   ----------------------------------                           
   Total: 2380b                           
                                                                
 When usingthese tables for conversion    
 decimal to hexadecimal execute all    
The process is easy.  Let's demonstrate the work again with an example.    
 Let's take the decimal number 15b19.   We will work    
 successively moving from the table for the fourth position to    
 table for the first position. In the table for the fourth position    
 find the largest hexadecimal digit with a value not    
 exceeding 15b19.  Write down this hexadecimal digit.    
 Subtract the corresponding decimal    
 values from 15b19 and continue the process by moving to the next    
 table with the new original decimal value (i.e. with    
 the resulting difference after performing the subtraction). So    
 In this way, move from table to table until at the end    
 you will not end up with 0. This process is shown in Table 2.    
 The result will be the hexadecimal number #ЗDЗF.               
                                                                
Table 2. Conversion of the decimal number 15b19 to             
           Hexadecimal number.                              
    ┌─────────┬────────────┬─ ───────────┬─────────────┐         
    │POSITION │ Highest │ Decimal │ Remaining │ ▓▓      
    │ │ six. Number │ value │ dec. number │ ▓▓├─────────┼────────────┼────────────┼─────────────┤ ▓▓      
    │Вначале  │            │            │             │ ▓▓      
    │ 4       │ # 3        │   12228    │    3391     │ ▓▓      
    │ 3       │ # D        │    3328    │     б3      │ ▓▓      
    │ 2       │ # 3        │      48    │     15      │ ▓▓      
    │ 1       │ # F        │      15    │      0      │ ▓▓      
    ├─────────┴────────────┴────────────┴─────────────┤ ▓▓      
    │Результат  # ЗDЗF                                │ ▓▓      
    └─────────────────────────────────────────────────┘ ▓▓      
      ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓      
                                                                
    ШестнадЦатеричное сложение                                  
                                                                
  Что  бы  получить  сумму  двух   шестнадЦатеричных  чисел,    
 последовательно складывайте соответствующие Цифры точно так    
 же,  как  при  работе  с десятичными числами. Для упрощения    
 этой  операЦии  вы  можете  воспользоватся  таблиЦей  3,  в    
 которой  показаны  суммы любых двух шестнадЦатеричных Цифр.    
 Для    этого    выберете   строку,   помеченую   одной   из    
 шестнадЦатеричных Цифр, и столбеЦ, помеченый другой Цифрой.    
 ШестнадЦатеричное   число,   расположенное  на  пересечении    
 указаныхyou rows and columns, will be the required sum of these    
 two digits                                                     
                                                                
     Table 3. Addition of two hexadecimal numbers           
 ┌──┬──┬──┬──┬──┬──┬──┬──┬─ ─┬──┬──┬──┬──┬──┬──┬──┬──┐       
     │ │ 0│ 1│ 2│ 3│ 4│ 5│ b│ 7│ 8│ 9│ A│ B│ C│ D│ E│ F│ ▓▓    
     ├──┼──┼──┼──┼──┼──┼──┼──┼─ ─┼──┼──┼──┼──┼──┼──┼──┼──┤ ▓▓    
     │ 0│ 0│ 1│ 2│ 3│ 4│ 5│ b│ 7│ 8│ 9│ A│ B│ C│ D│ E│ F│ ▓▓    
     │ 1│ │ 2│ 3│ 4│ 5│ b│ 7│ 8│ 9│ A│ B│ C│ D│ E│ F│10│ ▓▓    
     │ 2│ │ │ 4│ 5│ b│ 7│ 8│ 9│ A│ B│ C│ D│ E│ F│10│11│ ▓▓    
     │ 3│ │ │ │ b│ 7│ 8│ 9│ A│ B│ C│ D│ E│ F│10│11│12│ ▓▓    
     │ 4│ │ │ │ │ 8│ 9│ A│ B│ C│ D│ E│ F│10│11│12│13│ ▓▓    
     │ 5│ │ │ │ │ │ A│ B│ C│ D│ E│ F│10│11│12│13│14│ ▓▓    
     │ b│ │ │ │ │ │ │ C│ D│ E│ F│10│11│12│13│14│15│ ▓▓    
     │ 7│ │ │ │ │ │ │ │ E│ F│10│11│12│13│14│15│1b│ ▓▓    
     │ 8│ │ │ │ │ │ │ │ │10│11│12│13│14│15│1b│17│ ▓▓    
     │ 9│ │ │ │ │ │ │ │ │ │12│13│14│15│1b│17│18│ ▓▓    
     │ А│ │ │ │ │ │ │ │ │ │ │14│15│1b│17│18│19│ ▓▓    
     │ В│ │ │ │ │ │ │ │ │ │ │ │ │ │1b│17│18│19│1A│ ▓▓    
     │ C│ │ │ │ │ │ │ │ │ │ │ │ │18│19│1A│1B│ ▓▓    
     │ D│ │ │ │ │ │ │ │ │ │ │ │ │ │1A│1B│1C│ ▓▓    
     │ E│ │ │ ││ │ │ │ │ │ │ │ │ │ │1С│1D│ ▓▓    
     │ F│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │1E│ ▓▓    
     └──┴──┴──┴──┴──┴──┴──┴──┴─ ─┴──┴──┴──┴──┴──┴──┴──┴──┘ ▓▓    
       ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓    
                                                                
 Hexadecimal multiplication                                 
                                                                
  To get the product of two hexadecimal numbers,    
 sequentially multiply the corresponding numbers exactly like this    
 the same as when working with decimal numbers. To simplify    
 For this operation you can use Table 4, in    
 which shows the results of the product of any two    
 Hexadecimal Digits.   To do this, select the line    
 marked with one of the hexadecimal digits, and a column,    
 marked with a different number.   Hexadecimal number,    
 located at the intersection of the line you specified and    
 column, will be the desired value of the product of these two    
 Digital                                                          
                                                                
     Table 4. Product of two hexadecimal numbers       
     ┌──┬──┬──┬──┬──┬──┬──┬──┬─ ─┬──┬──┬──┬──┬──┬──┬──┬──┐       
     │ │ 0│ 1│ 2│ 3│ 4│ 5│б│ 7│ 8│ 9│ А│ В│ С│ D│ E│ F│ ▓▓    
     ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ ▓▓    
     │  │ 0│ 0│ 0│ 0│ 0│ 0│ 0│ 0│ 0│ 0│ 0│ 0│ 0│ 0│ 0│ 0│ ▓▓    
     │ 1│  │ 1│ 2│ 3│ 4│ 5│ б│ 7│ 8│ 9│ А│ В│ С│ D│ E│ F│ ▓▓    
     │ 2│  │  │ 4│ б│ 8│ А│ С│ E│10│12│14│1б│18│1А│1С│1E│ ▓▓    
     │ 3│  │  │  │ 9│ С│ F│12│15│18│1В│1E│21│24│27│2А│2D│ ▓▓    
     │ 2│  │  │ 4│ б│ 8│ А│ С│ E│10│12│14│1б│18│1А│1С│1E│ ▓▓    
     │ 3│  │  │  │ 9│ С│ F│12│15│18│1В│1E│21│24│27│2А│2D│ ▓▓    
     │ 4│  │  │  │  │10│14│18│1С│20│24│28│2С│30│34│38│3С│ ▓▓    
     │ 5│  │  │  │  │  │19│1E│23│28│2D│32│37│3С│41│4б│4В│ ▓▓    
     │ б│  │  │  │  │  │  │24│2А│30│3б│3С│42│48│4E│54│5А│ ▓▓    
     │ 7│  │  │  │  │  │  │  │31│38│3F│4б│4D│54│5В│б2│б9│ ▓▓    
     │ 8│  │  │  │  │  │  │  │  │40│48│59│58│б0│б8│70│78│ ▓▓    
     │ 9│  │  │  │  │  │  │  │  │  │51│5А│б3│бС│75│7E│87│ ▓▓    
     │ А│  │  │  │  │  │  │  │  │  │  │б4│бЕ│78│82│8С│9б│ ▓▓    
     │ В│  │  │  │  │  │  │  │  │  │  │  │79│84│8F│9А│А5│ ▓▓    
     │ С│  │  │  │  │  │  │  │  │  │  │  │  │90│9С│А8│В4│ ▓▓    
     │ D│  │  │  │  │  │  │  │  │  │  │  │  │  │А9│Вб│С3│ ▓▓    
     │ E│  │  │  │  │  │  │  │  │  │  │  │  │  │  │С4│D2│ ▓▓    
     │ F│  │  │  │  │  │  │  │  │  │  │  │  │  │  │  │E1│ ▓▓    
     └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓    
****************************************************************
 I reprinted these tables from the "Programming Guide"  
 IBM PC and PS/2" P. Norton P. Wilton                               
****************************************************************
                                12/18/9bg.    Machine-Skulls'9b 
                                                                

Share your thoughts about the article