ch09.2.htm

来自「介绍asci设计的一本书」· HTM 代码 · 共 3,048 行 · 第 1/5 页

HTM
3,048
字号
	ABEL</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableFirst">

<A NAME="pgfId=30769">

 </A>

	CUPL</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="Computer">

<A NAME="pgfId=30771">

 </A>

device_id device 'P2500B';</P>

<P CLASS="Computer">

<A NAME="pgfId=30772">

 </A>

&quot;device_id used for JEDEC filename</P>

<P CLASS="Computer">

<A NAME="pgfId=30773">

 </A>

I1,I2,I3,I17,I18 pin 1,2,3,17,18;</P>

<P CLASS="Computer">

<A NAME="pgfId=30774">

 </A>

O4,O5 pin 4,5 istype 'reg_d,buffer';</P>

<P CLASS="Computer">

<A NAME="pgfId=30775">

 </A>

O6,O7 pin 6,7 istype 'com';</P>

<P CLASS="Computer">

<A NAME="pgfId=30776">

 </A>

O4Q2,O7Q2 node 41,44 istype 'reg_d';</P>

<P CLASS="Computer">

<A NAME="pgfId=30777">

 </A>

O6F2 node 43 istype 'com';</P>

<P CLASS="Computer">

<A NAME="pgfId=30778">

 </A>

O7Q1 node 220 istype 'reg_d';</P>

<P CLASS="Computer">

<A NAME="pgfId=30779">

 </A>

&nbsp;</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="Computer">

<A NAME="pgfId=30781">

 </A>

device V2500B;</P>

<P CLASS="Computer">

<A NAME="pgfId=30782">

 </A>

pin [1,2,3,17,18] = [I1,I2,I3,I17,I18];</P>

<P CLASS="Computer">

<A NAME="pgfId=30783">

 </A>

pin [7,6,5,4] = [O7,O6,O5,O4];</P>

<P CLASS="Computer">

<A NAME="pgfId=30784">

 </A>

pinnode [41,65,44] = [O4Q2,O4Q1,O7Q2];</P>

<P CLASS="Computer">

<A NAME="pgfId=30785">

 </A>

pinnode [43,68] = [O6Q2,O7Q1];</P>

</TD>

</TR>

</TABLE>

</DIV>

<DIV>

<H3 CLASS="Heading2">

<A NAME="pgfId=3294">

 </A>

9.2.3&nbsp;PALASM</H3>

<P CLASS="BodyAfterHead">

<A NAME="pgfId=28531">

 </A>

PALASM is a PLD design language from AMD/MMI. <A HREF="#42196" CLASS="XRef">

Table&nbsp;9.7</A>

 shows the format of PALASM statements. The following simple example (a video shift register) shows the most basic features of the PALASM&nbsp;2 language:</P>

<TABLE>

<TR>

<TD ROWSPAN="1" COLSPAN="3">

<P CLASS="TableTitle">

<A NAME="pgfId=28542">

 </A>

TABLE&nbsp;9.7&nbsp;<A NAME="42196">

 </A>

PALASM&nbsp;2.</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableFirst">

<A NAME="pgfId=28548">

 </A>

<SPAN CLASS="TableHeads">

Statement</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableFirst">

<A NAME="pgfId=28550">

 </A>

<SPAN CLASS="TableHeads">

	Example</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableFirst">

<A NAME="pgfId=28552">

 </A>

<SPAN CLASS="TableHeads">

	Comment</SPAN>

</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28554">

 </A>

Chip</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28556">

 </A>

<SPAN CLASS="BodyComputer">

CHIP abc 22V10</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28558">

 </A>

Specific PAL type</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28560">

 </A>

&nbsp;</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28562">

 </A>

<SPAN CLASS="BodyComputer">

CHIP xyz USER</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28564">

 </A>

Free-form equation entry</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28566">

 </A>

Pinlist</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28568">

 </A>

<SPAN CLASS="BodyComputer">

CLK /LD D0 D1 D2 D3 D4 GND NC Q4 Q3 Q2 Q1 Q0 /RST VCC</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28570">

 </A>

Part of <SPAN CLASS="BodyComputer">

CHIP</SPAN>

 statement; PAL pins in numerical order starting with pin 1</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28572">

 </A>

String</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28574">

 </A>

<SPAN CLASS="BodyComputer">

STRING string_name 'text'</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28576">

 </A>

Before <SPAN CLASS="BodyComputer">

EQUATIONS</SPAN>

 statement</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28578">

 </A>

Equations</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28580">

 </A>

<SPAN CLASS="BodyComputer">

EQUATIONS</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28582">

 </A>

After <SPAN CLASS="BodyComputer">

CHIP</SPAN>

 statement</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28584">

 </A>

&nbsp;</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28586">

 </A>

<SPAN CLASS="BodyComputer">

A = /B</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28588">

 </A>

Logical negation</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28590">

 </A>

&nbsp;</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28592">

 </A>

<SPAN CLASS="BodyComputer">

A = B * C</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28594">

 </A>

Logical AND</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28596">

 </A>

&nbsp;</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28598">

 </A>

<SPAN CLASS="BodyComputer">

A = B + C</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28600">

 </A>

Logical OR</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28602">

 </A>

&nbsp;</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28604">

 </A>

<SPAN CLASS="BodyComputer">

A = B :+: C</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28606">

 </A>

Logical exclusive-OR</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28608">

 </A>

&nbsp;</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28610">

 </A>

<SPAN CLASS="BodyComputer">

A = B :*: C</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28612">

 </A>

Logical exclusive-NOR</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28614">

 </A>

Polarity inversion</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28616">

 </A>

<SPAN CLASS="BodyComputer">

/A = /(B + C)</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28618">

 </A>

Same as <SPAN CLASS="BodyComputer">

A = B + C</SPAN>

</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28620">

 </A>

Assignment</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28622">

 </A>

<SPAN CLASS="BodyComputer">

A = B + C</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28624">

 </A>

Combinational assignment</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28626">

 </A>

&nbsp;</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28628">

 </A>

<SPAN CLASS="BodyComputer">

A := B + C</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28630">

 </A>

Registered assignment</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28632">

 </A>

Comment</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28634">

 </A>

<SPAN CLASS="BodyComputer">

A = B + C ; comment</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28636">

 </A>

Comment</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28638">

 </A>

Functional equation</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28640">

 </A>

<SPAN CLASS="BodyComputer">

name.TRST</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28642">

 </A>

Output enable control</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28644">

 </A>

&nbsp;</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28646">

 </A>

<SPAN CLASS="BodyComputer">

name.CLKF</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28648">

 </A>

Register clock control</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28650">

 </A>

&nbsp;</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28652">

 </A>

<SPAN CLASS="BodyComputer">

name.RSTF</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28654">

 </A>

Register reset control</P>

</TD>

</TR>

<TR>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28656">

 </A>

&nbsp;</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28658">

 </A>

<SPAN CLASS="BodyComputer">

name.SETF</SPAN>

</P>

</TD>

<TD ROWSPAN="1" COLSPAN="1">

<P CLASS="TableLeft">

<A NAME="pgfId=28660">

 </A>

Register set control</P>

</TD>

</TR>

</TABLE>

<P CLASS="ComputerFirst">

<A NAME="pgfId=28661">

 </A>

TITLE video ; shift register</P>

<P CLASS="Computer">

<A NAME="pgfId=28662">

 </A>

CHIP video PAL20X8</P>

<P CLASS="Computer">

<A NAME="pgfId=3313">

 </A>

CK /LD D0 D1 D2 D3 D4 D5 D6 D7 CURS GND NC REV Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 /RST VCC</P>

<P CLASS="Computer">

<A NAME="pgfId=3315">

 </A>

STRING Load 'LD*/REV*/CURS*RST' ; load data</P>

<P CLASS="Computer">

<A NAME="pgfId=3317">

 </A>

STRING LoadInv 'LD*REV*/CURS*RST' ; load inverted of data</P>

<P CLASS="Computer">

<A NAME="pgfId=3319">

 </A>

STRING Shift '/LD*/CURS*/RST' ; shift data from MSB to LSB</P>

<P CLASS="Computer">

<A NAME="pgfId=3321">

 </A>

EQUATIONS</P>

<P CLASS="Computer">

<A NAME="pgfId=3323">

 </A>

/Q0 := /D0*Load+D0*LoadInv:+:/Q1*Shift+RST</P>

<P CLASS="Computer">

<A NAME="pgfId=3325">

 </A>

/Q1 := /D1*Load+D1*LoadInv:+:/Q2*Shift+RST</P>

<P CLASS="Computer">

<A NAME="pgfId=3327">

 </A>

/Q2 := /D2*Load+D2*LoadInv:+:/Q3*Shift+RST</P>

<P CLASS="Computer">

<A NAME="pgfId=3329">

 </A>

/Q3 := /D3*Load+D3*LoadInv:+:/Q4*Shift+RST</P>

<P CLASS="Computer">

<A NAME="pgfId=3331">

 </A>

/Q4 := /D4*Load+D4*LoadInv:+:/Q5*Shift+RST</P>

<P CLASS="Computer">

<A NAME="pgfId=3333">

 </A>

/Q5 := /D5*Load+D5*LoadInv:+:/Q6*Shift+RST</P>

<P CLASS="Computer">

<A NAME="pgfId=3335">

 </A>

/Q6 := /D6*Load+D6*LoadInv:+:/Q7*Shift+RST</P>

<P CLASS="ComputerLast">

<A NAME="pgfId=3337">

 </A>

/Q7 := /D7*Load+D7*LoadInv:+:Shift+RST;</P>

<P CLASS="Body">

<A NAME="pgfId=28665">

 </A>

The order of the pin numbers in the previous example is important; the order must correspond to the order of pins for the <SPAN CLASS="BodyComputer">

DEVICE</SPAN>

. This means that you probably need the device data sheet in order to be able to translate a design from PALASM to another format by hand. The alternative is to use utilities that many PLD and FPGA companies offer that automatically translate from PALASM to their own formats.</P>

</DIV>

<HR>

<DIV CLASS="footnotes">

<DIV CLASS="footnote">

<P CLASS="TableFootLast">

<SPAN CLASS="footnoteNumber">

1.</SPAN>

<A NAME="pgfId=27671">

 </A>

 L means that the extension is used only on the LHS of an equation; R means that the extension is used only on the RHS of an equation.</P>

</DIV>

</DIV>

<HR><P>[&nbsp;<A HREF="CH09.htm">Chapter&nbsp;start</A>&nbsp;]&nbsp;[&nbsp;<A HREF="CH09.1.htm">Previous&nbsp;page</A>&nbsp;]&nbsp;[&nbsp;<A HREF="CH09.3.htm">Next&nbsp;page</A>&nbsp;]</P></BODY>



<!--#include file="Copyright.html"--><!--#include file="footer.html"-->

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?