VHDL signal assigment

Moderator (Company: Titel)
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:
1
   o <= i after 100 ns;
2
   -- or
3
   o <= inertial i after 100 ns;
4
   -- or
5
   o <= i when i'stable(100 ns);
6
   -- or
7
   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:
1
library IEEE;
2
use IEEE.STD_LOGIC_1164.ALL;
3

4
entity Attribut is
5
    Port ( i : in  STD_LOGIC;
6
           o5 : out  STD_LOGIC := '0';
7
           o4 : out  STD_LOGIC := '0';
8
           o3 : out  STD_LOGIC := '0';
9
           o2 : out  STD_LOGIC := '0';
10
           o1 : out  STD_LOGIC := '0');
11
end Attribut;
12

13
architecture Behavioral of Attribut is
14
signal h : std_logic;
15
begin
16
   o1 <= i'delayed(100 ns);
17
   o2 <= i after(100 ns);
18
   o3 <= i when i'stable(100 ns);
19
   o4 <= i when i'quiet(100 ns);
20
   
21
   h  <= i after(100 ns);
22
   o5 <= i'delayed(100 ns) when h='0' else '0';
23
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...
Attached files:

Reply

A question of your own? This thread is over 11 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.