Pages

Powered by Blogger.

Like Our Facebook Page

BCD and EBCDIC

Monday, 21 October 2013

BCD and EBCDIC
BCD - Binary Coded Decimal
Early mainframe computers in the 1950s were programmed using numeric codes, not text.  As a result, the first coding system used in these computers only needed to represent the ten digits in our number system.  The BCD (Binary Coded Decimal) system used 4 bits to represent numbers as follows:

Therefore, to represent the number 253, the computer would store 0010 0101 0011.


EBCDIC - Extended Binary Coded Decimal Information Code
In the early 1960s, computers were increasing in speed and storage capacity.  It was now possible to program these computers (and store data) in text format as well as number format.  IBM developed an extension to the BCD code which would be able to represent all English characters and punctuation marks.  This code was called EBCDIC (Extended Binary Coded Decimal Information Code),
EBCDIC used 8 bits to represent characters, giving 256 possible symbols.
Here is a portion of the original EBCDIC table.  The grey areas represent non-printable control keys (Esc, Del, Backspace, etc.), as well as special characters used in data transmission.

To find the EBCDIC code for a particular character,
  1. Locate the character in the table (for example, "J")
  2. Write down the four "Low Order" bits on the left side of the table directly across from the character (for "J", they are 1101).
  3. Write down the four "High Order" bits at the top of the table, directly above the character (for "J", they are 0001).
Therefore, the 8-bit EBCDIC code for an upper-case "J" is 11010001.

In the table above, there are several things to notice:
  • There are 3 characters (¢ ¬ ¦) highlighted in blue.  These were found on IBM card-punch machines, as they were commonly used in programming languages like FORTRAN, COBOL and PL/1, but are no longer found on modern QWERTY keyboards.
  • There are 3 characters commonly found on keyboards today (square brackets [ ] and the circumflex ^) which were not given EBCDIC codes.
  • There are several inconsistencies in the ordering of the characters, which IBM probably did not think about at the time.  For example, lower-case letters have lower codes than upper-case letters, and all letters have lower codes than numbers.  This caused problems when trying to "sort" data (we generally consider "123" to come before "abc", but the opposite was true in EBCDIC).  Also, some of the non-printable control keys were "sandwiched" between sequences of letters (for example, there are 7 codes between "i" and "j").  This made it very difficult for computer programmers to write efficient data-processing programs.

No comments:

Post a Comment

 

Most Reading

World Map


Site's Information