The Micropocessor-based PC System

Computer Data Formats
Microprocessor Course
Electrical Engineering Department
University of Indonesia
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
called define byte(s) or DB
2
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 00002
to 10012 or 0-9 decimal
• Table 1.9 shows some decimal numbers
converted to both packed ad unpacked BCD
3
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-23
• Define bit (DB) directive is used to store 8-bit
data in memory
4
Word-sized Data
• A word (16-bits) is formed with two bytes of
data
• The LSB is always stored in the lowestnumbered 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 microprocessors
5
Word-sized Data
• Fig 1.11(a) & (b) shows the weight of each bit
position in a word of data
• Example 1.25 shows several signed and
unsigned word-sized data stored in memory
using the assembler program
• Note that define word(s) directive or DW
causes the assembler to store words in the
memory
6
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 position
• To define doubleword-sized data, use
assembler directive define doubleword or DD
7
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 numbers
• The exponent is stored as a biased exponent
– an exponent of 23 is represented as a biased
exponent of 127+3 or 130 (82H) in the singleprecision form or as 1026 (402H) in the doubleprecision form
8
9
10
11
12
13
14
15
16