Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VHDL code, what's wrong

Status
Not open for further replies.

Howard123

Technical User
Jan 27, 2008
2
US
Hello,
The following code comes from the Altera web site. It indicates the implementation is incorrect. It seems to simulate OK. Can anyone tell me what's wrong with it?

ENTITY dff IS
PORT(
enable : IN BIT;
d, clk : IN BIT;
q : OUT BIT
);
END dff;

ARCHITECTURE maxpld OF dff IS
BEGIN
-- The following implementation is incorrect.
PROCESS(clk)
BEGIN
IF (clk'event AND clk = '1') THEN
IF (enable = '1' ) THEN
q <= d;
END IF;
END IF;
END PROCESS;
END maxpld;

Howard123
 
According to Altera's website:
"The section that is commented out uses the same logic, except the IF enable statement is switched. The commented section will not synthesize correctly in MAX+PLUS II because the enable input will feed both the enable on the flipflop and added combinatorial logic that then feeds the D input."

I don't have any idea about this. :(
Perhaps you should try to synthesize it on Quartus, since the website explicitly says that "...will not synthesize correctly in MAX+PLUS II".

Best regards,

jmxntg
 
Thanks jmxntg,

It sounds like the code is OK, it's just the way it's simulated on Max Plus. I have tried Quartus II and the code simulates OK. Thanks again.

Howard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top