DAT 2343 Summary of Standard Data Encoding Alan

  • Slides: 7
Download presentation
DAT 2343 Summary of Standard Data Encoding © Alan T. Pinck / Algonquin College;

DAT 2343 Summary of Standard Data Encoding © Alan T. Pinck / Algonquin College; 2003

Character Encoding Storage Unit = byte ASCII n n n ‘A’: 41 h …’Z’:

Character Encoding Storage Unit = byte ASCII n n n ‘A’: 41 h …’Z’: 5 Ah; plus 20 h for lower case ‘ 0’: 30 h … ‘ 9’: 39 h blank: 20 h; carriage return: 0 Dh; line feed: 0 Ah EBCDIC n n ‘A’: C 1 h … ‘I’: C 9 h; ‘J’: D 1 h …’R’: D 9 h; ‘S’: E 2. . . ‘Z’: E 9 h subtract 40 h for lower case ‘ 0’: F 0 h … ‘ 9’: F 9 h blank 40 h

Basic Integer Numeric Forms Storage Unit = word Unsigned Binary position numbers (starting at

Basic Integer Numeric Forms Storage Unit = word Unsigned Binary position numbers (starting at 0 on right) n position weights : 2 position n 2’s Complement subtract unsigned binary version of absolute value from 0 n (if working in binary) reverse bits and add 1 n

Standard Integer Numeric Flags Zero n n all bits in result word are 0

Standard Integer Numeric Flags Zero n n all bits in result word are 0 may not be a “true” zero e. g. AAAh + 556 h (12 -bit word) would turn Zero “on” Carry n result wrong (too large or less than zero) for unsigned binary Sign n copy of left-most bit of result word Overflow n result is wrong if treated as 2’s complement (result sign is logically impossible for given operand signs)

Basic Float Form : 32 -bit IEEE-754 1 bit : sign (0=positive; 1=negative) 8

Basic Float Form : 32 -bit IEEE-754 1 bit : sign (0=positive; 1=negative) 8 bits: excess-127 binary exponent 23 bits : normalized binary mantissa without leading 1. 0

Hybrid Character-Numeric Forms (sign is always in right-most byte) Zoned Decimal Fd Fd …

Hybrid Character-Numeric Forms (sign is always in right-most byte) Zoned Decimal Fd Fd … FD sd BCD n Packed Decimal (a form of BCD) dd dd … dd ds (always an odd number of digits) d: hex value in range 0 to 9 inclusive s: C (hex) positive (also accepts A, E, and F as positive) D (hex) negative (also accepts B as negative)

End of Lecture

End of Lecture