13.07.2015 Views

XPLA Designer v2.1 User's Manual

XPLA Designer v2.1 User's Manual

XPLA Designer v2.1 User's Manual

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Dual 16-Bit Up/Down/Loadable/Enabled/Resetable Counters'MODULE cntr2_16title '2 16 bit up/down/loadable/enabled/resetable counters'"NOTE: reset is load & count_enab & dir.""NOTE: BIDIR pins are used for the load of each counter"DECLARATIONSdir pin 1;load pin 2;count_enab pin 44;clk pin 43;ca15..ca0cb15..cb0pin 4,5,6,7,8,9,11,12,13,14,16,17,18,19,20,21 istype 'reg';pin 41,40,39,38,37,36,34,33,32,31,29,28,27,26,25,24 istype 'reg';ca = [ca15..ca0];cb = [cb15..cb0];EQUATIONSca.clk = clk;cb.clk = clk;ca.ar = load & count_enab & dir;cb.ar = load & count_enab & dir;ca.oe = !load;cb.oe = !load;when (load == 1) then{ca.d := ca.pin;cb.d := cb.pin;}else{when (count_enab == 1) then{when (dir == 0) then{ca.d := ca.q + 1;cb.d := cb.q + 1;}182

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!