Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to do q <= d[count:0] in Verilog?

Status
Not open for further replies.

woeichee

Newbie level 5
Joined
Jan 17, 2010
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Malaysia
Activity points
1,348
in verilog, how to do like q <= d[count:0]?

reg [3:0] count;

thanks
 

Re: Verilog

reg [3:0] count;;
reg [15:0] q;
wire [15:0] d;

always @ (posedge clk or negedge rst_n)
begin
if (~rst_n)
q <= {16{1'b0}};
else
q<= d[count:0];
end

HTH,
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top