Assume a computer that has 32-bit integers. Show how each of the following values would be stored sequentially in memory, starting at address 0x100, assuming that each address holds 1 byte. Be sure to extend each value to the appropriate number of bits. You will need to add more rows (addresses) to store all given values.

a) 0xAB123456

b) 0x2BF876

c) 0x8B0A1

d) 0x1

e) 0xFEDC1234

byte order
address big endian little endian
0x100
0x101
0x102
0x103
0x104
0x105
0x106
0x107

Answer :

Answer:

Adresses                          Big endian                                    Little Endian

0x100                                  AB                                                 56

0x101                                   12                                                  34

0x102                                  34                                                  12

0x103                                  56                                                 AB

0x104                                  00                                                 76

0x105                                  2B                                                 F8

0x106                                  F8                                                 2B

0x107                                 76                                                 00

0x108                                00                                                 A1

0x109                                08                                                B0  

0x10A                                B0                                                08

0x10B                                A1                                                 00

0x10C                               00                                                  01

0x10D                               00                                                 00  

0x10E                               00                                                  00

0x10F                                01                                                   00

0x110                                FE                                                   34

0x111                                 DC                                                  12

0x112                                12                                                    DC  

0x113                                34                                                   FE

Explanation:

As, it is mentioned that all the integers have 32 bits and all the data given in the question is in Hexadecimal. In Hexadecimal each number consists of 4 bits.

Each memory location contains 1 byte = 8 bits of data. So we store 2 digits of Hexadecimal number each location from each number in given data. If any number contains less than 32 bits in binary, we will add zeros to complete the number in 32 bits.

In big endian order, data is stored from upper most bit to lower most bit in sequential order and in Little Endian order it is vise versa.

Other Questions