From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_MSGID, SUBJ_ALL_CAPS autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2e03bc978c29ea47 X-Google-Attributes: gid103376,public X-Google-Thread: 1089ad,2e03bc978c29ea47 X-Google-Attributes: gid1089ad,public From: "P. Cnudde VH14 (8218)" Subject: Re: ADA - VHDL Date: 1996/07/16 Message-ID: <31EB6230.284797A9@sh.bel.alcatel.be>#1/1 X-Deja-AN: 168488348 references: <31E2391F.A16BEBD@sh.bel.alcatel.be> <31ead866.2979882@news.smart.net> content-type: text/plain; charset=us-ascii organization: Alcatel Telecom mime-version: 1.0 newsgroups: comp.lang.ada,comp.lang.vhdl x-mailer: Mozilla 2.02 (X11; I; SunOS 4.1.3_U1 sun4m) Date: 1996-07-16T00:00:00+00:00 List-Id: Brian Cheebie Merchant wrote: > There are some extremely useful software construct which > simply do not translate well to hardware. (recursive structures is one > of these) I would disagree on the point of recursion. I try to make my function calls in VHDL recursive if it is possible. To my oppinion it generates far better hardware in general. An example: -- Calculate Parity bits function HasEvenParity(constant Argument : in bit_vector) return boolean is constant High : integer := Argument'high; constant Low : integer := Argument'low; constant Length : integer := Argument'length; begin if Length=1 then return not BitToBoolean(Argument(High)); else return (HasEvenParity(Argument(High downto (High+Low+1)/2)) = HasEvenParity(Argument((High+Low-1)/2 downto Low))); end if; end HasEvenParity; This generates a very efficient hardware realisation. In software on the other hand I would NOT use recursion here. (due to function call overhead). (Of course when you use recursion you must make sure that the recursion depth is fixed). Regards, -- ___________ Peter Cnudde _\ /_ Alcatel Bell Telephone \ \ALCATEL/ / Switching Systems Division \ \ BELL/ / Microelectronics Design Center \ \ / / \ \ / / F. Wellesplein 1, B-2018 Antwerp \ Y / BELGIUM \|/ e-mail : cnuddep@sh.bel.alcatel.be * Phone : (32/3) 240 82 18 Fax : (32/3) 240 99 47