Peter's: solution for 48 bits: 2 BlockRAMs, 16 LUTs BlockRAM tcko + 2 levels carry chain John's solution for 30 bits: Resources: 46 LUTs (giving him 1 LUT per CYAdd bit) Delay: 2 levels LUTs + 3 levels carry chain John_H's solution for 31 bits (mine, at end): Resources: 41 LUTs Delay: 3 levels LUTs + 2 levels carry chain
See original post for John's earlier comments as well as my own. In John's form of ASCII art is the 3-input LUT form of a 31 bit adder that won't work for 32 bits wihtout adding a bit of extra junk but is a more common need.
- John_H
___
0-| F | ___ 0-| A |-1-----1-| |-2-----+ 0-|_3_|-0-----0-| * |-1---+ | ___ +---1-| |-0-+ | | 0-| F | | +-0-|___| | | | 0-| A |-1-+ | | | | | 0-|_3_|-0---+ 0 | | | ___ 0-----------------+ | | +-2-| C | ___ | +---1-| Y |-3-------+ 0-| F | ___ +-----0-| A |-2-----+ | 0-| A |-1-----1-| |-2-------2-| d |-1---+ | | 0-|_3_|-0-----0-| * |-1-------1-| d |-0-+ | | | ___ +---1-| |-0-------0-|___| | | | | 0-| F | | +-0-|___| | | | | | 0-| A |-1-+ | | 0 | | | | 0-|_3_|-0---+ 0 | | | | | 0-----------------+ | | | | | 0---------------------------------+ | | | | ___ | | | | 0-| F | ___ | | | | 0-| A |-1-----1-| |-2-----+ | | | | 0-|_3_|-0-----0-| * |-1---+ | | | | | ___ +---1-| |-0-+ | | | | | | ___ 0-| F | | +-0-|___| | | | | | | +-3-| | 0-| A |-1-+ | | | | | | | +---2-| C |-4 0-|_3_|-0---+ 0 | | | ___ | +-----1-| Y |-3 0-----------------+ | | +-2-| C | +-------0-| A |-2 ___ | +---1-| Y |-3---------3-| d |-1 0-| F | ___ +-----0-| A |-2---------2-| d |-0 0-| A |-1-----1-| |-2-------2-| d |-1---------1-| | 0-|_3_|-0-----0-| * |-1-------1-| d |-0---------0-|___| ___ +---1-| |-0-------0-|___| | 0-| F | | +-0-|___| | 0 0-| A |-1-+ | | 0 | 0-|_3_|-0---+ 0 | | 0-----------------+ | | 0---------------------------------+ | 0---------------------------------------------------+LUT count: 16 12 8 5 = 41
- The 2bit+2bit+1bit LUTS (0-7 result) are implemented as 3 levelsof logic implemented with 3-input LUTs.