J
John_H
Guest
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
"Peter Alfke" <peter@xilinx.com> wrote in message
news:3F870649.447B1CA3@xilinx.com...
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.
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
"Peter Alfke" <peter@xilinx.com> wrote in message
news:3F870649.447B1CA3@xilinx.com...
John, just to be contrary:
Remember my suggestion of using a 4K x 4 dual-ported BlockROM. So it can
take 24 inputs and generate two 4-bit outputs that then have to be
combined externally. On two BlockROMs you can have 48 inputs and then
combine 4 sets of 4 inputs in one or two CLBs. Fast and simple, but
needs a trigger clock, since BlockROMs are synchronous.
Peter Alfke, Xilinx Applications
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.