Q2. For the following assume that values A, B, C, D, E, and F reside in memory. Also assume that instruction operation codes are represented in 6 bits, memory addresses are 64 bits, data size is 32 bits and register addresses are 5 bits. a. For each instruction set architecture shown in Figure A.1, how many addresses or names (including both memory and register), appear in each instruction for the code to compute C = A+ B, and what is the total code size? P TOS My (A) (C) R (D) Figure A.1 Operand locations for four instruction set architecture classes. The arrows indicate whether the oper and is an input or the result of the orithmetic logical unit ALU operation, or both an input and rightshades indicate inputs, and the dark shode indicates the result in (A) a top of stack (TOS) register points to the top input operand, which is combined with the operand below. The fint operand is removed from the stack, the the place of the second operand, and 105 is upted to point to the result AB operands are implct in (BL, the accu mulator is both an implat inpat eperand and a result, in KL ene input operand is a register, one is in memory and the rest goes to register Al operands are register in and, ike the stack architecture, can be transfe to memory only via spate intruction push or pep for (A) and load or store for D Stack Push A Push B Add Pop C Accumulator Load A Add B Store C Destroyed operand Register (register-memory) Load R1, A Add R3, R1,8 Store R3.C Register (load-store) Figure A.2 The code sequence for C=A+B for four classes of instruction sets. Note that the Add instruction has implicit operands for stack and accumulator architectures and explicit operands for register architectures. It is assumed that A, B, and Call belong in memory and that the values of A and B cannot be destroyed. Figure A.1 shows the Add operation for each class of architecture. b. Some of the instruction set architectures in Figure A. 1 destroy operands in the course of computation. This loss of data values from processor internal storage has performance consequences. For each architecture in Figure A.2, write the code sequence to compute: C = A + B D=A+F Overhead instruction? Load R1,A Load R2,B Add R3, R1, R2 Store R3,C E = C + D In your code, mark each operand that is destroyed during execution and mark each "overhead" instruction that is included just to overcome this loss of data from processor internal storage. What is the total code size, the number of bytes of instructions and data moved to or from memory, the number of overhead instructions, and the number of overhead data bytes for each of your code sequences? You may use a table like this to show your results: Code Code size Size of data moved to/from memory

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Q2. For the following assume that values A, B, C, D, E, and F reside in memory. Also assume
that instruction operation codes are represented in 6 bits, memory addresses are 64 bits, data
size is 32 bits and register addresses are 5 bits.
a. For each instruction set architecture shown in Figure A.1, how many
addresses or names (including both memory and register), appear in each instruction
for the code to compute C = A+ B, and what is the total code size?
passor
TOS
Memory
(A)
Accumulator (C) Registry (D) Re
loed oore
Figure A.1 Operand locations for four instruction set architecture classes. The arrows indicate whether the oper
and is an input or the result of the orithmetic-logical unit ALU operation, or both an input and result Lighter shoes
indicate inputs, and the dark shode indicates the result in a top of stack (TOS) register points to the top input
operand, which is combined with the operand below. The first operand is removed from the stack, the result takes the
place of the second operand, and 105 is updated to point to the result AB operands are impliotin (BL, the accu
mulator is both an implict input operand and a result, in KL ene input operand is a register, one is in memory
and the result goes to a register All operands are registers in ) and, like the stack architecture, can be transferred
to memory only via spaute intruction push or pop for (A) and load or store for D
Stack
Push Al
Push B
Add
Pop C
Accumulator
Load A
Add B.
Store C
Destroyed operand
Register
(register-memory)
Load R1, A
Add R3, R1,8
Store R3.C
Figure A.2 The code sequence for C=A+B for four classes of instruction sets. Note
that the Add instruction has implicit operands for stack and accumulator architectures
and explicit operands for register architectures. It is assumed that A, B, and Call belong
in memory and that the values of A and B cannot be destroyed. Figure A.1 shows the
Add operation for each class of architecture.
b. Some of the instruction set architectures in Figure A.1 destroy operands in the course
of computation. This loss of data values from processor internal storage has
performance consequences. For each architecture in Figure A.2, write the code
sequence to compute:
C = A + B
D=A+F
E = C + D
Overhead
instruction?
Register
(load-store)
Load R1,A
Load R2, B
Add R3, R1, R2
Store R3, C
In your code, mark each operand that is destroyed during execution and mark each
"overhead" instruction that is included just to overcome this loss of data from processor
internal storage. What is the total code size, the number of bytes of instructions and data
moved to or from memory, the number of overhead instructions, and the number of
overhead data bytes for each of your code sequences? You may use a table like this to
show your results:
Code
Code size
Size of data moved
to/from memory
Transcribed Image Text:Q2. For the following assume that values A, B, C, D, E, and F reside in memory. Also assume that instruction operation codes are represented in 6 bits, memory addresses are 64 bits, data size is 32 bits and register addresses are 5 bits. a. For each instruction set architecture shown in Figure A.1, how many addresses or names (including both memory and register), appear in each instruction for the code to compute C = A+ B, and what is the total code size? passor TOS Memory (A) Accumulator (C) Registry (D) Re loed oore Figure A.1 Operand locations for four instruction set architecture classes. The arrows indicate whether the oper and is an input or the result of the orithmetic-logical unit ALU operation, or both an input and result Lighter shoes indicate inputs, and the dark shode indicates the result in a top of stack (TOS) register points to the top input operand, which is combined with the operand below. The first operand is removed from the stack, the result takes the place of the second operand, and 105 is updated to point to the result AB operands are impliotin (BL, the accu mulator is both an implict input operand and a result, in KL ene input operand is a register, one is in memory and the result goes to a register All operands are registers in ) and, like the stack architecture, can be transferred to memory only via spaute intruction push or pop for (A) and load or store for D Stack Push Al Push B Add Pop C Accumulator Load A Add B. Store C Destroyed operand Register (register-memory) Load R1, A Add R3, R1,8 Store R3.C Figure A.2 The code sequence for C=A+B for four classes of instruction sets. Note that the Add instruction has implicit operands for stack and accumulator architectures and explicit operands for register architectures. It is assumed that A, B, and Call belong in memory and that the values of A and B cannot be destroyed. Figure A.1 shows the Add operation for each class of architecture. b. Some of the instruction set architectures in Figure A.1 destroy operands in the course of computation. This loss of data values from processor internal storage has performance consequences. For each architecture in Figure A.2, write the code sequence to compute: C = A + B D=A+F E = C + D Overhead instruction? Register (load-store) Load R1,A Load R2, B Add R3, R1, R2 Store R3, C In your code, mark each operand that is destroyed during execution and mark each "overhead" instruction that is included just to overcome this loss of data from processor internal storage. What is the total code size, the number of bytes of instructions and data moved to or from memory, the number of overhead instructions, and the number of overhead data bytes for each of your code sequences? You may use a table like this to show your results: Code Code size Size of data moved to/from memory
Expert Solution
Step 1

BELOW ? STEP BY STEP COMPLETE SOLUTION REGARDING YOUR PROBLEM :

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY