Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- Must show all the steps to get any credit - Label all the inputs/outputs clearly with variable names I. (15 points) Assume the semantics
- Must show all the steps to get any credit
- Label all the inputs/outputs clearly with variable names
I. (15 points) Assume the semantics and syntax of various address modes (section 3.2.3 & Figure 3.3 of text.) Given R = 30 and index register X = 45, indicate the operand addressing mode used and the value of the accumulator after the execution of each of the following LDAC (Load Accumulator) instructions. Assume all memory locations, except those containing instructions, have data value equal to twice the location value: for example, location 12 has the data 2 * 12 = 24.
a) LDAC 38
b) LDAC @38
c) LDAC R
d) LDAC @R
e) LDAC 20(X)
II. (15 points)
The following high-level code finds A * B by repeatedly adding A to itself B times:
(a) prod = 0, j = 0
(b) prod = prod + A
(c) j = j + 1
(d) IF ( j != B) go to 2
Using the Instruction Set as per Table 3.1, write an assembly code to do this task. Assume that all 1-byte instructions take 120 ns and all 3-byte instructions take 300 ns. What is the total size, in bytes, of your code? What is the total execution time of your code as a function of B?
III. (10 points) Show RSCPU machine code bytes (in binary) for the assembly code (note that the machine code starts at memory location 70):
70: LDAC 50
MVAC
LDAC 56
ADD
STAC 54
Hint: For example, LDAC 100, which means load AC with the data byte stored at the memory location 100, translates to three bytes of machine code as:
0000 0001 ; instruction code for LDAC
0110 0100 ; low-byte of address 100
0000 0000 ; high-byte of address 100
IV. (10 points) Assume a 64-byte memory module connected to a CPU that has a 10-bit address bus. Show the logic to generate the CE signal for this memory module if it occupied the following range of addresses: (a) 128 to 191 (b) 704 to 767
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