亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch04.2.htm

?? Verilog DHL教程
?? HTM
字號:
<HTML><HEAD>  <META NAME="GENERATOR" CONTENT="Adobe PageMill 2.0 Mac">  <LINK REL="STYLESHEET" HREF="ch04.css">  <TITLE> 4.2	Operands </TITLE></HEAD><BODY BGCOLOR="#ffffff"><P><A NAME="pgfId=626"></A><HR ALIGN=LEFT></P><P><A HREF="ch04.htm">Chapter&nbsp;&nbsp;start</A>&nbsp;&nbsp;&nbsp;<A HREF="ch04.1.htm">Previous&nbsp;&nbsp;page</A>&nbsp;&nbsp;<A HREF="ch04.3.htm">Next&nbsp;&nbsp;page</A></P><H1>4.2 Operands</H1><P><P CLASS="Body"><A NAME="pgfId=635"></A>As stated before, there are severaltypes of operands that can be specified in expressions. The simplest typeis a reference to a net or register in its complete form--that is, justthe name of the net or register is given. In this case, all of the bitsmaking up the net or register value shall be used as the operand.</P><P><P CLASS="Body"><A NAME="pgfId=668"></A>If a single bit of a vector netor register is required, then a bit-select operand shall be used. A part-selectoperand shall be used to reference a group of adjacent bits in a vectornet or register.</P><P><P CLASS="Body"><A NAME="pgfId=669"></A>A memory element can be referencedas an operand. A concatenation of other operands, (including nested concatenations)can be specified as an operand. A function call is an operand.</P><P><P CLASS="SubSection"><A NAME="pgfId=493"></A>Net and register bit-selectand part-select addressing</P><P><P CLASS="Body"><A NAME="pgfId=674"></A><I>Bit-selects</I> extract aparticular bit from a vector net or register. The bit can be addressed usingan expression. If the bit select is out of the address bounds or the bit-selectis <CODE>x</CODE> or <CODE>z</CODE> , then the value returned by the referenceshall be <CODE>x</CODE> .</P><P><P CLASS="Body"><A NAME="pgfId=679"></A>Several contiguous bits in avector register or net can be addressed, and are known as <I>part-selects</I>. A part-select of a vector register or net is given with the followingsyntax:</P><PRE>vect[msb_expr:lsb_expr]</PRE><P><P CLASS="Body"><A NAME="pgfId=681"></A>Both expressions must be constantexpressions. The first expression must address a more significant bit thanthe second expression. If the part-select is out of the address bounds orthe part-select is <CODE>x</CODE> or <CODE>z</CODE> , then the value returnedby the reference shall be <CODE>x</CODE> .</P><P><P CLASS="Body"><A NAME="pgfId=805"></A>The bit-select or part-selectof a variable declared as real and realtime shall be considered illegal.</P><P><P CLASS="Body"><A NAME="pgfId=912"></A>1. The following example specifiesthe single bit of <CODE>acc</CODE> vector that is addressed by the operand<CODE>index</CODE> .</P><PRE>acc[index]</PRE><P><P CLASS="Body"><A NAME="pgfId=676"></A>The actual bit that is accessedby an address is, in part, determined by the declaration of <CODE>acc</CODE>. For instance, each of the declarations of <CODE>acc</CODE> shown in thenext example causes a particular value of <CODE>index</CODE> to access adifferent bit:</P><PRE><B>reg</B>[15:0]&nbsp;acc;<B>reg</B> [1:16]&nbsp;acc;</PRE><P><P CLASS="Body"><A NAME="pgfId=1274"></A>2. The next example and thebullet items that follow it illustrate the principles of bit addressing.The code declares an 8-bit register called <CODE>vect</CODE> and initializesit to a value of 4. The bullet items describe how the separate bits of thatvector can be addressed.</P><PRE><B>reg</B> [7:0]&nbsp;vect;vect = 4; // fills vect with the pattern 00000100          // msb is bit 7, lsb is bit 0</PRE><UL>  <LI><A NAME="pgfId=683"></A>if the value of <CODE>addr</CODE> is 2, then  <CODE>vect[addr]</CODE> returns <CODE>1</CODE>  <LI><A NAME="pgfId=684"></A>if the value of <CODE>addr</CODE> is out of  bounds, then <CODE>vect[addr]</CODE> returns <CODE>x</CODE>  <LI><A NAME="pgfId=685"></A>if <CODE>addr</CODE> is 0, 1, or 3 through  7, <CODE>vect[addr]</CODE> returns <CODE>0</CODE>  <LI><A NAME="pgfId=686"></A><CODE>vect[3:0]</CODE> returns the bits <CODE>0100</CODE>  <LI><A NAME="pgfId=687"></A><CODE>vect[5:1]</CODE> returns the bits <CODE>00010</CODE>  <LI><A NAME="pgfId=688"></A><CODE>vect[</CODE> <I>expression that returns  x</I> <CODE>]</CODE> returns <CODE>x</CODE>  <LI><A NAME="pgfId=689"></A><CODE>vect[</CODE> <I>expression that returns  z</I> <CODE>]</CODE> returns <CODE>x</CODE>  <LI><A NAME="pgfId=690"></A>if any bit of <CODE>addr</CODE> is <CODE>x/z</CODE>  , then the value of <CODE>addr</CODE> is <CODE>x</CODE></UL><P><P CLASS="Note"><A NAME="pgfId=1273"></A>NOTES</P><OL>  <P><P CLASS="NumberedNote1"><A NAME="pgfId=1277"></A>1) --Part-select Indices  that evaluate to x or z may be flagged as a compile time error.  <P><P CLASS="NumberedNote2"><A NAME="pgfId=1278"></A>2) --Bit-select or  Part-select indices that are outside of the declared range may be flagged  as a compile time error.</OL><P><P CLASS="SubSection"><A NAME="pgfId=691"></A>Memory addressing</P><P><P CLASS="Body"><A NAME="pgfId=693"></A>Declaration of memory is discussedin section&nbsp;3.8. This section discusses memory addressing.&nbsp;</P><P><P CLASS="Body"><A NAME="pgfId=913"></A>The next example declares a memoryof 1024 8-bit words:</P><PRE><B>reg</B> [7:0]&nbsp;mem_name[0:1023];</PRE><P><P CLASS="Body"><A NAME="pgfId=695"></A>The syntax for a memory addressshall consist of the name of the memory and an expression for the address--specifiedwith the following format:</P><PRE>mem_name[addr_expr]</PRE><P><P CLASS="Body"><A NAME="pgfId=697"></A>The <CODE>addr_expr</CODE> canbe any expression; therefore, memory indirections can be specified in asingle expression. The next example illustrates memory indirection:</P><PRE>mem_name[mem_name[3]]</PRE><P><P CLASS="Body"><A NAME="pgfId=699"></A>In the above example, <CODE>mem_name[3]</CODE>addresses word three of the memory called <CODE>mem_name</CODE> . The valueat word three is the index into <CODE>mem_name</CODE> that is used by thememory address <CODE>mem_name[mem_name[3]]</CODE> . As with bit-selects,the address bounds given in the declaration of the memory determine theeffect of the address expression. If the index is out of the address boundsor if any bit in the address is <CODE>x</CODE> or <CODE>z</CODE> , thenthe value of the reference shall be <CODE>x</CODE> .</P><P><P CLASS="Note"><A NAME="pgfId=700"></A>NOTE--There is no mechanism toexpress bit-selects or part-selects of memory elements directly. If thisis required, then the memory element has to be first transferred to an appropriatelysized temporary register.</P><P><P CLASS="SubSection"><A NAME="pgfId=702"></A>Strings</P><P><P CLASS="Body"><A NAME="pgfId=706"></A>String operands shall be treatedas constant numbers consisting of a sequence of 8-bit ASCII codes, one percharacter. Any Verilog HDL operator can manipulate string operands. Theoperator shall behave as though the entire string were a single numericvalue.</P><P><P CLASS="Body"><A NAME="pgfId=1272"></A>When a variable is larger thanrequired to hold the value being assigned, the contents after the assignmentshall be padded on the left with zeros. This is consistent with the paddingthat occurs during assignment of non-string values.</P><P><P CLASS="Body"><A NAME="pgfId=704"></A>The following example declaresa string variable large enough to hold 14 characters and assigns a valueto it. The example then manipulates the string using the concatenation operator.</P><PRE><B>module</B> string_test;<B>reg</B> [8*14:1]&nbsp;stringvar;<B>initial </B>	<B>begin</B>	stringvar&nbsp;=&nbsp;&quot;Hello&nbsp;world&quot;;   <B>$display</B> (&quot;%s is stored as %h&quot;, stringvar, stringvar);   stringvar&nbsp;=&nbsp;{stringvar,&quot;!!!&quot;};   <B>$display</B> (&quot;%s is stored as %h&quot;, stringvar, stringvar);<B>end</B><B>endmodule</B></PRE><P><P CLASS="Body"><A NAME="pgfId=709"></A>The result of simulating theabove description is:</P><PRE>Hello world is stored as 00000048656c6c6f20776f726c64Hello world!!! is stored as 48656c6c6f20776f726c64212121</PRE><P><P CLASS="SubSubSect"><A NAME="pgfId=712"></A>String operations</P><P><P CLASS="Body"><A NAME="pgfId=713"></A>The common string operationscopy, concatenate, and compare are supported by Verilog HDL operators. Copyis provided by simple assignment. Concatenation is provided by the concatenationoperator. Comparison is provided by the equality operators.</P><P><P CLASS="Body"><A NAME="pgfId=503"></A>When manipulating string valuesin vector variables, at least <CODE>8*n</CODE> bits shall be required inthe vector, where <CODE>n</CODE> is the number of characters in the string.</P><P><P CLASS="SubSubSect"><A NAME="pgfId=716"></A>String value padding andpotential problems</P><P><P CLASS="Body"><A NAME="pgfId=717"></A>When strings are assigned tovariables, the values stored shall be padded on the left with zeros. Paddingcan affect the results of comparison and concatenation operations. The comparisonand concatenation operators shall not distinguish between zeros resultingfrom padding and the original string characters.</P><P><P CLASS="Body"><A NAME="pgfId=1275"></A>The following example illustratesthe potential problem.</P><PRE><B>reg</B> [8*10:1]&nbsp;s1,&nbsp;s2;<B>initial begin</B>	s1&nbsp;=&nbsp;&quot;Hello&quot;;	s2&nbsp;=&nbsp;&quot;&nbsp;world!&quot;;<B>   if</B> ({s1,s2}&nbsp;==&nbsp;&quot;Hello&nbsp;world!&quot;) <B>$display</B> (&quot;strings&nbsp;are&nbsp;equal&quot;);<B>end</B></PRE><P><P CLASS="Body"><A NAME="pgfId=721"></A>The comparison in the exampleabove fails because during the assignment the string variables get paddedas illustrated in the next example:</P><PRE>s1&nbsp;=&nbsp;000000000048656c6c6fs2&nbsp;=&nbsp;00000020776f726c6421</PRE><P><P CLASS="Body"><A NAME="pgfId=723"></A>The concatenation of <CODE>s1</CODE>and <CODE>s2</CODE> includes the zero padding, resulting in the followingvalue:</P><PRE>000000000048656c6c6f00000020776f726c6421</PRE><P><P CLASS="Body"><A NAME="pgfId=725"></A>Since the string &quot;Helloworld!&quot; contains no zero padding, the comparison fails, as shown below:</P><P><P CLASS="Body"><A NAME="pgfId=726"></A>&nbsp;</P><P><IMG SRC="ch04-7.gif" WIDTH="416" HEIGHT="94" NATURALSIZEFLAG="3" ALIGN="BOTTOM"> <P CLASS="Body"><A NAME="pgfId=727"></A>The above comparison yieldsa result of zero, which is equivalent to false.</P><P><P CLASS="SubSubSect"><A NAME="pgfId=729"></A>Null string handling</P><P><P CLASS="Body"><A NAME="pgfId=730"></A>The null string (<CODE> &quot;&quot;</CODE>) shall be considered equivalent to the ASCII value zero (0), which is differentfrom a string <CODE>&quot;0&quot;</CODE> .</P><P><HR ALIGN=LEFT></P><P><A HREF="ch04.htm">Chapter&nbsp;&nbsp;start</A>&nbsp;&nbsp;&nbsp;<A HREF="ch04.1.htm">Previous&nbsp;&nbsp;page</A>&nbsp;&nbsp;<A HREF="ch04.3.htm">Next&nbsp;&nbsp;page</A></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚州成人在线电影| 在线播放中文一区| 国产精品三级久久久久三级| 国产精品资源站在线| 欧美精品一区二区三区四区 | 91精品国产黑色紧身裤美女| 性欧美疯狂xxxxbbbb| 欧美一区二区免费观在线| 久久成人免费电影| 国产欧美综合色| 91亚洲国产成人精品一区二区三 | 久久综合狠狠综合久久激情| 国产成人啪午夜精品网站男同| 国产亚洲精品7777| 色婷婷香蕉在线一区二区| 日韩精品免费视频人成| 久久午夜老司机| 91亚洲资源网| 亚洲一区二区三区四区五区中文 | 99久久精品国产精品久久| 精品一区二区三区免费| 韩国精品在线观看| 91福利精品第一导航| 在线精品视频免费观看| 欧美精品久久99久久在免费线| 精品国产免费视频| 精品播放一区二区| 国产成人精品一区二区三区网站观看| 亚洲色图制服丝袜| 欧美综合欧美视频| 日产欧产美韩系列久久99| 日韩一区二区在线观看视频播放| 免费人成网站在线观看欧美高清| 欧美成人三级在线| 成人av网在线| 亚洲v日本v欧美v久久精品| 欧美一级在线免费| 国产乱理伦片在线观看夜一区| 国产精品视频线看| 欧美日韩高清影院| 国产成人在线视频免费播放| 亚洲乱码中文字幕综合| 欧美日韩国产电影| 国产呦精品一区二区三区网站| 国产精品国产三级国产| 欧美欧美欧美欧美首页| 亚洲欧洲成人av每日更新| 一区二区三区在线视频观看58| 99久久国产免费看| 久久无码av三级| 极品少妇xxxx精品少妇偷拍| 91精品国产综合久久精品麻豆 | 久久午夜羞羞影院免费观看| 丝袜美腿亚洲一区二区图片| 国产ts人妖一区二区| 91麻豆精品国产91久久久更新时间| 69堂成人精品免费视频| 国产色产综合色产在线视频| 综合久久久久综合| 日日摸夜夜添夜夜添亚洲女人| 91官网在线观看| 国产精品国产三级国产aⅴ原创 | 蜜桃精品视频在线| 图片区小说区国产精品视频| 国产999精品久久久久久绿帽| 7878成人国产在线观看| 亚洲综合999| 欧美三级电影一区| 性欧美大战久久久久久久久| 欧美日韩在线亚洲一区蜜芽| 亚洲精品国产无套在线观| 色综合久久综合网欧美综合网 | 成人免费视频一区二区| 亚洲高清一区二区三区| 国产精品毛片a∨一区二区三区| 欧美日韩和欧美的一区二区| 国产iv一区二区三区| 视频在线在亚洲| 一区二区三区蜜桃| 中文字幕国产一区二区| 2021中文字幕一区亚洲| 91麻豆精品国产91久久久资源速度 | 在线免费不卡视频| 大尺度一区二区| 老司机精品视频在线| 午夜精品久久久久| 一区二区日韩av| 亚洲日本成人在线观看| 久久精品亚洲一区二区三区浴池 | 久久久久久久久久久99999| 91精品国产黑色紧身裤美女| 欧洲激情一区二区| 日本黄色一区二区| 91日韩在线专区| av电影一区二区| 成人avav在线| yourporn久久国产精品| 高清成人免费视频| av中文一区二区三区| 丰满放荡岳乱妇91ww| 国产精品18久久久久久久久| 国产在线麻豆精品观看| 极品美女销魂一区二区三区免费 | 亚洲精品久久久蜜桃| 一区二区三区精品在线| 洋洋成人永久网站入口| 亚洲一级二级三级| 日韩在线a电影| 精品亚洲成a人在线观看| 石原莉奈在线亚洲三区| 久久成人羞羞网站| 国产成人av电影在线| 91视频一区二区| 在线免费不卡视频| 久久噜噜亚洲综合| 亚洲乱码日产精品bd| 亚洲综合久久久| 美国毛片一区二区| 国产成人av电影免费在线观看| 色系网站成人免费| 欧美精品日韩精品| 国产精品沙发午睡系列990531| 1000部国产精品成人观看| 亚洲午夜久久久| 国产真实乱子伦精品视频| 在线一区二区三区四区| 欧美一级精品在线| 久久影院午夜论| 污片在线观看一区二区| 国产成人亚洲综合a∨猫咪| 欧美亚洲日本一区| 精品国产露脸精彩对白 | 欧美精品一区二区三区蜜臀| 国产精品国产三级国产三级人妇| 日本sm残虐另类| 成人午夜激情在线| 欧美美女bb生活片| 成人欧美一区二区三区视频网页 | 美女任你摸久久| 成人白浆超碰人人人人| 99久久久无码国产精品| 精品久久久久久久久久久院品网| 中文字幕色av一区二区三区| 激情成人午夜视频| 在线中文字幕不卡| 精品裸体舞一区二区三区| |精品福利一区二区三区| 另类小说综合欧美亚洲| 欧美三级在线视频| 中文字幕一区二区5566日韩| 国产成人免费视频| 欧美丰满美乳xxx高潮www| 久久综合成人精品亚洲另类欧美| 五月婷婷久久综合| 99视频有精品| 亚洲欧美一区二区视频| 国产一区二区女| 2014亚洲片线观看视频免费| 五月天激情综合网| 国产成人免费在线视频| 日韩免费高清视频| 亚洲无人区一区| 欧美日韩高清在线播放| 一区二区三区国产| 不卡一区在线观看| 国产片一区二区| 麻豆成人av在线| 精品久久久久一区| 麻豆91精品视频| 精品久久人人做人人爰| 婷婷国产在线综合| 91麻豆精东视频| 尤物视频一区二区| 色综合久久综合| 亚洲尤物在线视频观看| 99精品国产一区二区三区不卡| 国产精品人人做人人爽人人添| 狠狠狠色丁香婷婷综合久久五月| 精品国产百合女同互慰| 麻豆国产91在线播放| 欧美人与禽zozo性伦| 视频一区二区三区在线| 欧美高清视频在线高清观看mv色露露十八| 日本麻豆一区二区三区视频| 在线看国产一区二区| 亚洲成在线观看| 欧美日韩久久不卡| 麻豆免费精品视频| 久久女同性恋中文字幕| 亚洲精品美腿丝袜| 在线不卡a资源高清| 日韩精品久久理论片| 久久久99精品久久| 国产高清不卡二三区| 亚洲免费在线视频| 欧美日韩一区二区三区高清| 麻豆视频观看网址久久| 精品国产精品一区二区夜夜嗨| 蜜桃精品视频在线| 久久久99久久精品欧美|