Sponsored Links


Results 1 to 1 of 1

Thread: CS501 Advance Computer Architecture Assignment 1 solution Fall 3rd November 2012

  1. #1
    Senior Member
    Join Date
    Oct 2012
    Posts
    323

    Icon51 CS501 Advance Computer Architecture Assignment 1 solution Fall 3rd November 2012

    Sponsored Links1





    CS501 Advance Computer Architecture Assignment 1 solution Fall 3rd November 2012





    Q1. Write an SRC assembly language program to evaluate the following expression:

    f = 4(k+32) + 16(g-h)

    Note that your code should not change the source operands and also keep in mind that the SRC does not have a multiply instruction

    Part b: 5 marks

    Draw memory map table for the above program using the following scenario and assume that SRC uses 16-bit memory in this case.

    .ORG 300 ; start the next line at address 300

    k: .DW 1 ;

    g: .DW 1 ;

    h: .DW 1 ;

    f: .DW 1 ;

    ;

    .ORG 400 ; start the code at address 400

    The code starts at address 400 and each instruction takes 16-bits in the memory.

    Solution:

    Write an SRC assembly language program to evaluate the following expression:

    f = 4(k+32) + 16(g-h)

    Note that your code should not change the source operands and also keep in mind that the SRC does not have a multiply instruction

    Solution

    ld R1,g

    ld R3,h

    sub R5,R3,R1

    shl R4,R5,4

    addi R7,R6,32

    shl R8,R7,2

    add R9,R8,R4

    st R9,f

    Part b: 5 marks

    Draw memory map table for the above program using the following scenario and assume that SRC uses 16-bit memory in this case.



    .ORG 300 ; start the next line at address 300

    k: .DW 1 ;

    g: .DW 1 ;

    Sponsored Links

    h: .DW 1 ;

    f: .DW 1 ;

    ;



    .ORG 400 ; start the code at address 400

    The code starts at address 400 and each instruction takes 16-bits in the memory.



    Solution

    Memory Map

    Memory Address
    Memory Contents

    300
    unknown

    304
    unknown

    308
    unknown

    312
    unknown

    …..


    400
    ld R1,g

    402
    ld R3,h

    404
    sub R4,R3,R1

    406
    shl R4,R5,4

    408
    addi R7,R6,32

    410
    shl R8,R7,2

    412
    add R9,R8,R4

    414
    st R9f


    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 11-24-2014, 07:28 PM
  2. Replies: 0
    Last Post: 12-01-2012, 09:00 PM
  3. Replies: 0
    Last Post: 06-25-2012, 10:12 PM
  4. Replies: 2
    Last Post: 01-25-2012, 11:08 PM
  5. Replies: 1
    Last Post: 01-17-2012, 12:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft