1 //-----------------------------------------------------
2 // Design Name : gray_counter
3 // File Name : gray_counter.v
4 // Function : 8 bit gray counterS
5 // Coder : Deepak Kumar Tala
6 //-----------------------------------------------------
9 enable , // enable for counter
11 rst // active hight reset
14 //------------Input Ports--------------
15 input clk, rst, enable;
16 //----------Output Ports----------------
18 //------------Internal Variables--------
21 //-------------Code Starts Here---------
22 always @ (posedge clk)
28 assign out = { count[7], (count[7] ^ count[6]),(count[6] ^
29 count[5]),(count[5] ^ count[4]), (count[4] ^
30 count[3]),(count[3] ^ count[2]), (count[2] ^
31 count[1]),(count[1] ^ count[0]) };