Forum Discussion

ErenYagar's avatar
ErenYagar
Icon for New Contributor rankNew Contributor
3 years ago
Solved

Insufficient GPIO Pins for 32-Bit Adder Implementation on DE0 Nano SoC

I am working on a 32-bit adder with the following inputs and outputs:

input [31:0] a;

input [31:0] b;

output Cout;

output [31:0] sum;

However, my DE0 Nano SoC board only has 40 GPIO pins, and I require a total of 97 pins for this design.

What should I do to overcome the shortage of GPIO pins?

Thank you in advance for your help.

  • You need to use internal register(s) to store the values in A, B, and/or SUM.

    If you do that, you could load the input A, B registers with just two or three signals (CLOCK plus one or two DATA inputs).
    Serial shift in the data inputs using 32 (or 64) clocks on the DATA line(s).
    So just two or three pins.

    Then you have 33 outputs needed for SUM plus COUT.

    Total of 3 + 33 = 36 signals total, less than 40 with some spares...

    And if you want even fewer, you could store the SUM/COUT in a register and shift it out serially also.
    With a LOAD/SHIFT line, a CLOCK line, and a DATAOUT line just three lines needed.

    So if you want to really minimize I/O you could do it in 3+3=6 lines (or even 3+2=5 lines with a shared CLOCK line).

    OR

    If you don't want to do serial shifting, you could define a 32b bus that is input/output.

    And then have a CLOCK and 3 MODE bits that say what is on the 32b bus.

    For example:

    MODEFUNCTIONI/Obus
    0load A on clockinput
    1load B on clockinput
    2display Aoutput
    3display Boutput
    4display A+Boutput

    So this would require 32 (or 33 for COUT) data bits and 4 control bits, for a total of 37 GPIOs.

5 Replies

  • _AK6DN_'s avatar
    _AK6DN_
    Icon for Frequent Contributor rankFrequent Contributor

    You need to use internal register(s) to store the values in A, B, and/or SUM.

    If you do that, you could load the input A, B registers with just two or three signals (CLOCK plus one or two DATA inputs).
    Serial shift in the data inputs using 32 (or 64) clocks on the DATA line(s).
    So just two or three pins.

    Then you have 33 outputs needed for SUM plus COUT.

    Total of 3 + 33 = 36 signals total, less than 40 with some spares...

    And if you want even fewer, you could store the SUM/COUT in a register and shift it out serially also.
    With a LOAD/SHIFT line, a CLOCK line, and a DATAOUT line just three lines needed.

    So if you want to really minimize I/O you could do it in 3+3=6 lines (or even 3+2=5 lines with a shared CLOCK line).

    OR

    If you don't want to do serial shifting, you could define a 32b bus that is input/output.

    And then have a CLOCK and 3 MODE bits that say what is on the 32b bus.

    For example:

    MODEFUNCTIONI/Obus
    0load A on clockinput
    1load B on clockinput
    2display Aoutput
    3display Boutput
    4display A+Boutput

    So this would require 32 (or 33 for COUT) data bits and 4 control bits, for a total of 37 GPIOs.

  • SyafieqS's avatar
    SyafieqS
    Icon for Super Contributor rankSuper Contributor

    Let me know if you are able to work on previous suggestion


  • SyafieqS's avatar
    SyafieqS
    Icon for Super Contributor rankSuper Contributor

    As we do not receive any response from you on the previous question/reply/answer that we have provided. Please login to ‘https://supporttickets.intel.com/’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.


    p/s: If any answer from community or Intel support are helpful, please feel free to mark as solution, give Kudos and rate 5/5 survey