Answers Database


XPLA Professional: Implementing a latch in a CoolRunner?


Record #7523

Product Family: Software

Product Line: CoolRunner

Product Part: XPLA Fitter

Problem Title:
XPLA Professional: Implementing a latch in a CoolRunner?


Problem Description:
Urgency: Hot

General Description: How do I implement a latch since latches are not
directly supported by the CoolRunner?


Solution 1:

See the below PHDL examples for two types of latches. The first is
a latch that implements an asynchronous set and an asynchronous
reset. The second does not implement the set or reset function.

MODULE	latch1
TITLE	'Latch with Asynchronous Set and Reset'

DECLARATIONS

set,reset,enable,d pin ;
q pin istype 'com' ;

EQUATIONS

q = !reset & (set # (enable & d # !enable & q.com # d & q.com)) ;

END





MODULE	latch2
TITLE	'Latch'

DECLARATIONS

d7..d0 pin ;
enable pin ;
q7..q0 pin istype 'com,retain' ;

d = [d7..d0] ;
q = [q7..q0] ;

EQUATIONS

q = (enable & d) # (!enable & q.com) # (d & q.com) ;

END




End of Record #7523 - Last Modified: 10/11/99 17:45

For the latest news, design tips, and patch information on the Xilinx design environment, check out the Technical Tips!