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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MODULE cntr2_16title '2 16 bit up/down/loadable/enabled/resetable counters'5"NOTE: reset is load & count_enab & dir.""NOTE: BIDIR pins are used for the load of each counter"DECLARATIONS10152025dir pin 1;load pin 2;count_enab pin 44;clk pin 43;ca15..ca0 pin 4,5,6,7,8,9,11,12,13,14,16,17,18,19,20,21 istype 'reg';cb15..cb0pin 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;303540455055ca.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{}END}else{}ca.d := ca.q + 1;cb.d := cb.q + 1;}else when (dir == 1) then{}ca.d = ca.q;cb.d = cb.q;ca.d := ca.q - 1;cb.d := cb.q - 1;Figure 2236

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

Saved successfully!

Ooh no, something went wrong!