(Binary Addition) Data Representation

November 29, 2023
39 mins read
(Binary Addition) Data Representation

Binary Addition

ALUS don't directly work upon decimal numbers; rather they process binary numbers as a computer can understand only binary numbers. Five basic cases for binary addition must be understood before going on. These are :

Case 1: 0+0=0

i.e., the addition of two binary 0's (zero) results in a binary 0 (zero).

Case 2 : 0+1=1

i.e., the addition of a binary 0 (zero) and a binary 1 (one) results in binary 1 (one).

Case 3: 1+0=1

i.e., the addition of a binary 1 (one) and a binary 0 (zero) results in binary 1 (one).

Case 4: 1+1=10

i.e., Binary 1 + Binary 1 equals Binary 10. Or we can say that in binary digits, 1 plus 1 equals zero (0), carry one (1).

Case 5: 1+1+1=11

i.e., Binary 1 + Binary 1 + Binary 1 equals Binary 1, carry Binary 1.

Let us summarize these rules

0+0=0
0+1=1
1+0=1
1+1 = 10
1+1+1 = 11

[0 with carrying 1]
[1 with carrying 1]

Let us now complete binary addition on larger binary digits. The binary numbers are also added column-by-column just like decimal digits. Also, the way results bigger than the biggest decimal digit are taken over, in binary addition, results bigger than 1 are even taken over. For example,

Similarly, Binary Addition will be

Let us perform another Binary addition, step-by-step for

Begin with the least effective column i.e., the right-most column to getIn all examples, 0 + 0 gives 0.

Next, add the bits of the 2nd column (second from right) as follows:

This time, 0 + 1 gives

The addition in the third column gives

In this case, 1+0 results inAs you see, 1+1 produces 10 i.e., 0 with a carry of 1.

Finally, the last column gives

Here, 1+1+1 (previously generated carry) results in 11, recorded as 1 with a carry to the next higher column.

EXAMPLE SOLUTION 9:

Add the binary numbers 01010111 and 00110101.

SOLUTION If you add the bits column by column as before clarified you will get

EXAMPLE SOLUTION 10 :

Add the binary numbers 1011 and 110.

Screenshot-2022-06-30-193816.png

EXAMPLE SOLUTION 11:

Add binary numbers 11110 and 11.

EXAMPLE SOLUTION 12 :

Add binary numbers 11.01 and 101.11.

2.5 CHARACTER/STRING REPRESENTATION

In addition to numerical data, a computer must be able to handle letters and other symbols too. In other words, a computer should identify codes that define letters of the alphabet, punctuation patterns, and other unique symbols as well as numbers. Have you ever thought about how a computer recognizes which number/letter/symbol is pressed on the keyboard?

This is possible through an encoding scheme. An encoding scheme is a predetermined set of codes for each recognized latter, number, and symbol. When a key is pressed on the keyboard, the keyboard then sends the code for that key from the encoding scheme. The computer then looks for the received code in the encoding scheme and gets the number/letter/symbol pressed. Thus the role of an encoding scheme is very crucial in a computer system. The most popular encoding schemes are ASCII, Unicode, ISCII, etc.

Also, read: About Cyber Safety

Also, read: (cyber safety) confidentiality of information

Also, read: (Copyright) Ethics Issues, Society, and Law

Also, read: Technology Economic and E-waste

Also, read: Open Source Software philosophy and licenses

Also, read: (Digital Number System) Data Representation

Also, read: (Number conversions) binary number

Also, read: (Binary Addition) Data Representation

Also, read: Emerging Trends (AI and IoT)

Also, read: Emerging Trends (Cloud & Blockchain Technology)

2.5.1 ASCII Code:

The most widely used alphanumeric encoding system, the American Standard Code for Information Interchange (ASCII), is operated in most microcomputers and minicomputers, and multiple mainframes. The ASCII code (pronounced "asked") is a 7-bit code, and so it has 27 = 128 probable code sets.

This is more than enough to describe all of the standard keyboard characters as well as management roles such as the (RETURN) and (LINEFEED) functions. Table 2.5 shows a partial listing of the ASCII code. In addition to the binary code set for each symbol, the table shows the octal and hexadecimal equivalents.

Table 2.5 Partial Listing of ASCII Code

Character7-Bit ASCIIDecimalOctalHex
A100 0016510141
B100 00106610242
C100 00116710343
D100 01006810444
E100 01016910545
F100 01107010646
G100 01117110747
H100 10007210848
I100 10017310949
J100 1010741104A
K100 1011751114B
L100 1100761124C
M100 1101771134D
N100 1110781144E
O100 1111791154F
P101 00008011650
Q101 00018111751
R101 00108211852
S101 00118311953
T101 01008412054
U101 01018512155
V101 01108612256
W101 00118712357
X101 10008812458
Y101 10018912559
Z101 1010901265A
0011 00009112730
1011 00019212831
2011 00109312932
3011 00119413033
4011 01009513134
5011 01019613235
6011 01109713336
7011 01119813437
8011 10009913538
9011 100110013639
blank010 10003204020
.010 1110460562E
(110 10004005028
+010 1011430532B
$010 01003604424
*010 1010420522A
)010 10014105129
-010 1101450552D
/010 1111470572F
,010 1100390542C
=011 1101610753D
(RETURN)000 1101130150D
(LINEFEED)000 1010100120A
     

Table 2.5

EXAMPLE SOLUTION 13 :

The following is a notice encoded in ASCII code. What is the notice?

10010001000101100110010100000

Convert each 7-bit code to its hex equivalent. The results are

48454C50

Now locate these hex values in Table 2.7 and determine the character represented by each. The results are

H E L P

The ASCII code is used for the transfer of alphanumeric transmission between a computer and input/output instruments such as video terminals or printers. A computer also operates it internally to hold the information that an operator types in at the computer's keyboard.
The following example explains this.

EXAMPLE SOLUTION 14 :

An operator is typing in a Necessary program at the keyboard of a specific micro-computer. The computer converts each keystroke into its ASCII code and stores the code in memory. Determine the codes that will be entered into memory when the operator types in the following BASIC statement: GOTO 25

Locate each character (including the space) in Table 2.7 and record its ASCII code The main advantage of ASCII is its simplicity - it uses one byte to represent one character.

There is advanced ASCII that operates 8 bits to describe various characters. It can define 256 characters, as objected to 128 symbols of ASCII. Apart from ASCII, other systems are also used to represent various symbols. In the following lines, we are conversing regarding some of these ISCII and Unicode.

5.2 ISCII Code :

With the beginning of computerization, considerable creation has been undertaken to facilitate the use of Indian languages on computers. These activities were normally limited to exact languages and were independent exercises of different organizations, thus, creating data interchange was impossible. In such a system, it was important to have a common standard for coding Indian scripts.

In 1991, the Bureau of Indian Standards assumed the Indian Standard Code for Information Interchange (ISCII), the ISCII standard that was developed by a standardization committee. This is an 8-bit code qualified for coding 256 characters. ISCII code includes all ASCII characters and offers to code for Indian scripts too. Thus, it is also called the Indian Scripts Code for Information Interchange.

All GIST products are based on ISCII. Also, ISCII has been operated by IBM for PC-DOS, Apple for ILK, and several other organizations that are inventing products and explanations based on this presentation. Also, ISCII has been created compulsory for the data being collected by organizations like The Election Commission, and for projects such as Land Records Project, etc. This standard does not only use in the Devanagari script, but even in the Gurmukhi, Gujarati, Oriya, Bengali, Assamese, Telugu, Kannada, Malayalam, and Tamil scripts. Because the structure of these scripts is so comparable that a single coding can be used for all of them, immediately providing transliteration between the scripts.

5.3 Unicode :

You have learned about two different encoding schemes ASCII and ISCII in previous sections. These encoding schemes represent different sets of characters belonging to different languages by assigning a number to each character. Likewise, there are many encoding schemes available that represent different characters of different languages. As the world is becoming a global village thanks to modern technology, a need was being felt for an encoding scheme that could represent all the known languages' characters through one encoding scheme. Unicode is the answer. Unicode is developed as a universal character set with the aim :

  • to to define all the characters needed for writing the majority of known languages in use on computers in one place.
  • stand a superset of all different character sets that have been encoded

Before Unicode was developed, there were hundreds of various encoding methods for assigning these numbers. No single encoding could contain enough characters: for example, the European Union alone requires several various encodings to cover all its languages. Even for a single language like English, no single encoding was acceptable for all the letters, punctuation, and technical characters in standard use. These encoding methods also disagree with one another. That is, two encodings can use the exact number for two additional characters or use various numbers for the same character. For example, the character code 0xFF defines Ÿ in west European code page ISO8859-1, while the same code defines in Russian code page 1251.

Any assigned computer (especially servers) needs to support many various encodings; yet whenever data is passed between various encodings or platforms, that data still runs the risk of corruption.

Encoding Terminology

Before we proceed further, it is important to discuss two basic terms related to encoding.

Code Space :

It directs to all the codes that an encoding strategy uses to define characters. e.g., ASCII encoding scheme has a code space from 0 to 127 (0 x 0 to 0 x 7F).

Code Point :

The code point refers to a code (from a code space) that represents a single character from the character set represented by an encoding system, e.g., 0x41 is one code pinpoint of ASCII that represents the symbol 'A'. ASCII has 128 code points while Unicode contains 1,112,064 code points.

Unicode Encoding Schemes :

Unicode defines multiple encoding systems to represent characters. These are UTF-8, UTF-16 and UTF-32. Let us discuss these Unicode encoding schemes. The character encoding system reflects the way the coded symbol set is actually mapped to bytes in form of binary code (machine understandable code) for manipulation in a computer.

2.5.3A UTF-8 (Unicode Transformation Format)-8 :

UTF-8 is a variable-width encoding that can define every character in the Unicode symbol set. In other words, it can encode each of the 1,114,112 code points in the Unicode symbol set. The coding unit of UTF-8 is 8 bits, called an octet. UTF-8 can use 1 to a maximum of 6 octets to represent code points depending on their size, although till now it has used up to 4 octets to represent any character.

UTF-8 is a type of multi-byte encoding. Sometimes you only use 8 bits to store the character, other times, 16 or 24 or more bits. Unicode codepoints are often written as U+ e.g., U+0041 represents the letter 'A'. UTF-8 is a variable-length encoding scheme. That is, it uses a different number of bytes or octets (set of 8 bits) to represent different characters. Following Table 2.6 gives an idea of how many octets will be used to represent a Unicode code point.

ΝΟΤΕ

UTF-8 is another brilliant idea by Ken Thompson (one of the creators of UNIX).

Table 2.6 Unicode Code Points and No. of Octets used in UTF-8

Unicode Code Points (in decimal)Unicode Code Points (in Hexadecimal)Number of
Octets used
U-0 – U-127(U+00 to U+07F)1 octet (8 bits)
U-128 – U-2047(U+80 to U+7FF)2 octet (16 bits)
U-2048 – U-65535(U+800 to U+FFFF)3 octets (24 bits)
U-65536 - U-2097151(U+10000 to U+1FFFFF)4 octets (32 bits)

Table 2.6 Unicode Code Points

2.5.3B UTF-32 :

UTF-32 is a fixed-length encoding system that uses precisely 4 bytes to describe all Unicode code points. That is, it instantly stores the binary code of any Unicode code point in 4 bytes. View these examples

Symbols $ [Unicode code point: U + 0024, Binary code: 00100100]

binary code

There is one more Unicode encoding scheme UTF-16, which is also a variable-length encoding scheme that either uses 2 bytes or 4 bytes to represent Unicode code points. But we are not going into details of this encoding scheme as it is beyond the scope of the syllabus. UTF-8 is the most famous encoding system with more than

Typing Multi-lingual Text in a Word Processor

You can easily type any multilingual text in a word processor. In the following lines, you will learn how you can do this in Microsoft Word 2007 and later. 90% of websites use it. Ω Symbol 1

  1. On the Insert tab, click Symbol, and from the drop-down, click on More Symbols:
  2. It will open the Symbols dialog.

Typing Multi-lingual Text

Typing Multi-lingual Text in a Word Processor
 

  1. From the Font dropdown on the left, select a font that supports Unicode, e.g., Arial Unicode MS. From the Subset dropdown on the right, select desired language subset, e.g., to type text in Hindi, we selected Devanagari.
  2. It will display the characters from the selected subset.
  3. Click on the desired character to be inserted and click the Insert button.

Keep reading

More posts from our blog

Digital Number System (Data Representation)
By November 29, 2023
1. INTRODUCTIONDigital techniques have found their way into numerous areas of technology, but the area of automatic digital computers is by far the...
Read more
Emerging Trends (AI and IoT)
By November 29, 2023
1. INTRODUCTIONThe rapid growth of technology is not at all surprising but what surprises is the rate at which the technology is growing and evolving,...
Read more
Emerging Trends (Cloud & Blockchain Technology)
By November 29, 2023
in this post, we discuss Cloud & Blockchain Technology. so let's get started...CLOUD COMPUTINGCloud computing is Internet-based computing,...
Read more