In: Computer Science
1. A brief summary of Chapters 15 and 20 of The Code Book by
Charles Petzold
2. A brief summary on Hexadecimal and ASCII
(No Screenshots please)
P.S. If you can't do the first one, that's fine.
2.
ASCII -
ASCII stands for American Standard Code for Information Interchange. It is used for character encoding, which is used for numeric coding for representing characters or directly we can say that it is used for electronic communication. ASCII represent 128 characters which includes English letters (upper case and lower case), numbers, punctuation symbols.
ASCII uses 7 bit to represent character as the first bit is always 0 if the byte(8-bits). For example capital "A" is represented by 65 and its value in binary will be 01000001 and small "a" is represented by 97 and its value in binary will be 01100001. Keyboard keys are also represented as ASCII values. For example, Escape Key (ESC) is 27 in ASCII and its value in binary will be 00011011 and Delete Key(DEL) is 127 in ASCII and its value in binary will be 01111111.
Hexadecimal -
Hexadecimal is used to describe a number system with base-16. Hexadecimal uses numbers from 0-9 and then the letters A to F are used for describing the numerals in decimal. When working with big systems like computers, it is very common to find the binary numbers.The main disadvantage of using binary numbers is that binary string as compared to hexadecimal base-16 is quite long. Hence, hexadecimal is preferred over binary numbers.
As a hexadecimal consists of base-16, it uses 16 digits with the combination of 0 and 1. It consists of numerals 0,1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 and 15. The two digits decimal numbers i.e. 10, 11, 12, 13, 14 and 15 are represented as A, B, C, D, E and F respectively. For example, Escape Key (ESC) is 27 in ASCII and its value in hexadecimal will be 1B and Delete Key(DEL) is 127 in ASCII and its value in hexadecimal will be 7F.
Please rate the answer. Thank You.