sotomie
Newbie level 6
- Joined
- Apr 5, 2013
- Messages
- 13
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,376
can anyone please tell me if there is any logical error is this always block,its for fibonacci series ,i'm getting my results right but i was just curious if i've done something which isn't correct like using two 'if's?
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 always@(posedge clock) begin if(n==0) current=1; else begin temp=current; current=current+previous; previous=temp; end if(current<previous) begin previous=0; n=0; current=1; end n=n+1; end endmodule
Last edited by a moderator: