C++ Question Urgent

Discussion in 'C++' started by Milk, Apr 11, 2004.

  1. Milk

    Milk Guest

    Hi all,
    Can anyone help me to do this Question. Coz this is my first time study C++
    language and my lecture want me to do this kind of program, i really don't
    have any ideal, or can send me some link is similar this program to me have
    a look,
    i already finish the MIPS part and the C Program that part also , but the
    simulator part is
    really hard for me~

    pls help me
    thanks a lot

    here is the Question::

    Improve the following (badly written) matrix multiplicationprogram and
    translate it into MIPs assembly language then assemble into machine language
    (hexadecimal representation). You may use a compiler to produce an assembly
    language file and SPIM to produce the final hexadecimal machine language but
    it WILL be faster to compile the program manually given past experience by
    students. It will also mean you need to implement less instructions in the
    simulator, or put it another way, do LESS WORK.

    #define n varies see belowtypedef char index_;typedef longint
    matrix[n + 1][n + 1];main(){ index_ i, j, k; matrix a, b, c; for (j = 0;
    j< n; j++) { for (i = 0; i< n; i++) { a[j] = i * j; b[j]
    = a[j]; } } for (i = 0; i< n; i++) { for (k = 0; k< n; k++)
    { c[k] = 0.0; for (j = 0; j < n; j++) c[k] += a[k][j]
    * b[j]; } }}
    Write a simulator for the final version of the pipelined datapath from your
    text book adding a 1-bit branch predictor and assuming two pipeline delays
    for the data memory. The branch logic MUST remain in the ALU stage; do not
    move it back to the register/decode stage. You MUST use branch flushing (do
    NOT use branch delay slots), you MUST implement data forwarding and detect
    and resolve load hazards.



    Beware the text has a number of errors.

    The simulator must display on screen the contents of pipeline and registers
    being used and 8 memory locations commencing with one currently being
    accessed. A simple text based display is acceptable as long as the screen
    does not scroll every clock cycle! The simulator must also support single
    step operation and be able to run until a particular instruction address is
    reached. The simulator must read in the hexadecimal format machine
    instructions. You may choose what language to use.

    You are only required to implement the instructions used in the
    multiplication program. For Assignment 1 use 16x16 matrices only. The Branch
    Target Buffer must have only 1 entry only (to simplify the problem!).





    ~ Let us linux ~


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
     
    Milk, Apr 11, 2004
    #1
    1. Advertising

  2. Milk <> spoke thus:

    > Can anyone help me to do this Question.


    Only if you post your attempt at it. Or send us money.

    > Coz this is my first time study C++
    > language and my lecture want me to do this kind of program, i really don't
    > have any ideal,


    Start by not sleeping through lecture and by getting to know your
    professor and your teaching assistants (if you have them). We are
    neither.

    > pls help me


    Buy a book, read it. Read the FAQ:

    http://www.slack.net/~shiva/welcome.txt
    http://www.parashift.com/c -faq-lite/

    --
    Christopher Benson-Manica | I *should* know what I'm talking about - if I
    ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
     
    Christopher Benson-Manica, Apr 12, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Edward
    Replies:
    2
    Views:
    351
    Edward
    Jun 28, 2004
  2. Mike

    Re: urgent question, need help

    Mike, Jul 18, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    300
  3. Sachin Jagtap

    URGENT !! QUEUE STL PROBLEM URGENT!!

    Sachin Jagtap, Apr 28, 2005, in forum: C++
    Replies:
    4
    Views:
    1,055
    Mark Stijnman
    Apr 29, 2005
  4. Rob
    Replies:
    3
    Views:
    452
  5. Replies:
    1
    Views:
    279
Loading...

Share This Page