URL
https://opencores.org/ocsvn/rtf68ksys/rtf68ksys/trunk
Details |
Compare with Previous |
View Log
| Line No. |
Rev |
Author |
Line |
| 1 |
2 |
robfinch |
// ============================================================================
|
| 2 |
|
|
// 2007 Robert Finch
|
| 3 |
|
|
// robfinch@<remove>sympatico.ca
|
| 4 |
|
|
//
|
| 5 |
|
|
// VT163 - 74LS163 counter
|
| 6 |
|
|
//
|
| 7 |
|
|
//
|
| 8 |
|
|
// This source file is free software: you can redistribute it and/or modify
|
| 9 |
|
|
// it under the terms of the GNU Lesser General Public License as published
|
| 10 |
|
|
// by the Free Software Foundation, either version 3 of the License, or
|
| 11 |
|
|
// (at your option) any later version.
|
| 12 |
|
|
//
|
| 13 |
|
|
// This source file is distributed in the hope that it will be useful,
|
| 14 |
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 15 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 16 |
|
|
// GNU General Public License for more details.
|
| 17 |
|
|
//
|
| 18 |
|
|
// You should have received a copy of the GNU General Public License
|
| 19 |
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 20 |
|
|
//
|
| 21 |
|
|
// ============================================================================
|
| 22 |
|
|
//
|
| 23 |
|
|
// Webpack 9.1i xc3s1000-4ft256
|
| 24 |
|
|
// 4 slices / 8 LUTs / 324.675 MHz
|
| 25 |
|
|
|
| 26 |
|
|
module VT163(clk, clr_n, ent, enp, ld_n, d, q, rco);
|
| 27 |
|
|
parameter WID=4;
|
| 28 |
|
|
input clk;
|
| 29 |
|
|
input clr_n; // clear active low
|
| 30 |
|
|
input ent; // clock enable
|
| 31 |
|
|
input enp; // clock enable
|
| 32 |
|
|
input ld_n; // load active low
|
| 33 |
|
|
input [WID:1] d;
|
| 34 |
|
|
output [WID:1] q;
|
| 35 |
|
|
reg [WID:1] q;
|
| 36 |
|
|
output rco;
|
| 37 |
|
|
|
| 38 |
|
|
assign rco = &{q[WID:1],ent};
|
| 39 |
|
|
|
| 40 |
|
|
always @(posedge clk)
|
| 41 |
|
|
begin
|
| 42 |
|
|
if (!clr_n)
|
| 43 |
|
|
q <= {WID{1'b0}};
|
| 44 |
|
|
else if (!ld_n)
|
| 45 |
|
|
q <= d;
|
| 46 |
|
|
else if (enp & ent)
|
| 47 |
|
|
q <= q + {{WID-1{1'b0}},1'b1};
|
| 48 |
|
|
end
|
| 49 |
|
|
|
| 50 |
|
|
endmodule
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.