Continue to Site

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.

VHDL to Verilog Problem !!!

Status
Not open for further replies.

angjohn

Junior Member level 2
Joined
Aug 29, 2004
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
272
is there any way to write if(clk' event and clk='0') (which is in VHDL) into Verilog. other than writing negedge or posedge in the always@()!!!
 

You don't need to do always @(negedge clk) ; all you need is
@ (negedge clk) ;

You use always where you would have used process in vhdl.
 

    angjohn

    Points: 2
    Helpful Answer Positive Rating
thanks for the reply but i wan to do following thing which is in VHDL into Verilog:

process (clk)

if (clk'event and clk =1)
q<='1';

else q<='0';


end process;

can anyone tell me how to modified the above code into verilog, please !!!
 

use XHDL by X tek
 

angjohn said:
thanks for the reply but i wan to do following thing which is in VHDL into Verilog:

process (clk)

if (clk'event and clk =1)
q<='1';

else q<='0';


end process;

can anyone tell me how to modified the above code into verilog, please !!!

Well well well .... you understand that your code does not make any good sence ..don't you ... q just follows the clk !!!! process will execute every time clk changes that is once at positive edge and again at negative edge and positvie edge you want q to go high and at negative edge you want to q to go low ... this would end up in q just equal to clk .. but if you just want to know this is how it gets translated ... I HOPE THIS IS FOR SIMULATION ONLY !!!!

//////////////////////////////////////////
always @ (clk)
begin
if (clk)
q = 1;
else
q= 0 ;
end
////////////////////////////////////////////
Or you could do it as
///////////////////////////////////////////
always
begin
@(posedge clk);
q = 1 ;
@ (negedge clk);
q = 0 ;
end
//////////////////////////////////////////
 

You should re-simulate the code after you translated it, especially for timing information!

it can not be synthesis!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top