chapter1-bag2-mikroprocessor

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

Upload: teknik-komputer-ui

Post on 19-Jun-2015

753 views

Category:

Documents


0 download

TRANSCRIPT

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

2. ASCII Data

  • American Standard Code for Information Interchange (ASCII)data represent alphanumeric characters in the memory of a computer system ( 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 calleddefine byte(s)or DB

3. BCD Data

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

4. Byte-Sized Data

  • Byte-size data are stored asunsignedandsigned integers
  • Negative signed numbers are stored in the 2s complement form
    • Whenever a number is 2s complement, its sign changes from negative to positive or positive to negative
    • See example1-22, 1-23
  • Define bit ( DB )directive is used to store 8-bit data in memory

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 endianformat) -- used with Intel family of microprocessor
  • An alternate method (i.e.,big endianformat) is used with the motorolla family of micro-processors

6. Word-sized Data

  • Fig 1.11(a) & (b)shows the weight of each bit position in a word of data
  • Example 1.25shows several signed and unsigned word-sized data stored in memory using the assembler program
  • Note thatdefine word(s) directiveorDWcauses the assembler to store words in the memory

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-12shows the form used to store doublewords in the memory and the binary weights of each bit position
  • To define doubleword-sized data, use assembler directivedefine doublewordorDD

8. Real Numbers

  • A real number (floating-point number) contains two parts: a mantissa, significand, or fraction and an exponent
  • Fig. 1-13andexample 1-27depicts both the 4-byte ( single precision ) and 8-byte ( double precision ) forms of real numbers
  • 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. 10. 11. 12. 13. 14. 15. 16.