0% found this document useful (0 votes)
95 views10 pages

Chapter2 2.6

The document discusses different character encoding schemes used by computers over time, including binary-coded decimal (BCD), extended binary-coded decimal interchange code (EBCDIC), American Standard Code for Information Interchange (ASCII), and Unicode. BCD encodes each decimal digit into 4 bits and was commonly used in calculators and electronics. EBCDIC was an 8-bit extension of BCD used on IBM mainframes that could represent uppercase and lowercase letters. ASCII became dominant outside of IBM and used 7 bits plus an optional parity bit. Unicode is now widely adopted and can represent characters of all languages using 16 bits.

Uploaded by

iole
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views10 pages

Chapter2 2.6

The document discusses different character encoding schemes used by computers over time, including binary-coded decimal (BCD), extended binary-coded decimal interchange code (EBCDIC), American Standard Code for Information Interchange (ASCII), and Unicode. BCD encodes each decimal digit into 4 bits and was commonly used in calculators and electronics. EBCDIC was an 8-bit extension of BCD used on IBM mainframes that could represent uppercase and lowercase letters. ASCII became dominant outside of IBM and used 7 bits plus an optional parity bit. Unicode is now widely adopted and can represent characters of all languages using 16 bits.

Uploaded by

iole
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Chapter 2.

6
Character Codes
2.6 Character Codes

Calculations aren t useful until their results can be displayed in a


manner that is meaningful to people.
We also need to store the results of calculations, and provide a
means for data input.
Thus, human-understandable characters must be converted to
computer-understandable bit patterns using some sort of
character encoding scheme.
As computers have evolved, character codes have evolved.
Larger computer memories and storage devices permit richer
character codes.

2
2.6.1 Binary-Coded Decimal
For many applications decimal digits
need to be exactly represented, e.g.
financial applications.
What is the binary equivalent of R 5.10?

For these cases, we need an encoding


for individual decimal digits (a form of
character coding).
Binary-coded decimal (BCD) is common
in electronics that use numerical data,
such as alarm clocks and calculators.
BCD encodes each digit of a decimal
number into a 4-bit binary form.
E.g. 146 in BCD is
0001 0100 0110
3
2.6.1 Binary Coded Decimal
Unpacked BCD: high order nibbles are padded with zeros.
Example: 146: 00000001 00000100 00000110 lookup quicker but more
Unpacked BCD is wasteful. space required
Packed BCD: stores two digits per byte.
Sign is stored at the end:
1111: unsigned
1100: positive
1101: negative
b
1,4
Example: -146 would be stored as 00010100 01101101
p
Pad high-order nibble with zeros if necessary (e.g. -61)

Disadvantage of BCD:
Many bits go to waste (1010 to 1011 not used)

Advantage of BCD:
Can represent decimal numbers accurately.
4
2.6.1 Binary Coded Decimal

Zoned decimal format BCD:


Same as for unpacked BCD, except that the high-order nibbles store a code
High-order nibble of the last byte is the sign (1100: positive, 1101: negative)
Example: +146 in EBCDIC zoned decimal format is 11110001 11110100
11000110

Example: Represent -1265 using packed BCD and zoned BCD


decimal.
Packed BCD: 00000001 00100110 01011101
Zoned BCD: 11110001 11110010 11110110 11010101

5
2.6.2 EBCDIC

Early version of BCD on IBM systems used 6-bit representation for


characters and numbers (very limited, e.g. no lowercase letters).
In 1964, BCD was extended to an 8-bit code, Extended Binary-
Coded Decimal Interchange Code (EBCDIC).
EBCDIC was one of the first widely-used computer codes that
supported upper and lowercase alphabetic characters, in addition to
special characters, such as punctuation and control characters.
EBCDIC still used by IBM mainframes today.
Zone
Bytes in EBCDIC are in zone-digit form, e.g. character a is 1000
0001 and digit 3 is 1111 0011.
digit

6
2.6.2 EBCDIC

7
2.6.3 ASCII
Other computer
manufacturers chose
the 7-bit ASCII
(American Standard
Code for Information
Interchange).
Until recently, ASCII
was the dominant
character code
outside the IBM
mainframe world.
The 8th bit was
intended to be used
for parity.

8
2.6.3 ASCII
Parity: the most basic of all error-detection schemes.
A parity bit is 1 or 0 depending on whether the sum of the other bits is
odd or even.
E.g. ASCII A is 6510 or 100 0001, so the bit string transmitted would be
0100 0001 (Using even parity).
Parity can be used to detect only single-bit errors.

9
2.6.4 Unicode

Many of today s systems


embrace Unicode, a 16-bit
system that can encode
the characters of every
language in the world.
Downward compatible with
ASCII.
The Unicode codespace is
divided into six parts. The
first part is for Western
alphabet codes, including
English, Greek, and
Russian.

10

You might also like