Академический Документы
Профессиональный Документы
Культура Документы
U22
D0
D1
S0
MUX2
En
This is a latch!
It is able to store a bit!
A latch is a memory
element.
U22
D0
D1
S0
MUX2
En
Y_bar
Q_bar
R_bar
An R-S latch!
En
--Latch
process (En,D)
begin
if (En=1) then
Q <= D;
end if;
end process;
Q
1.
2.
3.
<= D when:
En (0 1) regardless D
D and En=1
D and En=1
En has no effect
G
ILD
Q
6
FD
Its a flip-flop!
Usually the control signal of a FF is named
CLOCK and is abbreviated CLK:
process (Clk)
begin
if (Clk =1) then
Q <= D;
end if;
end process;
7
process (Clk)
begin
if (Clk =1) then Q <= D; end if;
end process;
Lets simulate!
First behavioral:
Its a Flip-flop!
Its a Latch!
The flip-flop
becomes a
latch!
9
Event:
Usually, the synthesis tool ignores the sensitivity list and
builds its own list consisting of all signals appearing
in the right side of an assignment, if conditions and
case selectors.
Consequently, there will be no difference between a Latch
description and a FF description.
We need a method to describe Flip-flops!
Solution:
Well use a member function for signal class called event.
signal a_signal : std_logic;
.....
In synthesis:
returns true if there is an event on
a_signal in the current simulation cycle. 10
a_signalevent
Event (cont):
a_signalevent
rising_edge(a_signal)
falling_edge(a_signal)
11
as well
Q <= D
only when Clk (0 1)
Clk, D, D are rejected
Latch description:
--Latch
process (En,D) -En,
begin
if (En=1) then
Q <= D;
end if;
end process;
12
Q <= D2;
end if;
end process;
No hardware counterpart!
13
No hardware counterpart!
14
recommended!
15
16
20