//----------------------------------------------------- // Design Name : gray_counter // File Name : gray_counter.v // Function : 8 bit gray counterS // Coder : Deepak Kumar Tala //----------------------------------------------------- module gray_counter ( out , // counter out enable , // enable for counter clk , // clock rst // active hight reset ); //------------Input Ports-------------- input clk, rst, enable; //----------Output Ports---------------- output [ 7:0] out; //------------Internal Variables-------- wire [7:0] out; reg [7:0] count; //-------------Code Starts Here--------- always @ (posedge clk) if (rst) count <= 0; else if (enable) count <= count + 1; assign out = { count[7], (count[7] ^ count[6]),(count[6] ^ count[5]),(count[5] ^ count[4]), (count[4] ^ count[3]),(count[3] ^ count[2]), (count[2] ^ count[1]),(count[1] ^ count[0]) }; endmodule clone of https://github.com/YosysHQ/yosys
aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/intel/cycloneive/arith_map.v
blob: 49e36aa25191638319590ad8f40be45ced30d502 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99