Lab: Decimal, Binary, Hexadecimal Numbering Systems



Lab: Decimal, Binary, Hexadecimal Numbering SystemsBasic number conversion table:Decimal1514131211109876543210HexFEDCBA9876543210Binary11111110110111001011101010011000111110101100111010Example of Decimal, Binary, Hexadecimal Numbers…3210…103=1000102=100101=10100=1…0226Decimal: Base 10Example: 226…76543210…27=12826=6425=3224=1623=822=421=220=1…11100010Binary: Base 2Example: 11100010…3210…163=4096162=256161=16160=1…00E2Hex: Base 16Example: 0xE2Going from Binary/ Hexadecimal to Decimal:…76543210…27=12826=6425=3224=1623=822=421=220=1…11100010Binary to Decimal:Example: 11100010Solution:=1x27 + 1x26 + 1x25 + 0x24 + 0x23 + 0x22 + 1x21 + 0x20=1x128 + 1x64 + 1x32 + 0x16 + 0x8 + 0x4 + 1x2 + 0x1=128 + 64 + 32 + 0 + 0 + 0 + 2 + 0=226…3210…163=4096162=256161=16160=1…00E2Hexadecimal to Decimal:Example: 0xE2Solution:=0x163 + 0x162 + Ex161 + 2x160=0x4096 + 0x256 + 14x16 + 2x1=0 + 0 + 224 + 2=226Going from Decimal to Binary/ Hexadecimal:Example: Decimal: 123 to BinarySteps: 1. Find the closest 2 to the power of x 2. If (123 ≥ 27) the 7th position: 1, else: 0123-0x27 = 123…76543210…27=12826=6425=3224=1623=822=421=220=1…011110113. If (123≥26) the 6th position: 1, else: 0123 – 1x26= 594. If (59 ≥ 25) the 5th position: 1, else: 059 - 1x 25 = 275. If (27 ≥ 24) the 4th position: 1, else: 027 - 1x 24 = 116. If (11 ≥ 23) the 3rd position: 1, else: 011 - 1x 23 = 37. If (3 ≥ 22) the 2nd position: 1, else: 03 - 0x 22 = 38. If (3 ≥ 21) the 1st position: 1, else: 03 - 1x 21 = 18. If (1 ≥ 20) the 0th position: 1, else: 01 - 1x 20 = 0Example: Decimal: 3257 to HexadecimalSteps: 1. Find the closest 16 to the power of x 2. 3257 < 163, then the 3rd position: 03. 3257 ≥ 162 3257 ÷ 162 = 12.72xxx , so the 2nd position: 0xC3257 – 12x162 = 1854. 185 > 161) 185 ÷ 161 = 11.5625 , so the 1st position: 0xB185 – 11x161 = 95. 9 ≥ 20…3210…163=4096162=256161=16160=1…0CB99÷ 160 = 9 , so the 0th position: 0x99– 9x160 = 0Going from Binary to Hex and backBinary to Hex: 11010010Steps: 110100101. Group digits, from right to left 4digits one group.2. Convert each group to Hex, From the Basic number conversion table: 1101 = 0xD; 0010= 0x23. The final result: 0xD2 Hex to Binary: 0x3CSteps: From the Basic number conversion table: 0x3 = 0011; 0xC= 11003. The final result: 00111100 In Class Lab: 1. Take the following decimal numbers and convert them to binary and hexadecimal:a) 20Binary: __________________Hexadecimal: ______________________b) 35Binary: __________________Hexadecimal: ______________________c) 127Binary: __________________Hexadecimal: ______________________d) 93Binary: __________________Hexadecimal: ______________________2. Take the following binary numbers and convert to hex and decimal: a) 011101Decimal: __________________Hexadecimal: ______________________b) 0110Decimal: __________________Hexadecimal: ______________________c) 1010101Decimal: __________________Hexadecimal: ______________________3. Take the following hex numbers and convert to binary and decimal: a) 1FDecimal: __________________Binary: ______________________b) FEDecimal: __________________Binary: ______________________c) A23Decimal: __________________Binary: ______________________ ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download