help me with programming error plz

Status
Not open for further replies.

Parth Adroja

Newbie level 3
Joined
Nov 7, 2014
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
15

Code dot - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module assignment(Q,clk,rst);
input clk,rst;
output [2:0]Q;
always @(posedge clk)
begin
if(rst);
begin
Q<=3'b000;
end
else()
begin
case(Q)
3'b000: Q<=3'b001;
3'b001: Q<=3'b010;
3'b010: Q<=3'b100;
3'b100: Q<=3'b110;
default: Q<=3'b000;
endcase
end
end
endmodule




i'm getting this error in above program.
"near "else": syntax error, unexpected else"
can anyone help me?
thanks in advance
 
Last edited by a moderator:

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…