1 //-----------------------------------------------------
2 // Design Name : one_hot_cnt
3 // File Name : one_hot_cnt.v
4 // Function : 8 bit one hot counter
5 // Coder : Deepak Kumar Tala
6 //-----------------------------------------------------
8 out , // Output of the counter
9 enable , // enable for counter
13 //----------Output Ports--------------
16 //------------Input Ports--------------
17 input enable, clk, reset;
19 //------------Internal Variables--------
22 //-------------Code Starts Here-------
23 always @ (posedge clk)
26 end else if (enable) begin
27 out <= {out[6],out[5],out[4],out[3],
28 out[2],out[1],out[0],out[7]};