Represent Text in Bit
1. Using ASCII
We can represent Text in binary form using ASCII (American Standard Code for Information Interchange). It represents binary number in form of bytes. Collection of 8 bits make a byte. ASCII provides a unique 7 digit code in binary form which represent letters. Like for example
You can get the values of text in binary format using ASCII Table
- H is represented as 72 in decimal, which is 1001000 in binary (7 bits).
- E is represented as 69 in decimal, which is 1000101 in binary (7 bits).
- L is represented as 76 in decimal, which is 1001100 in binary (7 bits).
- L is represented as 76 in decimal, which is 1001100 in binary (7 bits).
- O is represented as 79 in decimal, which is 1001111 in binary (7 bits).
So, the word “HELLO” in binary ASCII representation is: 1001000 1000101 1001100 1001100 1001111.
2. Using Unicode
Unicode means single code, it assigns a code point to every character or symbol in the world so its a hexadecimal code For example if we need to convert “HELLO” to binary using unicode
First, we need to find the code points of each letter in the word “hello”. We can use a Unicode table to do this The code points of “hello” are:
h in unicode is written represented as = U+0068
e in unicode is written represented as = U+0065
l in unicode is written represented as= U+006C
o in unicode is written represented as = U+006F
These codes can be converted to binary using hexadecimal to binary converter because computer can understand binary language
h in binary = 0000 0110 1000
e in binary = 0000 0110 0101
l in binary = 0000 0110 1100
o in binary = 0000 0110 1111
UTF-8 encoding rules
For the code point between range of U+0000 and U+007F, use one byte and prefix it with a zero.
For the code point between range of U+0080 and U+07FF, use two bytes and prefix them with 110 and 10 respectively.
For the code point between range of U+0800 and U+FFFF, use three bytes and prefix them with 1110 and 10 respectively.
For the code point between range of U+10000 and U+10FFFF, use four bytes and prefix them with 11110 and 10 respectively.
Since all the code points of “hello” are between U+0000 and U+007F, we only need one byte for each letter, and we prefix them with a zero. The UTF-8 encoded bytes of “hello” are:
h = 0110 1000
e = 0110 0101
l = 0110 1100
o = 0110 1111
Finally, we concatenate these bytes to form the UTF-8 encoded word “hello”. The result is:
hello = 01101000 01100101 01101100 01101100 01101111
What is Bit?
Bit have high importance in computer memory, networks because computer understand the things, codes even multimedia in form of bits. Not in the language we communicate How do they communicate with each other and with us? How do they represent text, images, sounds, and videos? The answer to all these questions lies in the concept of a bit, the most basic unit of information in computing and digital communications.
Contact Us