|
您要的是 ASYNC. LOAD/CLEAR ? 如果是建議如下:) b# t7 p& [$ T8 A. z/ e
process(PCclr, PCinc, PCld, PCin)) k! L/ G, [: w: { t2 @
begin; r8 G7 d+ a. O9 a
if ( PCclr='1' or PCld ='1')then
) \9 N t& w3 \+ c2 Q if( PCclr = '1')then -- ASYNC. clear# \; O* H! y k6 ~. o
tmp_PC <= "0000000000000000";5 ^; C8 v, G' d. Z+ a4 L8 ~
else -- ASYNC. load
- `) o* v$ m' L. z v tmp_PC <= PCin;
& e# G0 \: a d* S) z end if;5 L! k$ X: L! M( l& E5 E
elsif (PCinc'event and PCinc = '1') then
$ C7 _" k" C# G! I7 _" Z) X+ h5 N tmp_PC <= tmp_PC + 1;) U: Q: g7 v0 G8 P* `) M9 @
end if;/ ]: B. c, o* N
end process;
, e5 ~/ s. q/ U/ ?如要的是 SYNC. LOAD / ASYNC. CLEAR 建議如下:2 W8 R/ s4 q' N4 S* t
process(PCclr, PCinc, PCld, PCin)4 g" L. D0 B) A$ N8 I8 i' J- h
begin) _1 v) p3 k u) r3 u# x
if ( PCclr='1')then
% ?! t! r" b/ R; x, K tmp_PC <= "0000000000000000";5 U9 `' W9 [3 n7 w# u- U
elsif (PCinc'event and PCinc = '1') then
% A! m" I! M4 u1 [0 p) Q if( PCld = '1') then -- SYNC. load/ h8 y' `/ o. ~# z: e
tmp_PC <= PCin;
" z4 W4 v, b8 } else -- upcount
Z3 h# Z; Q4 e- Y tmp_PC <= tmp_PC + 1;
1 A+ h, a2 |5 P end if;/ |- r- l- b* N3 k* d4 A
end if;# w& j: A4 d6 e- t
end process; |
評分
-
查看全部評分
|