Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - full adder example using fpga

 
Thread Tools Search this Thread
Old 12-10-2007, 02:34 AM   #1
Default full adder example using fpga



Hello group,

Does anybody know about an online resource that I can find some
samples on how to implement a full adder using LUT? either using
Flex10k or any other classical methods?

I've started learning FPGA and have done something but need to compare
it.

Regards,
Amit



Amit
  Reply With Quote
Old 12-10-2007, 02:05 PM   #2
KJ
 
Posts: n/a
Default Re: full adder example using fpga
On Dec 9, 9:34 pm, Amit <amit.ko...@gmail.com> wrote:
> Hello group,
>
> Does anybody know about an online resource that I can find some
> samples on how to implement a full adder using LUT?


Google lists about 19000

http://www.google.com/search?hl=en&q=VHDL+full+adder

KJ


KJ
  Reply With Quote
Old 12-11-2007, 03:01 PM   #3
Ralf Hildebrandt
 
Posts: n/a
Default Re: full adder example using fpga
Amit schrieb:

> Does anybody know about an online resource that I can find some
> samples on how to implement a full adder using LUT? either using
> Flex10k or any other classical methods?


Usually you don't need to think about every single fulladder. Just use
result<=a+b; -- all signals are vectors of type signed or unsigned

For a single fulladder you could use:

signal result : unsigned(1 downto 0);
signal a,b,c_in : std_ulogic;
signal sum,c_out : std_ulogic;

result<=unsigned('0' & a) + unsigned('0' & b) + unsigned('0' & c_in);
sum<=result(0);
c_out<=result(1);


Ralf


Ralf Hildebrandt
  Reply With Quote
Old 12-12-2007, 03:28 PM   #4
Andy
 
Posts: n/a
Default Re: full adder example using fpga
On Dec 11, 9:01 am, Ralf Hildebrandt <Ralf-Hildebra...@gmx.de> wrote:
> Amit schrieb:
>
> > Does anybody know about an online resource that I can find some
> > samples on how to implement a full adder using LUT? either using
> > Flex10k or any other classical methods?

>
> Usually you don't need to think about every single fulladder. Just use
> result<=a+b; -- all signals are vectors of type signed or unsigned
>
> For a single fulladder you could use:
>
> signal result : unsigned(1 downto 0);
> signal a,b,c_in : std_ulogic;
> signal sum,c_out : std_ulogic;
>
> result<=unsigned('0' & a) + unsigned('0' & b) + unsigned('0' & c_in);
> sum<=result(0);
> c_out<=result(1);
>
> Ralf


It's even easier with integers:

signal a,b,sum,c_in,c_out : integer range 0 to 1;

sum <= (a + b + c_in) mod 2;
c_out <= (a + b + c_in) / 2;

Andy


Andy
  Reply With Quote
Old 12-12-2007, 05:44 PM   #5
Mike Treseler
 
Posts: n/a
Default Re: full adder example using fpga
Andy wrote:

> It's even easier with integers:



Easier still, if I let synthesis wire up the carries

-- Mike Treseler


Mike Treseler
  Reply With Quote
Old 12-12-2007, 07:59 PM   #6
Amit
 
Posts: n/a
Default Re: full adder example using fpga
On Dec 12, 9:44 am, Mike Treseler <mike_trese...@comcast.net> wrote:
> Andy wrote:
> > It's even easier with integers:

>
> Easier still, if I let synthesis wire up the carries
>
> -- Mike Treseler


Thanks to all,

But maybe I didn't ask the question properly or I had to post in a
different group (I'm sure doesn't exist). My concern is not regarding
VHDL sytnax but trying to understand how to tacking the flow on a
Flex10K diagram.

I apologize all for this.

However, if somebody knows this I will be more than happy to have your
help.

Regards,
Amit


Amit
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46