Thread: Develop subroutines that will convert keyboard input into a real numeric value.

  1. #1
    Registered User
    Join Date
    Apr 2015
    Posts
    5

    Develop subroutines that will convert keyboard input into a real numeric value.

    Develop subroutines that will convert keyboard input into a real numeric value. Additionally develop a subroutine that will take a numeric value and display it to the terminal window. Test your subroutines by incrementing the inputted value by 1. Your numbers must be able to go up 9999. For example on your monitor window you should see 1567 + 1 = 1568
    Note make use of the SDRAM.


    -- this is my homework and have no idea how to start it if someone could help.

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    4,458
    So what type of hardware and operating system (if any) are you using?

    Jim

  3. #3
    Registered User
    Join Date
    Apr 2015
    Posts
    5
    We are using the software Quartus and using a DE0-nano board.

  4. #4
    Registered User
    Join Date
    May 2010
    Posts
    4,458
    You're going to need to provide much more information than that. I for one have never heard of Quartus and am unfamiliar with your DEO-nano board along with whatever other hardware may be attached to this board. This is an embedded product that few, other than your classmates, will have access to so you'll need to provide links to the hardware and software you happen to be using.

    Jim

  5. #5
    Registered User
    Join Date
    Apr 2015
    Posts
    5
    -- this is what the teacher has given us

    test value
    store value
    count # digits
    convert to decimal
    #2 digit


    test jtag
    test value
    if 't' entry done
    inc counter
    store value
    inc address

    ************************************************** ********************
    movia, r2, JTAG
    movi r5, '+'

    loopHere:ldwio, r3, 0x(r2)
    and r4, 43, 0x8000
    beq r4, r0, loopHere

    andi r3, r3, 0x0FF

    beq r3, r5. entryDone
    addi r6, r6, 1
    stw r3. 0x(r7)
    addi r7, r7, 4
    br loopHere

    entryDone:
    movi r8, r4
    beq r6, r8, thousand
    subi r8, r8, 1
    beq r6, r8, hundred
    ubi r8, r8, 1
    beq r6, r8, tens
    ubi r8, r8, 1
    beq r6, r8, ones

    thousand: ldw r10. 0x(r7)
    ldw r10, 0x(r7)
    subi r10, r10, 0x30
    muli r10, r10, 1000

    addi r7, r7 4
    ldw r11, 0x(r7)
    subi r10, r10, 0x30
    muli r10, r10, 100

    add r7, r7, r11

  6. #6
    Registered User
    Join Date
    May 2010
    Posts
    4,458
    Posting a bunch of assembly code doesn't really tell us much about your hardware. However it does show that you're totally lost and maybe you would be better off talking to your instructor about the problem.


    Jim

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. REAL keyboard input used in A "FUNCTION." ?
    By sharris in forum C++ Programming
    Replies: 1
    Last Post: 01-24-2011, 09:02 AM
  2. Reading numeric input one by one
    By oval in forum C Programming
    Replies: 10
    Last Post: 01-24-2006, 03:45 PM
  3. Using stringstream to convert numeric types to strings
    By 7stud in forum C++ Programming
    Replies: 11
    Last Post: 08-07-2003, 05:21 AM
  4. Is there a function to convert a numeric value into a string?
    By sundeeptuteja in forum C Programming
    Replies: 6
    Last Post: 11-06-2002, 02:11 PM
  5. Replies: 3
    Last Post: 09-12-2001, 10:45 AM

Tags for this Thread