Beruflich Dokumente
Kultur Dokumente
0
0
d
0
1
qn
0
1
1 l i b r a r y IEEE ;
2 use IEEE . STD_LOGIC_1164 .ALL;
3
4 entity f l i p _ f l o p _ j k i s
5
port (
6
c l k : in s t d _ l o g i c ;
7
j
: in s t d _ l o g i c ;
8
k : in s t d _ l o g i c ;
9
e : in s t d _ l o g i c ;
10
q : out s t d _ l o g i c
11
);
12 end entity f l i p _ f l o p _ j k ;
1
c l o c k do s i s t e m a
entrada " s e t "
entrada " r e s e t "
habilita o flip flop
saida
qn1
0
1
X
X
0
1
J
0
0
0
1
1
1
K
0
0
1
0
1
1
q
0
1
0
1
1
0
Table 2: Flip flop JK. Valores mudam apenas na borda de subida do clock e
quando o flip-flop est habilitado. qn1 o estado anterior de q.
13
14 architecture arq_jk_comportamental of f l i p _ f l o p _ j k i s
15 begin
16
process ( c l k ) i s e x e c u t a quando o c l o c k mudar de v a l o r
17
begin
18
i f r i s i n g _ e d g e ( c l k ) then r i s i n g _ e d g e ( ) " 1 " s na borda de s u b i d a
19
i f ( e = 1 ) then
20
i f ( j = 1 and k = 0 ) then " s e t " , j o g a a s a d a para 1
21
q <= 1 ;
22
e l s i f ( j = 0 and k = 1 ) then " r e s e t " , j o g a a s a d a para 0
23
q <= 0 ;
24
e l s i f ( j = 1 and k = 1 ) then " t o g g l e " , t r o c a o v a l o r da s a
25
i f ( q = 1 ) then
26
q <= 0 ;
27
else
28
q <= 1 ;
29
end i f ;
30
end i f ;
31
end i f ;
32
end i f ;
33
end process ;
34 end architecture arq_jk_comportamental ;
1
2
3
4
5
6
7
8
9
l i b r a r y IEEE ;
use IEEE . STD_LOGIC_1164 .ALL;
entity f l i p _ f l o p _ t i s
port (
c l k : in s t d _ l o g i c ;
t : in s t d _ l o g i c ;
e : in s t d _ l o g i c ;
q : out s t d _ l o g i c
c l o c k do s i s t e m a
" t o g g l e " , t r o c a o v a l o r da s a d a
habilita o flip flop
saida
qn1
0
1
0
1
T
0
0
1
1
q
0
1
1
0
Table 3: Flip flop JK. Valores mudam apenas na borda de subida do clock e
quando o flip-flop est habilitado. qn1 o estado anterior de q.
10
);
11 end entity f l i p _ f l o p _ t ;
12
13 architecture arq_t_comportamental of f l i p _ f l o p _ t i s
14 begin
15
process ( c l k ) i s e x e c u t a quando o c l o c k mudar de v a l o r
16
begin
17
i f r i s i n g _ e d g e ( c l k ) then r i s i n g _ e d g e ( ) " 1 " s na borda de s u b i d a
18
i f ( e = 1 ) then
19
i f ( t = 1 ) then " t o g g l e " , t r o c a o v a l o r da s a d a
20
i f ( q = 1 ) then
21
q <= 0 ;
22
else
23
q <= 1 ;
24
end i f ;
25
end i f ;
26
end i f ;
27
end i f ;
28
end process ;
29 end architecture arq_jk_comportamental ;