From: erika_uk@my-deja.com Newsgroups: comp.arch.fpga Subject: can -(A+B) computed in one level of logic ? Date: Tue, 06 Feb 2001 15:30:29 GMT Organization: Deja.com Lines: 20 Message-ID: <95p5al$74q$1@nnrp1.deja.com> NNTP-Posting-Host: 143.117.60.33 X-Article-Creation-Date: Tue Feb 06 15:30:29 2001 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 95) X-Http-Proxy: 1.1 x64.deja.com:80 (Squid/1.1.22) for client 143.117.60.33 X-MyDeja-Info: XMYDJUIDerika_uk Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news.ifi.unizh.ch!news.imp.ch!nntp-out.monmouth.com!newspeer.monmouth.com!newsfeed.mathworks.com!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail Xref: chonsp.franklin.ch comp.arch.fpga:4413 hello, Say a parrallel arithmetic. Is it possible to compute -A-B in one bank of slice. yes, i know, i can compute A+B, the transmit the sign (-) later for the subsequent operator. As i can compute A+B (one bank of Slice), and feed the result to 2's Complement Negator ( another bank of Slice). but i want to know, is it possible that the operation -(A+B) consumes the same number of slices as A+B ... any input for serial arithmetic will more than appreciated Regards --Erika Sent via Deja.com http://www.deja.com/ ###### From: kolja@prowokulta.org Newsgroups: comp.arch.fpga Subject: Re: can -(A+B) computed in one level of logic ? Date: Tue, 06 Feb 2001 16:52:56 GMT Organization: Deja.com Lines: 42 Message-ID: <95pa52$bv1$1@nnrp1.deja.com> References: <95p5al$74q$1@nnrp1.deja.com> NNTP-Posting-Host: 213.23.52.225 X-Article-Creation-Date: Tue Feb 06 16:52:56 2001 GMT X-Http-User-Agent: Mozilla/4.7 [en] (Win98; I) X-Http-Proxy: 1.0 x51.deja.com:80 (Squid/1.1.22) for client 213.23.52.225 X-MyDeja-Info: XMYDJUIDsulimma Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news.ifi.unizh.ch!news.imp.ch!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail Xref: chonsp.franklin.ch comp.arch.fpga:4411 Yes. You need just one extra LUT. -A = (not A)+1 therefore -A-B = (-A) + (-B) = (not A) + (not B) + 2; So, you need to handle the first two bits seperately. With three luts you can determine sum(0), sum(1) and carry(1). Carry(1) is then fed into a (n-2)-bit adder with inverted inputs. CU, Kolja In article <95p5al$74q$1@nnrp1.deja.com>, erika_uk@my-deja.com wrote: > hello, > > Say a parrallel arithmetic. > Is it possible to compute -A-B in one bank of slice. > yes, i know, i can compute A+B, the transmit the sign (-) later for the > subsequent operator. As i can compute A+B (one bank of Slice), and feed > the result to 2's Complement Negator ( another bank of Slice). > > but i want to know, is it possible that the operation -(A+B) consumes > the same number of slices as A+B ... > > any input for serial arithmetic will more than appreciated > > Regards > > --Erika > > Sent via Deja.com > http://www.deja.com/ > Sent via Deja.com http://www.deja.com/ ###### From: "Daniel Lang" Newsgroups: comp.arch.fpga Subject: Re: can -(A+B) computed in one level of logic ? Date: Thu, 8 Feb 2001 17:07:41 -0800 Organization: Caltech Lines: 25 Message-ID: <95vg1h$18r@gap.cco.caltech.edu> References: <95p5al$74q$1@nnrp1.deja.com> <95pa52$bv1$1@nnrp1.deja.com> NNTP-Posting-Host: dhcp-97-128.caltech.edu X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!newsfeed-zh.ip-plus.net!news.ip-plus.net!news.tesion.net!news.belwue.de!informatik.tu-muenchen.de!comnets.rwth-aachen.de!news.rwth-aachen.de!news-koe1.dfn.de!news-was.dfn.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!logbridge.uoregon.edu!nntp-server.caltech.edu!news Xref: chonsp.franklin.ch comp.arch.fpga:4520 wrote in message news:95pa52$bv1$1@nnrp1.deja.com... > Yes. You need just one extra LUT. > > -A = (not A)+1 > therefore > > -A-B = (-A) + (-B) = (not A) + (not B) + 2; > > So, you need to handle the first two bits seperately. With three luts > you can determine sum(0), sum(1) and carry(1). Carry(1) is then fed > into a (n-2)-bit adder with inverted inputs. Let's consider the case A=B=0. If n=8, this give us (in binary) 11111111 + 11111111 + 10. The desired answer is 00000000 after dropping the msb carry bit. Processing the first two bits gives: Sum(0) = 0, Carry(0) = 1. Sum(1) = 0, Carry(1) = 2. You need two carry bits. Even if you process additional bits, you still need two carries. Daniel Lang