Show how the following values would be stored by byte-addressable machines with
ID: 3567572 • Letter: S
Question
Show how the following values would be stored by byte-addressable machines with 32- bit words, using little endian and then big endian format. Assume each value starts at address 301816. Draw a diagram of memory for each, placing the appropriate values in the correct (and labeled) memory locations.
a. 56789ABC16 b. 2014111910
The memory unit of a computer has 256K words of 32 bits each. The computer has an instruction format with 4 fields: an opcode field; a mode field to specify 1 of 7 addressing modes; a register address field to specify one of 16 registers; and a memory address field. Assume an instruction is 32 bits long. Answer the following:
a. How large must the mode field be?
b. How large must the register field be? c. How large must the address field be? d. How large is the opcode field?
4. (bonus question, 5 points) In a computer instruction format, the instruction length is 12 bits and the size of an address field is 4 bits. Is it possible to have:
13 2-address instructions 45 1-address instructions 45 0-address instructions
using the specified format? You must show your design or argument to justify your answer to get credit.
Explanation / Answer
Answer 1:
A:
56789ABC16
Address
Big Endian
Little Endian
301816
56
16
301817
78
BC
301818
9A
9A
301819
BC
78
30181A
16
56
B:
2014111910
Address
Big Endian
Little Endian
301816
20
10
301817
14
19
301818
11
11
301819
19
14
30181A
10
20
Answer 2:
a. We need to identify 1 of 7 items, so there must be 3 bits (23 = 8)
b. 16 registers implies 4 bits (24 = 16)
c. 256K = 28210 = 218, or 18 bits
d. 32 - (3 + 4 + 18) = 7 bits
Answer 3:
Yes it is possible to have all these instruction using specified format.
The 2-address instructions could be represented 0000 xxxx xxxx through 1100 xxxx xxxx
(using 0000 through 1100 for opcodes) as shown below:
0000 XXXX XXXX
13 2-Address Instructions
1100 XXXX XXXX
The 1-address instructions could use 1101 0000 through 1101 1111 (16), 1110 0000 through
1110 1111 (16), and 1111 0000 through 1111 1100 (13 more, for a total of 45) as shown below:
1101 0000 XXXX
16 1 Address Instructions
45 1 Address instruction
1101 1111 XXXX
1110 0000 XXXX
16 1 Address Instructions
1110 1111 XXXX
1111 0000 XXXX
13 1 Address Instructions
1111 1100 XXXX
The 0-address instructions could use 1111 1101 0000 through 1111 1101 1111 (16),
1111 1110 0000 through 1111 1110 1111 (16) and 1111 1111 0000 through 1111 1111 1100
(13 more, for a total of 45) as shown below:
1111 1101 0000
16 0 Address Instructions
45 0 Address instruction
1111 1101 1111
1111 1110 0000
16 0 Address Instructions
1111 1110 1111
1111 1111 0000
13 0 Address Instructions
1111 1111 1100
A:
56789ABC16
Address
Big Endian
Little Endian
301816
56
16
301817
78
BC
301818
9A
9A
301819
BC
78
30181A
16
56
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.