URL
https://opencores.org/ocsvn/common/common/trunk
[/] [common/] [trunk/] [220_count4_example.v] - Blame information for rev 48
Details |
Compare with Previous |
View Log
| Line No. |
Rev |
Author |
Line |
| 1 |
14 |
bbeaver |
//------------------------------------------------------------------------
|
| 2 |
|
|
// Copyright (c) 1997 Altera Corporation, all right reserved
|
| 3 |
|
|
//
|
| 4 |
|
|
// This Verilog file may be copied and/or distributed at no cost as long as
|
| 5 |
|
|
// this copyright notice is retained.
|
| 6 |
|
|
//
|
| 7 |
|
|
//----------------------------------------------------------------
|
| 8 |
|
|
// Four-bit Loadable Up-Down Counter with synchronous set, load and clear
|
| 9 |
|
|
//----------------------------------------------------------------
|
| 10 |
|
|
// Version 1.0 Date 07/09/97
|
| 11 |
|
|
//----------------------------------------------------------------
|
| 12 |
|
|
//
|
| 13 |
|
|
|
| 14 |
|
|
`include "210model.v"
|
| 15 |
|
|
module count4 (q,
|
| 16 |
|
|
data, clock,
|
| 17 |
|
|
clk_en, cnt_en, updown,
|
| 18 |
|
|
sset, sclr, sload) ;
|
| 19 |
|
|
|
| 20 |
|
|
parameter lpm_width = 4 ;
|
| 21 |
|
|
|
| 22 |
|
|
output [lpm_width-1:0] q ;
|
| 23 |
|
|
input [lpm_width-1:0] data ;
|
| 24 |
|
|
input clock, clk_en, cnt_en, updown ;
|
| 25 |
|
|
input sset, sclr, sload ;
|
| 26 |
|
|
|
| 27 |
|
|
|
| 28 |
|
|
lpm_counter U1 (.q(q),
|
| 29 |
|
|
.data(data), .clock(clock),
|
| 30 |
|
|
.clk_en(clk_en), .cnt_en(cnt_en), .updown(updown),
|
| 31 |
|
|
.sset(sset), .sclr(sclr), .sload(sload)) ;
|
| 32 |
|
|
|
| 33 |
|
|
defparam U1.lpm_width=4;
|
| 34 |
|
|
|
| 35 |
|
|
endmodule
|
© copyright 1999-2026
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.