# Number_system

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: coding for the word STAR in ASCII-8 will be B3/S B4/T A1/A B2/R = STAR Since each character in ASCII-8 requires one byte for its representation and there are 4 characters in the word STAR, 4 bytes will be required for this representation. COLLATING SEQUENCE The value of an alphanumeric or alphabetic data element is usually the name of some object. Obviously one would not like to perform any arithmetic on such data but one may like to compare them in order to arrange them in some desired sequence. Now, if we compare the alphabetic values A and B, which one will be treated as greater by the computer? For an answer to such questions, it is necessary to have some assigned ordering among the characters used by the computer. This ordering is known as the collating sequence. Collating sequence may vary from one computer system to another depending on the type of computer code used by a particular computer. To illustrate this, let us consider the computer codes already discussed in this chapter. Observe from Figures 4.2 and 4.3 that the zone values of the characters A through 9 decrease in BCD code from the equivalent of decimal 3 down to 0, while the zone values of the characters A through 9 increases in EBCDIC from the equivalent of decimal 12 to 15. This means that a computer, which uses BCD code for its internal representation of characters will treat alphabetic characters (A, B, ..., Z) to be greater than numeric characters (0, 1, ..., 9). On the other hand, a computer, which uses EBCDIC for its internal representation of characters will treat numeric characters to be greater than alphabetic characters. Similarly, observe from Figure 4.6 and 4.7 that a computer, which uses ASCII for its internal representation of characters will place numbers ahead of letters during a sort (ascending) because the number characters have a zone value that is less than the zone value for letters. However, whatever may be the type of computer code used, in most (not all - in BCD 0 > 9) collating sequences, the following r...
View Full Document

## This document was uploaded on 04/07/2014.

Ask a homework question - tutors are online