Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Data Formats Microprocessor Course Electrical Engineering Department University of Indonesia.

Similar presentations


Presentation on theme: "Computer Data Formats Microprocessor Course Electrical Engineering Department University of Indonesia."— Presentation transcript:

1 Computer Data Formats Microprocessor Course Electrical Engineering Department University of Indonesia

2 2 ASCII Data American Standard Code for Information Interchange (ASCII) data represent alphanumeric characters in the memory of a computer system (Table 1.7)Table 1.7 The standard ASCII code is a 7-bit code with the eighth and MSB used to hold parity in some systems ASCII are most often stored in memory using a special directive to the assembler program called define byte(s) or DBDB

3 3 BCD Data Binary-Coded Decimal (BCD) information is stored in either packed or unpacked forms Packed BCD data are stored as two digits per byte Unpacked BCD data are strored as one digit per byte The range of a BCD digit extends from 0000 2 to 1001 2 or 0-9 decimal Table 1.9 shows some decimal numbers converted to both packed ad unpacked BCDTable 1.9packed ad unpacked BCD

4 4 Byte-Sized Data Byte-size data are stored as unsigned and signed integers Negative signed numbers are stored in the 2’s complement form –Whenever a number is 2’s complement, its sign changes from negative to positive or positive to negative –See example 1-22, 1-231-22, 1-23 Define bit (DB) directive is used to store 8-bit data in memoryDB

5 5 Word-sized Data A word (16-bits) is formed with two bytes of data The LSB is always stored in the lowest- numbered memory location, the MSB in the highest (i.e., little endian format) -- used with Intel family of microprocessor An alternate method (i.e., big endian format) is used with the motorolla family of micro- processors

6 6 Word-sized Data Fig 1.11(a) & (b) shows the weight of each bit position in a word of dataFig 1.11(a) & (b) Example 1.25 shows several signed and unsigned word-sized data stored in memory using the assembler programExample 1.25 Note that define word(s) directive or DW causes the assembler to store words in the memory

7 7 Doubleword-sized Data Doubleword-sized data requires four bytes of memory (32-bit number) Doubleword-sized data appear as a product after a multiplication and also as a dividend before a division Fig. 1-12 shows the form used to store doublewords in the memory and the binary weights of each bit positionFig. 1-12 To define doubleword-sized data, use assembler directive define doubleword or DDDD

8 8 Real Numbers A real number (floating-point number) contains two parts: a mantissa, significand, or fraction and an exponent Fig. 1-13 and example 1-27 depicts both the 4-byte (single precision) and 8-byte (double precision) forms of real numbersFig. 1-13example 1-27 The exponent is stored as a biased exponent –an exponent of 2 3 is represented as a biased exponent of 127+3 or 130 (82H) in the single- precision form or as 1026 (402H) in the double- precision form

9 9

10 10

11 11

12 12

13 13

14 14

15 15

16 16


Download ppt "Computer Data Formats Microprocessor Course Electrical Engineering Department University of Indonesia."

Similar presentations


Ads by Google