+ Reply to Thread
Results 1 to 4 of 4

Thread: Flowchart for a subroutine

  1. #1
    Newbie Fredrik373 is an unknown quantity at this point
    Join Date
    Jan 2010
    Location
    Sweden
    Posts
    5

    Flowchart for a subroutine

    hello!

    First off I don't know if this is the right spot to put this post, but I'm new here so...

    My task is to draw a flowchart for a subroutine to convert a 4-bit hexadecimal value to the corresponding 7-bit ASCII-code.

    Specification:
    Input parameters: Only one, in register r4. The 4 least significant bits in register r4 specify a number, from 0 through 15. The values of all other bits in the input must be ignored.
    Return value: Only one, returned in register r2. The 7 least significant bits in register r2 must be an ASCII code as described below. All other bits in the output must be zero.
    Required action: Input values 0 through 9 must be converted to the ASCII codes for the digits '0' through '9', respectively. Input values 10 through 15 must be converted to the ASCII codes for the letters 'A' through 'F', respectively.
    Side effects: The values in registers r2 through r15 may be changed. All other registers must have unchanged values when the subroutine returns.

    I don't know how to begin...

    I would be glad if anyone could help me!
    Last edited by Fredrik373; 01-27-2010 at 06:55 AM.

  2. #2
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,686
    Blog Entries
    57

    Re: Flowchart for a subroutine

    Which part of it is the difficulty?

    Can you grab only the bits you care about?
    Can you convert them to an integer?
    Can you determine the ASCII codes?
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  3. #3
    Newbie Fredrik373 is an unknown quantity at this point
    Join Date
    Jan 2010
    Location
    Sweden
    Posts
    5

    Re: Flowchart for a subroutine

    The part I needed help with was to just draw the flowchart, but I managed to do that..

    But now I am going to write this as assembly code for Nios II. My problem now is that I don't know how to begin writing the code..

    You can see my flowchart on attachments.

    I am going to convert that flowchart into assemblycode..

    Any suggestions how I should start? Im new to assembly.
    Attached Thumbnails Flowchart for a subroutine-flowchart.png  

  4. #4
    Newbie Fredrik373 is an unknown quantity at this point
    Join Date
    Jan 2010
    Location
    Sweden
    Posts
    5

    Re: Flowchart for a subroutine

    I have made a new thread that is more easy to understand, so you do not need to reply to this one.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Flowchart problem
    By gabz456 in forum General Programming
    Replies: 4
    Last Post: 09-23-2009, 12:24 PM
  2. flowchart help
    By j0k3r5an in forum Python
    Replies: 3
    Last Post: 08-15-2009, 06:35 AM
  3. Flowchart - While loop
    By spadez in forum C and C++
    Replies: 17
    Last Post: 04-19-2009, 10:41 PM
  4. Code transfer to flowchart
    By indian in forum C and C++
    Replies: 4
    Last Post: 02-06-2008, 10:41 AM
  5. MIPS Custom Subroutine help
    By Epik in forum General Programming
    Replies: 1
    Last Post: 05-28-2007, 10:03 PM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts