Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21332 Discussions

How can I translated VHDL to Verilog HDL.

Altera_Forum
Honored Contributor II
1,314 Views

How can I translated VHDL to Verilog HDL.  

The problem is how can I deal with the posedge and negedge with the same signal. 

 

process(Timer) begin if Timer'event and Timer='1' then --Timer rising edge. trise<='1'; start = 1; elsif Timer'event and Timer='0' then --Timer falling edge. trise<='0'; hold = 1; end if; end process;
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
432 Views

Try this: 

 

always @(Timer) 

begin 

if (Timer) 

begin 

trise = 1; 

start = 1; 

end 

else 

begin 

trise = 0; 

hold = 1; 

end 

end 

Of course, this is not synthesizable but should work in simulation. 

 

Regards, 

Harald
0 Kudos
Altera_Forum
Honored Contributor II
432 Views

 

--- Quote Start ---  

Try this: 

 

always @(Timer) 

begin 

if (Timer) 

begin 

trise = 1; 

start = 1; 

end 

else 

begin 

trise = 0; 

hold = 1; 

end 

end 

Of course, this is not synthesizable but should work in simulation. 

 

Regards, 

Harald 

--- Quote End ---  

 

 

Thanx, Harald, it seems better than what I think! :)
0 Kudos
Reply