全文预览

SOPC课程设计实验报告

上传者:火锅鸡 |  格式:docx  |  页数:20 |  大小:132KB

文档介绍
NTEGER RANGE 0 TO 140; SIGNAL COUNTER1:INTEGER RANGE 0 TO 3; SIGNAL COUNTER2:INTEGER RANGE 1 TO 10000000; SIGNAL DIGIT :STD_LOGIC_VECTOR(6 DOWNTO 0); SIGNAL COUNT :STD_LOGIC_VECTOR(1 DOWNTO 0); SIGNAL CARRIER,CLK_4MHZ,CLK_4HZ:STD_LOGIC; BEGIN PROCESS(CLK) BEGIN IF CLK'EVENT AND CLK='1' THEN IF COUNTER1=1 THEN CLK_4MHZ<='1'; COUNTER1<=2; ELSIF COUNTER1=3 THEN CLK_4MHZ<='0'; COUNTER1<=0; ELSE COUNTER1<=COUNTER1+1; END IF; IF COUNTER2=5000000 THEN CLK_4HZ<='1'; COUNTER2<=5000001; ELSIF COUNTER2=10000000 THEN CLK_4HZ<='0'; COUNTER2<=1; ELSE COUNTER2<=COUNTER2+1; END IF; END IF; END PROCESS; PROCESS(CLK_4MHZ) BEGIN IF CLK_4MHZ'EVENT AND CLK_4MHZ='1' THEN IF DRIVER="1111111111111"THEN CARRIER<='1'; DRIVER<=ORIGIN; ELSE DRIVER<=DRIVER+1; CARRIER<='0'; END IF; END IF; END PROCESS; PROCESS(CARRIER)

收藏

分享

举报
下载此文档