tailieunhanh - Algorithms and Data Structures in C part 5

Figure Mapping of each Union Entry The organization of each union entry is shown in Figure . For the union declaration t there are only eight bytes stored in memory. | Figure Memory Implementation for Variable t Figure Mapping of each Union Entry The organization of each union entry is shown in Figure . For the union declaration t there are only eight bytes stored in memory. These eight bytes can be interpreted as eight individual characters or two longs or two doubles etc. For instance by looking at Table one sees the value of ch 0 which is 0 41 which is the letter A. Similarly the value of ch 1 is 0 42 which is the letter B. When interpreted as an integer the value of i 0 is 0 41424344 which is in 2 s complement format. Converting to decimal one has i 0 with the value of If one were to interpret 0 41424344 as an IEEE 32-bit floating point number its value would be . If one were to interpret 0 45464748 as an IEEE 32-bit floating point number its value would be . Code List Data Representations Code List Output of Program in Code List There are only one s and zero s stored in memory and collections of bits can be interpreted to be characters or integers or floating point numbers. To determine which kind of operations to perform the compiler must be able to determine the type of each operation. Problems Represent the following decimal numbers when possible in the format specified. 125 -1000 267 45 0 2500. Generate all answers in HEX a 8-bit 2 s complement 2 hex digits b 16-bit 2 s complement 4 hex digits c 32-bit 2 s complement 8 hex digits d 64-bit 2 s complement 16 hex digits Convert the 12-bit 2 s complement numbers that follows to 32-bit 2 s complement numbers. Present your answer with 8 hex digits. a 0xFA4 b 0x802 c 0x400 d 0x0FF Represent decimal in IEEE 32-bit format and IEEE 64-bit format. Represent the decimal fraction 4 7 in binary. Represent the decimal fraction in octal. Represent the decimal fraction in hex. Calculate the floating point number represented by the IEEE 32-bit representation F8080000. Calculate the floating point

TÀI LIỆU LIÊN QUAN
10    158    1
6    184    1
7    162    1
5    157    1
6    160    1
6    152    1
6    150    1
6    206    1
7    154    1