Hit Logic

V

Vazquez

Guest
Hi,

I have a question concerning a possibility to find out whether
there is a hit or not (cache).

How can I check with few ressources need (Altera Cyclone device)
if there is one or more positions with '1'
within a 32bit-vector (in this case a signal hit='1'
should be the result)?

Thank you very much for your help.


Kind regards
Andrés Vázquez
G&D System Development
 
"Vazquez" <andres.vazquez@gmx.de> wrote in message
news:eee19a7a.0310300536.40db93bb@posting.google.com...

How can I check with few ressources need (Altera Cyclone device)
if there is one or more positions with '1'
within a 32bit-vector (in this case a signal hit='1'
should be the result)?
It should be OK simply to write the obvious VHDL or Verilog:

.....

reg [31:0] hits;
wire hit;
assign hit = (hits != 0);

.....

hit <= '1' when hits = (hits'range => '0') else '0';

.....

Most synthesis tools will make a fair job of
constructing a nice tree of OR gates from this code,
or else use the carry-chain logic if that can be done.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail: jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 

Welcome to EDABoard.com

Sponsor

Back
Top