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.

Urgent! about barrel shifter, Thank you!

Status
Not open for further replies.

yangbay81983

Newbie level 4
Joined
Jun 20, 2008
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,315
16bits rotate left

can I write verilog like this:

rotate_left:
//Need 16 2-to-1mux to finish 1-bit shift left
if (!Cnt[0])
in_stage2[15:0] = In[15:0];
else
in_stage2[15:0] = {In[14:0],In[15]};
//Need 16 2-to-1mux to finish 2-bit shift left
if (!Cnt[1])
in_stage3[15:0] = in_stage2[15:0];
else
in_stage3[15:0] = {in_stage2[13:0],in_stage2[15:14]};
//Need 16 2-to-1mux to finish 4-bit shift left
if (!Cnt[2])
in_stage4[15:0] = in_stage3[15:0];
else
in_stage4[15:0] = {in_stage3[11:0],in_stage3[15:12]};
//Need 16 2-to-1mux to finish 8-bit shift left
if (!Cnt[3])
Out[15:0] = in_stage4[15:0];
else
Out[15:0] = {in_stage4[7:0],in_stage4[15:8]};

A lot of errors when compiling. Thank you
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top