+2 votes
85 views
in Computer Architecture by

1 Answer

+1 vote
by
selected by (user.guest)
 
Best answer

Address Alignment

In addition, all data values must be aligned on address boundaries that are an exact multiple of the data size (this provides greater efficiency for memory accesses). The aligment restrictions mean that halfword values must be located at even addresses (i.e. divisible by two). Similarly, word values must be stored on word boundaries (the address exactly divisible by four, or the low two bits of the address set to zero), and doubleword values must be stored on doubleword boundaries (the address exactly divisible by eight, or the low three bits of the address set to zero).

Note that the same alignment restrictions apply to instructions being fetched from memory. The impli- cation of this is that all instructions must appear at addresses that are exact multiples of four (i.e. the least signficant two bits of instruction addresses will always be zero).

Any attempt to access a data value or instruction using an address that is not properly aligned will result in a hardware trap being generated. By default, this will be caught by the operating system and the offending program will be terminated with an error message, as shown in the following example.

$ myprog

Bus error (core dumped)

Related questions

+1 vote
1 answer 118 views
+1 vote
1 answer 111 views
+1 vote
1 answer 322 views
+1 vote
1 answer 78 views
0 votes
0 answers 210 views
+1 vote
1 answer 2.1k views
+1 vote
1 answer 316 views
+1 vote
1 answer 190 views
+1 vote
1 answer 35 views
+1 vote
1 answer 41 views
+2 votes
1 answer 41 views
+2 votes
1 answer 158 views
+1 vote
1 answer 79 views
asked Sep 2 in Others by anonymous
+1 vote
1 answer 59 views
asked Sep 2 in Others by anonymous
+1 vote
1 answer 198 views
0 votes
0 answers 264 views
+3 votes
1 answer 1.6k views
Welcome to CPENTalk.com
Solution-oriented students of computer engineering on one platform to get you that

ONE SOLUTION

...