[SOLVED] EC605 Homework 3

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon HW3-9plvj3.zip (109.1 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (4 votes)
  1. [Assembly bits]
    For each of the following tasks write a LEGv8 assembly instruction(s) to perform the task.

    1. a)  Add x1 and x7 and store the result in x5.
    2. b)  Load an unsigned byte from the address in register x6 + 16 into register x0
    3. c)  Branch to label EndIf if x5 is equal to x11 (assume unsigned content).
    4. d)  Shift the content of register x9 right by 15 positions.
  2. [Instruction Encoding]
    Provide the hexadecimal machine language instruction for the following LEGv8 assembly instructions.

    1. a)  stur x9, [x10, 32]
    2. b)  addi x9, x6, 8
  3. [Instruction Decoding]
    Provide the instruction type and equivalent assembly language instruction for the following machine language instructions.
    a) 0x8B000000
    b) 0xB4016B54
  4. [Bit manipulation]
    Assume the following register values: x10 = 0x00000000AAAAAAAA, x11 = 0x1234567812345678. Provide the value of x12 at the end of each of the following sequences of instructions.

    1. a)  lsl x12, x10, 4

      orr x12, x12, x11

    2. b)  lsr x12, x10, 3

      andi x12, x12, 0xFEF

  5. [Assembly snippets]
    Write the corresponding LEGv8 code for each of the following C statements. Use a minimal number of LEGv8 assembly instructions. Assume that the variables f, g, h, i, and j are in registers x0, x1, x2, x3, and x4, respectively, and that the base address of the arrays A and B are in registers x6 and x7, respectively.

    1. a)  f=g+(h–5);
    2. b)  B[8] = A[i-j];
    3. c)  if (f == g) i=i+1 else i=i+2
  • HW3-9plvj3.zip