Computer Character Encoding Standards: ASCII and EBCDIC
Classified in Computers
Written on in
English with a size of 4.06 KB
Computer Character Encoding Standards
ASCII Code: American Standard Code for Information Interchange
The ASCII Code is the most popular coding method used by computers to convert characters (letters, numbers, punctuation, etc.) to digital form. The standard ASCII has 128 positions, represented by 7 binary digits. There is also an extended version with 256 characters.
EBCDIC Code: Extended Binary Coded Decimal Interchange Code
The EBCDIC Code is used by IBM for its business systems, including the IBM PC series. Each character is represented by 8 bits, allowing for the representation of $2^8 = 256$ characters.
The Standard IEEE 754
The IEEE 754 Standard is a computer program specification that dictates how arithmetic instructions for floating-point calculations can be executed in two primary formats (single and double precision).
Case 1: Practical Example - Positive Decimal Number Representation
Representation of $17.5_{(10)}$ in the IEEE 754 standard, considering 32-bit words ($n=32$) and an 8-bit exponent ($m=8$).
-
Calculate the Mantissa in Standard Notation:
We normalize the number so that there is exactly one non-zero digit to the left of the binary point. For $17.5_{(10)}$:
First, convert $17.5$ to binary: $17.5_{(10)} = 10001.1_{(2)}$.
Normalize: $10001.1_{(2)} = 1.00011 imes 2^4$.
The number in standard notation is: $1.00011 imes 2^4$.
Note on the original text's division example: If we were representing $9_{(10)}$ (which is $1001_{(2)}$), normalization requires dividing by $2^3$ to get $1.001 imes 2^3$. The original text's division steps seem to illustrate the concept of finding the correct power of two for normalization.
For $17.5$: $17.5 / 2^4 \Rightarrow 1.09375$. The number in standard notation is: $1.09375 \times 2^4$.
-
Convert the Fractional Part to Binary Mantissa:
The fractional part is $0.00011_{(2)}$ (derived from $1.00011_{(2)}$). After the leading '1' (which is implied and not stored), we store the remaining bits: 00011.
-
Estimate the Exponent in Biased Representation:
The number of bits for the exponent is $m=8$. The bias (excess) is $2^{m-1} - 1 = 2^{8-1} - 1 = 128 - 1 = 127$.
The actual exponent is $4$. The biased exponent is: $4 + 127 = 131$.
In binary, $131$ is: 10000011.
-
Final Representation (32-bit Single Precision):
The structure is: Sign (1 bit) | Exponent (8 bits) | Mantissa (23 bits).
Since the number is positive, the sign bit is 0.
Representation: 0 10000011 00011000000000000000000
Sign | Exponent (8 bits) | Mantissa (23 bits)
Case 2: Practical Example - Negative Decimal Number Representation
Representation of $-7.25_{(10)}$ in the IEEE 754 standard, considering 32-bit words ($n=32$) and an 8-bit exponent ($m=8$).
We calculate the mantissa in standard notation with a '1' to the left of the decimal point.
-
Normalization:
Convert $7.25_{(10)}$ to binary: $7.25_{(10)} = 111.01_{(2)}$.
Normalize: $111.01_{(2)} = 1.1101 imes 2^2$.
The actual exponent is $2$.
-
Binary Mantissa:
The fractional part is $1101$. Stored mantissa (after the implied '1'): 11010000000000000000000.
-
Biased Exponent:
Bias is $127$. The biased exponent is: $2 + 127 = 129$.
In binary, $129$ is: 10000001.
-
Final Representation:
Since the number is negative, the sign bit is 1.
Representation: 1 10000001 11010000000000000000000
Sign | Exponent (8 bits) | Mantissa (23 bits)
Note: The original text showed an extra '1' at the beginning and end of the sequence for the negative case, which is corrected here to follow the standard 1-8-23 structure.