Question
Given the following segment of C code, c = (a + b) * a; e = (b + c) * d; f = c +
Given the following segment of C code, c = (a + b) * a; e = (b + c) * d; f = c + e;
Based on the following assumptions on information size: - opcode: 8 bits - each data (operand) item: 16 bits - each register specifer: 4 bits - each address: 16 bits
for each of the following "memory-aligned" machines (a) an 16-bit (0,3)-GPR architecture (b) an 16-bit (1,2)-GPR architecture (c) an 16-bit (3,3)-GPR architecture
recompile the code into the most memory-access-efficient assembly code (write "same" if it is not changed). The effciency is in terms of the total size of memory accesses including the instruction accesses and operand accesses (reads and writes). Calculate the number of total memory accesses in terms of bytes for each of the machines. Note: round to the next larger integer for byte number calculation.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started