Hexadecimal and ASCII Lesson Objective: Understand the purpose of ASCII and how to use it. Lesson Outcome: Convert between Hexadecimal and ASCII Convert Hexadecimal to Denary Key words: 8 bit byte, decimal, hexadecimal
Each place is called a BIT (Binary digIT) Bits and Bytes 128 64 32 16 8 4 2 1 0 1 0 0 0 0 0 1 8 Bits make one BYTE Each place is called a BIT (Binary digIT)
Question 0 1 0 0 0 0 0 1 What is a BIT?
Question How many bits are there in this byte? 0 0 0 1 0 0 0 1 Answer = 8
Question 0 1 0 0 0 0 0 1 How many bytes are there in a kilobyte? Answer = 1024
Converting from binary to decimal 8 4 2 1 0 0 1 1 =3 1 0 0 1 =9 =10 0 1 1 1 =7 1 0 1 0 0 1 0 1 =5 1 1 1 1 =15
Converting between decimal and binary 128 64 32 16 8 4 2 1 0 1 0 0 0 1 1 1 = 64 + 4 + 2 + 1 = 71 128 64 32 16 8 4 2 1 0 0 0 1 0 1 1 0 = 16 + 4 + 2 = 18
Converting between decimal and binary 128 64 32 16 8 4 2 1 0 0 1 0 0 0 1 1 = 32 + 2 + 1 = 35 0 0 1 1 0 0 1 0 = 32 + 16 + 2 = 50 0 1 1 0 0 0 1 1 = 64 +32 +2 +1 = 99
Binary and Hex digits ... 0 0 0 0 = 0 1 0 0 0 = 8 0 0 0 1 1 0 0 1 = 1 = 9 0 0 1 0 1 0 1 0 = A = 2 0 0 1 1 1 0 1 1 = 3 = B 0 1 0 0 1 1 0 0 = 4 = C 0 1 0 1 1 1 0 1 = 5 = D 1 1 1 0 0 1 1 0 = 6 = E 1 1 1 1 = F 0 1 1 1 = 7
Binary to hex conversion (For lazy people) 0 1 1 1 0 0 1 1 = 115 0 1 1 1 0 0 1 1 Written as: 7316 Or 73Hex 7 3 Assign a number to each of the nibbles ...
A = 01000001 How is data stored? Book Vs Computer A book stores data with ink and paper A computer stores data as electronic 0’s and 1’s A = 01000001 Remember from a previous lesson … 8 bit byes, kilobytes ..etc.
Converting between decimal and binary 10000s 1000s 100s 10s 1s 05565 0 5 5 6 5 128 64 32 16 8 4 2 1 0 1 0 0 0 0 0 1 = 64 + 1 = 65
What are the following binary numbers in decimal? What are the following binary numbers in Hexadecimal? 8 128 4 64 2 32 1 16 8 8 4 4 2 2 1 1 0 1 0 0 0 0 1 1 = 67 = 43Hex = 78 0 1 0 0 1 1 1 0 = 4EHex
How are letters, numbers and symbols held in the computer? NO! A = 1, B = 2, C = 3 … etc? All characters are held in a universally recognised coded called: ASCII Say Ass-Key A = 65, B = 66, C =67 … a = 97, b=98
ASCII ... A American S Standard C Code for I Information I Interchange
Worksheets!
Coverting Hex to Denary: 16 1 42Hex = 4 2 = 4 x 16 + 2 x 1 = 64 + 2 = 66 16 1 2AHex = 2 A = 2 x 16 + 10 x 1 = 32 + 10 = 42
Coverting Hex to Denary: 16 1 C5Hex = C 5 = 12 x 16 + 5 x 1 = 192 + 5 = 197 16 1 EAHex = E A = 14 x 16 + 10 x 1 = 224 + 10 = 234