39.2k views
4 votes
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

User Yoztastic
by
5.0k points

2 Answers

3 votes

Final answer:

The question is about demonstrating how 32-bit integers are stored in computer memory using both big endian and little endian byte orders. Big endian starts with the most significant byte at the lowest address, while little endian starts with the least significant byte. The unit for one million bytes in computer memory is called a Megabyte (MB).

Step-by-step explanation:

The subject of this question is related to how an integer is represented in memory in a computer. The computer uses a 32-bit integer representation, and we are to consider how different hexadecimal values would be stored in memory with both big endian and little endian byte orders. Each memory address can hold one byte (8 bits), and the starting address is given as 0x100. Since the computer has 32-bit integers, each value needs to be represented using 4 bytes (or 4 memory addresses).

  • In big endian byte order, the most significant byte (MSB) is stored at the lowest memory address. So for the value 0xAB123456, it will be stored as AB at 0x100, 12 at 0x101, 34 at 0x102, and 56 at 0x103.
  • In little endian byte order, the least significant byte (LSB) is stored at the lowest memory address. So for the same value, 0xAB123456, it would be stored as 56 at 0x100, 34 at 0x101, 12 at 0x102, and AB at 0x103.

The process is similar for the remaining values; they are also extended to 32 bits by adding leading zeroes if necessary (as is the case for values b, c, and d) before being stored in memory.

The unit for one million bytes in computer memory is Megabyte (MB).

=

User Bcardarella
by
5.3k points
4 votes

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

Step-by-step 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.

User Kyoryu
by
5.2k points