阅读:933回复:0
帮我看看这个程序??CP2为1M的方波,SAVEBUFX3、SAVEBUFY、SAVEBUFX 为16位的SIGNAL; PROCESS(CP2) --X BEGIN IF CP2\' EVENT AND CP2=\'1\' THEN IF SAVEBUFX1/=“0000000000000000” THEN SAVEBUFX1〈=SAVEBUFX1-1; --SAVEBUFX1初值10000; SINX1〈=‘1’; ELSE SINX1〈=‘0’; END IF; XXX<=NOT XXX; END IF; END PROCESS; PROCESS(CP2) --Y BEGIN IF CP2\' EVENT AND CP2=\'1\' THEN SAVEBUFX3<=SAVEBUFX3+1000; IF SAVEBUFX3>=10000 THEN SAVEBUFX3<=SAVEBUFX3-10000; YYY<=NOT YYY; IF SAVEBUFY1/=“0000000000000000” THEN SAVEBUFY1〈=SAVEBUFY1-1; --SAVEBUFY1初值1000; SINY1〈=‘1’; ELSE SINY1〈=‘0’; END IF; END IF; END IF; END PROCESS; PLUSEX<=XXX WHEN SINX1=‘1’ ELSE ‘0’; --输出方波X 10000 PLUSEY<=YYY WHEN SINY1=‘1’ ELSE ‘0’; --输出方波Y 1000 脉冲数没有问题,但是不同步,为什么?? 这个程序有没有问题?? |
|