Verilog Code

D

dcell

Could anyone look at my code here and tell me what the HELL is wrong
with it?

I keep getting an error complaining about endmodule. I'm about ready
to destroy something.

Thanks.

module barrel(data_in, shift, data_out) ;
input [3:0]data_in;
input [1:0]shift;
output [3:0]data_out;
reg [3:0]data_out;

always@(data_in or shift)

case(shift)
0: data_out <= data_in ;
1: data_out <= data_in*2 ;
2: data_out <= data_in*4 ;
3: data_out <= data_in*8 ;

endmodule
 
U

Uwe Bonnes

: Could anyone look at my code here and tell me what the HELL is wrong
: with it?

: I keep getting an error complaining about endmodule. I'm about ready
: to destroy something.

: Thanks.

: module barrel(data_in, shift, data_out) ;
: input [3:0]data_in;
: input [1:0]shift;
: output [3:0]data_out;
: reg [3:0]data_out;

: always@(data_in or shift)

: case(shift)
: 0: data_out <= data_in ;
: 1: data_out <= data_in*2 ;
: 2: data_out <= data_in*4 ;
: 3: data_out <= data_in*8 ;

: endmodule

You're missing the 'endcase' statement

Bye
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

verilog 0
sift-register 0
verilog questions 1
Verilog Binary Divider 2
Verilog Counter Question 2
newbie needs some helps.... 4
problem in verilog coding 0
Methods for flow control 1

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top