comp.lang.ada
 help / color / mirror / Atom feed
From: "P. Cnudde VH14 (8218)" <cnuddep@sh.bel.alcatel.be>
Subject: Re: ADA - VHDL
Date: 1996/07/16
Date: 1996-07-16T00:00:00+00:00	[thread overview]
Message-ID: <31EB6230.284797A9@sh.bel.alcatel.be> (raw)
In-Reply-To: 31ead866.2979882@news.smart.net


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




  parent reply	other threads:[~1996-07-16  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-09  0:00 ADA - VHDL P. Cnudde VH14 (8218)
1996-07-09  0:00 ` Jacques Rouillard
1996-07-10  0:00 ` Paul B. Graham
1996-07-10  0:00   ` Laurent Gasser
1996-07-11  0:00     ` P. Cnudde VH14 (8218)
1996-07-12  0:00       ` Paul B. Graham
1996-07-10  0:00   ` Robert Dewar
1996-07-11  0:00     ` Michael Feldman
1996-07-11  0:00 ` Robert Dewar
1996-07-15  0:00   ` Brian "Cheebie" Merchant
1996-07-16  0:00     ` jos de laender vh14 7461
1996-07-16  0:00     ` P. Cnudde VH14 (8218) [this message]
1996-07-16  0:00     ` Stephen A. Bailey
1996-07-22  0:00     ` Nick Weavers
1996-07-11  0:00 ` Jens Hansson
1996-07-11  0:00 ` Jean-Marc Bourguet
1996-07-12  0:00 ` Jean-Marc Bourguet
1996-07-13  0:00   ` Michael Feldman
1996-07-17  0:00 ` Chris Papademetrious
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox