a. Assume a computer has a physical memory organized into 64-bit words. Give the word address and offset within the word for each of the following byte addresses:

0, 9, 27, 31,120, and 256.

b. Extend the above exercise by writing a computer program that computes the answer. The program should take a series of inputs that each consist of two values: a word size specified in bits and a byte address. For each input, the program should generate a word address and offset within the word. Note: although it is specified in bits, the word size must be a power of two bytes.

Respuesta :

Answer:

Check the explanation

Explanation:

For 9th byte , it is from 8*8 bit to 9"8th bit so each word consists of 64 bits , to find word address u have to divide 8*8 by 64.

Offset within word = 9*8modulo 64.

For 27th byte , word address = 8*27/64.

Offset within word = 27* 8 modulo 64

For 21th byte , word address = 8*31/64

Offset within the word = 31*8 modulo 64

For 120 , word address = 8*120/64

Offset within the word = 120*8 modulo 64.

ACCESS MORE