EmbDev.net

Forum: FPGA, VHDL & Verilog VHDL signal assigment


Author: MohseN (Guest)
Posted on:

Rate this post
0 useful
not useful
this is my question :
We can use a signal assignment statement with inertial delay to remove 
pulses that are smaller than a certain width. Using only signal 
assignment statements, write a code fragment for removing positive 
pulses that are greater than a certain width.
Thanks eveybody :)

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Real hardware oder simulation?

Author: MohseN (Guest)
Posted on:

Rate this post
0 useful
not useful
just simulation.

Author: Daniel R. (dan066)
Posted on:

Rate this post
0 useful
not useful
Maybe something like:
if input = '1' then
  output <= input after 100 ns;
end if;
or
 output <= input after 100 when input = '1' else '0';

: Edited by User
Author: Lothar Miller (lkmiller) (Moderator)
Posted on:
Attached files:

Rate this post
0 useful
not useful
MohseN wrote:
> We can use a signal assignment statement with inertial delay to remove
> pulses that are smaller than a certain width.
Thats fairly easy:
   o <= i after 100 ns;
   -- or
   o <= inertial i after 100 ns;
   -- or
   o <= i when i'stable(100 ns);
   -- or
   o <= i when i'quiet(100 ns);

> Using only signal assignment statements, write a code fragment for
> removing positive pulses that are greater than a certain width.
Thats a little more tricky. First this means, that all pulses must be 
delayed by this "width", because we cannot look into the future. So 
the first step will be to examine the transport arrtibutes of VHDL:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity Attribut is
    Port ( i : in  STD_LOGIC;
           o5 : out  STD_LOGIC := '0';
           o4 : out  STD_LOGIC := '0';
           o3 : out  STD_LOGIC := '0';
           o2 : out  STD_LOGIC := '0';
           o1 : out  STD_LOGIC := '0');
end Attribut;

architecture Behavioral of Attribut is
signal h : std_logic;
begin
   o1 <= i'delayed(100 ns);
   o2 <= i after(100 ns);
   o3 <= i when i'stable(100 ns);
   o4 <= i when i'quiet(100 ns);
   
   h  <= i after(100 ns);
   o5 <= i'delayed(100 ns) when h='0' else '0';
end Behavioral;
And with a closer view at o1 and o2 its easy to see, that those two 
together will lead to the goal. By using a helper signal the input is 
passed through only when the inertial delayed input is already low after 
100ns. As a result only high pulses shorter than 100ns will pass from i 
to o5...

: Edited by Moderator

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.