Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me with writing a VHDL code

Status
Not open for further replies.

voho

Full Member level 2
Joined
Feb 24, 2004
Messages
121
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,298
Location
Nador City
Activity points
852
help in vhdl

Hi all,


How to do this in vhdl ? Event is input signal


event___ ____________ ____________ ____________ _____
| | | | | | | |
|__ | |__| |__| |__|


V1______ _____________________________________________________
| |
|__|



V2______________________ _____________________________________
| |
|__|


V3______________________________________ _____________________
| |
|__|

V4______________________________________________________ _____
| |
|__|
Thank's in advance

Regards
 

EDALIST

Full Member level 2
Joined
Nov 27, 2004
Messages
131
Helped
12
Reputation
24
Reaction score
0
Trophy points
1,296
Activity points
992
Re: help in vhdl

can you just explain what are you trying to do, the diagram drawing is ver unclear ?
 

foy

Newbie level 5
Joined
Nov 8, 2005
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,327
help in vhdl

do you want to do what ?
 

tkbits

Full Member level 5
Joined
Dec 4, 2004
Messages
242
Helped
39
Reputation
78
Reaction score
2
Trophy points
1,298
Activity points
2,209
Re: help in vhdl

And what happens after V4?
Do you repeat from the start?

voho said:
How to do this in vhdl ? Event is input signal

Code:
event___      ____________     ____________     ____________     _____
	     |     |		       |    |		         |    |		           |   |
	     |__ |		      |__|		      |__|		      |__|


V1______     _____________________________________________________
	      |    |
	      |__|



V2______________________    _____________________________________
			                  |   |
			                  |__|
	

V3______________________________________     _____________________
					                              |    |
					                              |__|

V4______________________________________________________     _____
							                                          |   |
							                                          |__|
 

maksya

Full Member level 3
Joined
Jun 2, 2005
Messages
151
Helped
16
Reputation
32
Reaction score
3
Trophy points
1,298
Activity points
2,256
help in vhdl

I think that the algorithm is something like that:

For every rising edge of event signal we will have to increment a coutner (0,1,2,3,0,1...). The counter's output is the address input of the demultiplexer. And the input of demultiplexer is the event.

voho, Is it so?
 

voho

Full Member level 2
Joined
Feb 24, 2004
Messages
121
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,298
Location
Nador City
Activity points
852
Re: help in vhdl

thank'a all for your help,

I want to do this in first event i generate event (pulse)in V1, second event i generate event inV2, third event i generate event in V3

regards
 

sp_harikrish

Junior Member level 2
Joined
Mar 29, 2006
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,412
Re: help in vhdl

Hi,
it looks like a shifted signal on each rising edge of the clock.
you can use shift register in this case.
 

nand_gates

Advanced Member level 3
Joined
Jul 19, 2004
Messages
892
Helped
175
Reputation
350
Reaction score
51
Trophy points
1,308
Activity points
6,830
Re: help in vhdl

Checkout the code below!
Hope this helps!

Code:
library ieee;
use ieee.std_logic_1164.all;

entity sequncer is
  
  port (
    event : in  std_logic;
    rst   : in  std_logic;
    v1    : out std_logic;
    v2    : out std_logic;
    v3    : out std_logic;
    v4    : out std_logic);

end sequncer;

architecture behave of sequncer is
signal shift_pos : std_logic_vector(3 downto 0);
signal shift_neg : std_logic_vector(3 downto 0);

begin  -- behave
  v1 <= not shift_pos(0) or shift_neg(0);
  v2 <= not shift_pos(1) or shift_neg(1);
  v3 <= not shift_pos(2) or shift_neg(2);
  v4 <= not shift_pos(3) or shift_neg(3);
  
positve_edge: process (event, rst)
begin  -- process positve-edge
  if rst = '0' then                     -- asynchronous reset (active low)
    shift_pos <= (others => '0')
  elsif event'event and event = '1' then  -- rising clock edge
    shift_pos <= shift_pos(2 downto 0)&shift_pos(3);
  end if;
end process positve_edge;

neg_edge: process (event, rst)
begin  -- process neg_edge
  if rst = '0' then                     -- asynchronous reset (active low)
    shift_neg <= (others => '1')
  elsif event'event and event = '0' then  -- rising clock edge
    shift_neg(0) <= shift_neg(2 downto 0)& shift_neg(3);
  end if;
end process neg_edge;
  

end behave;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top