Advertisement
skip420

Converting between number bases using hexadecimal

Sep 11th, 2022
1,956
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Converting between number bases using hexadecimal
  2.  
  3. In computer science, different number bases are used:
  4.  
  5.     decimal is base 10, which has ten units (0-9)
  6.     binary is base 2, which has two units (0-1)
  7.  
  8. Hexadecimal, also known as hex, is the third commonly used number system. It has 16 units - 0-9 and the letters A, B, C, D, E and F.
  9.  
  10.  
  11. Decimal  Binary  Hexadecimal
  12. 0         0000          0
  13. 1         0001          1
  14. 2         0010          2
  15. 3         0011          3
  16. 4         0100          4
  17. 5         0101          5
  18. 6         0110          6
  19. 7         0111          7
  20. 8         1000          8
  21. 9         1001          9
  22. 10        1010          A
  23. 11        1011          B
  24. 12        1100          C
  25. 13        1101          D
  26. 14        1110          E
  27. 15        1111          F
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement