Unsigned subtracted by Natural VHDL

Discussion in 'Hardware' started by caosjr, Jun 12, 2014.

  1. caosjr

    caosjr

    Joined:
    Jun 12, 2014
    Messages:
    1
    Hi guys,

    I am implementing CORDIC for floating point, and I have a problem with the subtraction between UNSIGNED type and NATURAL. I tested on Modelsim and the result is completely different from I what I expected. For example

    "01111111111" - 1023
    -
    1
    ----------------------------
    "11111111101" - 2045

    all the variables are UNSIGNED and i is NATURAL RANGE 0 to 31. I'm doing this because I need to divide the value of new_y by power of 2, I can't use shift because this is the exponent, so I have to subtract by 1, 2, 4, 8 ... 2^31. Can you help me?

    exp_y := new_y(word_size-2 DOWNTO mantissa);
    exp_y := exp_y - i;
    new_x <= arith_operation_float(new_x, shifted_y);
     

    Attached Files:

    caosjr, Jun 12, 2014
    #1
    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. Dave Thomas

    XP unsigned Modem Driver!

    Dave Thomas, Apr 15, 2004, in forum: Computer Support
    Replies:
    5
    Views:
    627
    Dave Thomas
    Apr 22, 2004
  2. mcbacon@gmail.com

    Windows Vista Unsigned Drivers

    mcbacon@gmail.com, Dec 11, 2006, in forum: Windows 64bit
    Replies:
    1
    Views:
    412
    Charlie Russel - MVP
    Dec 11, 2006
  3. Kue2
    Replies:
    16
    Views:
    1,229
    chinga69
    Jan 30, 2007
  4. Kue2

    signed & unsigned drivers?

    Kue2, Aug 29, 2007, in forum: Windows 64bit
    Replies:
    2
    Views:
    1,423
    Carlos
    Sep 1, 2007
  5. becool_nikks
    Replies:
    0
    Views:
    2,016
    becool_nikks
    Mar 6, 2009
Loading...

Share This Page