DEV Community

Cover image for Encoding Schemes and Number System
Ritik Sharma
Ritik Sharma

Posted on • Updated on

Encoding Schemes and Number System

Introduction

  • Computer keyboards have keys in human-readable forms, but - computers interpret them differently.
  • Computers understand only binary language (0s and 1s), so keyboard inputs need to be converted.
  • When a key is pressed, it's mapped to a unique code, which is further converted to binary.

Example

  1. When the key 'A' is pressed, it's mapped to a decimal value 65 (code value), which is then converted to binary.
  2. Similarly, when 'अ' is pressed on a Hindi keyboard, it's mapped to a hexadecimal value 0905, with a binary equivalent of 0000100100000101.

Encoding

  • Encoding is the process of converting data into an equivalent cipher using a specific code.
  • It's important to understand why code value 65 is used for 'A' and if it's the same for all keyboards, regardless of their make.

Standard Encoding Schemes
Standard encoding schemes ensure consistency across keyboards.
Each letter, numeral, and symbol is encoded or assigned a unique code.
Various well-known encoding schemes will be described in the following sections.

  1. American Standard Code for Information Interchange (ASCII)
  2. Indian Script Code for Information Interchange (ISCII)
  3. UNICODE

American Standard Code for Information Interchange (ASCII)

  • Developed in the early 1960s to address the issue of computers not being able to communicate due to different keyboard representations.
  • ASCII was created to standardize character representation, and it remains the most commonly used encoding scheme.
  • Initially, ASCII uses 7 bits to represent characters. Recall that there are only 2 binary digits (0 or 1).
  • With 7 bits, ASCII can encode 2^7 = 128 different characters and range from 0 to 127.
  • However, ASCII can only encode the character set of the English language, limiting its applicability to other languages and character sets.

Here are some important ASCII codes for commonly used characters:

  • Numbers 0-9: ASCII codes 48-57
  • Uppercase Letters A-Z: ASCII codes 65-90
  • Lowercase Letters a-z: ASCII codes 97-122

Top comments (0)