Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Split bus notation in verilog

283 views
Skip to first unread message

rcg007

unread,
May 9, 2002, 9:15:17 PM5/9/02
to
Hi,
I have a design block which has input of 128 bits. A bus of 256 bits has to
be connected to this input by taking only the even bits or the odd bits. Is
there a way to represent this in verilog?

I am talking about a notation like this in Cadence
BUS[254:0:2]. Is there a similar representation in Verilog?

Thanks in advance,
-rcg007


John_H

unread,
May 9, 2002, 10:54:29 PM5/9/02
to
Do you want a registered mux?

reg [127:0] bus2block;
integer i;
always @(posedge clock)
for(i=0;i<128;i=i+1)
bus2block[i] <= odd_not_even ? in_bus[2*i+1] : in_bus[2*i];

Do you want a combinatorial mux?

reg [127:0] bus2block; // this is really a combinatorial value because
the always is unclocked
integer i;
always @(odd_not_even or in_bus)
for(i=0;i<128;i=i+1)
bus2block[i] = odd_not_even ? in_bus[2*i+1] : in_bus[2*i];

0 new messages