triggerd 16bit Counter - how can i reset a set register?

Status
Not open for further replies.

kollosse

Newbie level 3
Joined
Jul 29, 2003
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
25
trigger'd 16bit Counter

Hi,

how can i reset a set register?

The counter starts at the rising edge of clk1, then the counter counts up
to FFFFh and stops.

module counter
Title '16bit counter'
Declarations
clk pin 5;
clk1 pin 6;
count_en node istype 'reg';
d0 pin 24 istype 'reg';
d1 pin 25 istype 'reg';
d2 pin 26 istype 'reg';
d3 pin 27 istype 'reg';
d4 pin 28 istype 'reg';
d5 pin 29 istype 'reg';
d6 pin 33 istype 'reg';
d7 pin 34 istype 'reg';
d8 pin 35 istype 'reg';
d9 pin 36 istype 'reg';
d10 pin 37 istype 'reg';
d11 pin 38 istype 'reg';
d12 pin 39 istype 'reg';
d13 pin 40 istype 'reg';
d14 pin 42 istype 'reg';
d15 pin 43 istype 'reg';
test pin 44 istype 'reg';
a=[d15,d14,d13,d12,d11,d10,d9,d8,d7,d6,d5,d4,d3,d2,d1,d0];
Equations
count_en.CLK = clk1; //TRIGGER
a.CLK = clk & count_en; //ENABLE COUNTER clk
count_en := count_en.FB +1;
a := a.FB + 1; //counter +
when (a == ^Hffff) then
count_en := 0; // :?: :?: How can i reset the reg node :?: :?:
end counter
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…