Alexander S. wrote:
> with synchronous output.
What I say is: there is no need for a synchronous output when the
ongoing stages are synchronous. Syncing just adds latency, becasuse
syncing adds flipflops.
Alexander S. wrote:
> but my design
1 | PipeLine:
|
2 | process (ClockIn)
|
3 | begin
|
4 | if(ClockIn'event and ClockIn = '1') then
|
5 | case nResetIn is
|
6 | when '0' =>
|
7 | InputSignalF <= '0';
|
8 | InputSignalFf <= '0';
|
9 | nInputSignalF <= '1';
|
10 | nInputSignalFf <= '1';
|
11 | when others =>
|
12 | InputSignalF <= InputSignal ;
|
13 | InputSignalFf <= InputSignalf ;
|
14 | nInputSignalF <= not InputSignal ;
|
15 | nInputSignalFf <= nInputSignalF ;
|
16 | end case;
|
17 | end if;
|
18 | end process PipeLine;
|
19 |
|
20 | OutProcess:
|
21 | process(nClockIn)
|
22 | begin
|
23 | if (nClockIn'event and nClockIn = '1') then
|
24 | case nResetIn is
|
25 | when '0' =>
|
26 | RiseOutput <= '0';
|
27 | FallOutput <= '0';
|
28 | when others =>
|
29 | RiseOutput <= InputSignalF and ( not InputSignalFf );
|
30 | FallOutput <= nInputSignalF and ( not nInputSignalFf );
|
31 | end case;
|
32 | end if;
|
33 | end process OutProcess;
|
Your design has 2 shift register of each 2 bits length. One is for the
direct input signal and one for the inverted.
Your code does therefore the very same like that here:
1 | signal srp, srn : std_logic_vector (1 downto 0);
|
2 |
|
3 | process (nClockIn) begin
|
4 | if rising_edge(nClockIn) then
|
5 | -- sync in input signal
|
6 | srp <= srp(0) & InputSignal;
|
7 | srn <= srn(0) & (not InputSignal);
|
8 |
|
9 | -- check for edges
|
10 | FallOutput <= '1' when srp = "10" else '0';
|
11 | RiseOutput <= '1' when srn = "10" else '0';
|
12 | end if;
|
13 | end process;
|
And it can be shortened to this:
1 | signal sr : std_logic_vector (1 downto 0);
|
2 |
|
3 | process (nClockIn) begin
|
4 | if rising_edge(nClockIn) then
|
5 | -- sync in input signal
|
6 | sr <= sr(0) & InputSignal;
|
7 |
|
8 | -- check for edges
|
9 | FallOutput <= '1' when sr = "10" else '0';
|
10 | RiseOutput <= '1' when sr = "01" else '0';
|
11 | end if;
|
12 | end process;
|
> Excuse me
No problem. You do it your way, I do it mine. And be sure: I learn from
your code...