Starting from:

$50

ECE5484-Homework 4 Solved

1.   Consider the MARIE program below.

a)    List the hexadecimal code for each line of the program (including the symbols).

b)    Draw the symbol table.

c)    What is the value stored in the AC when the program terminates?

ORG 100

Begin, LOAD Base ADD Offs

Loop,
SUBT Two

STORE Addr

SKIPCOND 800

JUMP Done CLEAR

LOAD Offs
Done,
HALT
Base,
HEX 200
Offs,
DEC 11
Two,
HEX 0002
Addr,
HEX 007
2.   Write the assembly language equivalent of the following MARIE machine language instructions:

a)    0100 0001 1000 0101

b)    1000 0100 0000 0000

c)    0111 0000 0000 0000

3.   Write the following code segment in MARIE’s assembly language:

if X < 1 then

Y = X - 2;

X   = 0;

endif;

Y    = Y + 7;

4.   Fill in the following table to show how the given integers are represented, assuming 16-bits are used to store values and the machine uses 2’s complement notation.

Integer
Binary
2 Byte Big Endian

(hex value as seen in

Hex                         memory)
2 Byte Little Endian

(hex value as seen in memory)
7

1329

-7

-27109

31307
 
 
 
5.   Suppose we have the instruction Load 600. Given memory and register R1 contain the values below and assuming R1 is implied in the indexed addressing mode, determine the actual value loaded into the accumulator and fill in the table below:

 

Mode
Value loaded into AC
Immediate

Direct

Indirect

Indexed
 
6.   Suppose an instruction takes four cycles to execute in a nonpipelined CPU: one cycle to fetch the instruction, one cycle to decode the instruction, one cycle to perform the ALU operation, and one cycle to store the result. In a CPU with a 4-stage pipeline, that instruction still takes four cycles to execute, so how can we say the pipeline speeds up the execution of the program?

7.   Scavenger Hunt: John Cocke and David Patterson made significant contributions to Reduced Homework 4

Instruction Set Computer (RISC) architectures. Answer the following questions separately for each of

these two individuals. Cite the sources you used to find your answers. Your entire answer should be one page or less.

a)    In your own words, what was his contribution to RISC architectures? Try to be specific.

More products