Numeric value ebcdic sign indicator 345 345 345

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EBCDIC. Because each decimal digit has a zone with it, numbers coded in EBCDIC are called zoned decimal numbers. Numeric data input into the computer are usually zoned decimal numbers. Printers can print only those numeric characters that are in a zoned-decimal format. Numeric Value EBCDIC Sign Indicator 345 +345 -345 F3F4F5 F3F4C5 F3F4D5 F for unsigned C for positive D for negative Figure 4.4. Numeric values in EBCDIC in Hexadecimal notation. However, most computers cannot perform arithmetic operations on zoned-decimal data. Thus, before any arithmetic operation can be performed, the data must be converted to a format on which arithmetic operations are possible. One such acceptable format is the packed decimal format. The following steps are used to convert a zoned decimal nunoer to a packed decimal number: Step 1: The zone half and the digit half of the rightmost byte are reversed. This moves the sign to the extreme right of the number. Step 2: All remaining zones are dropped out. Figure 4.5 illustrates the conversion process of zoned decimal data to packed data. Numeric Value Zoned Format Packed Format 345 F3F4F5 345F +345 F3F4C5 345C -345 F3F4D5 345D 3456 F3F4F5F6 03456F Figure 4.5. Zoned and packed decimal numbers. It may be observed that packed data requires fewer number of bytes (group of 8 bits) as compared to zoned data. In the zoned format, there is only one digit per byte (each digit along with the zone requires 8 bits). But there are two digits in each byte in the packed format (each digit requires 4 bits). If the packing process does not completely fill a byte, it is filled with a zero. For example, the zoned data F3F4F5F6 will convert to packed data 03456F. Observe that in this example, the zoned data requires 4 bytes and the packed data requires only 3 bytes Example 4.3. Using binary notation, write the EBCDIC coding for the word BIT. How many bytes are required for this representation? Solution: B = 1100 0010 in EBCDIC binary notation I = 1100 1001 in EBCDIC...
View Full Document

This document was uploaded on 04/07/2014.

Ask a homework question - tutors are online