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

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

?? ch09.5.htm

?? Verilog DHL教程
?? HTM
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML EXPERIMENTAL 970324//EN"><HTML><HEAD><META NAME="GENERATOR" CONTENT="Adobe FrameMaker 5.5/HTML Export Filter"><LINK REL="STYLESHEET" HREF="ch09.css"><TITLE> 9.5	Case statement </TITLE></HEAD><BODY BGCOLOR="#ffffff"><DIV><HR><P><A HREF="ch09.htm">Chapter&nbsp;&nbsp;start</A>&nbsp;&nbsp;&nbsp;<A HREF="ch09.4.htm">Previous&nbsp;&nbsp;page</A>&nbsp;&nbsp;<A HREF="ch09.6.htm">Next&nbsp;&nbsp;page</A></P></DIV><H1 CLASS="Section"><A NAME="pgfId=541"> </A>9.5	<A NAME="11088"> </A>C<A NAME="marker=57"> </A>ase statement </H1><P CLASS="Body"><A NAME="pgfId=545"> </A>The <I CLASS="Emphasis">case</I> statement is a <A NAME="marker=137"> </A>multi-way decision statement that tests whether an expression matches one of a number of other expressions, and branches accordingly. The <A NAME="marker=138"> </A>case statement has the following <A NAME="marker=139"> </A>syntax:</P><P CLASS="Body"><A NAME="pgfId=628"> </A></P><DIV><IMG SRC="ch09-19.gif"></DIV><P CLASS="BNFCapBody"><A NAME="pgfId=629"> </A>Syntax&nbsp;9-6: Syntax for case statement</P><P CLASS="Body"><A NAME="pgfId=558"> </A>The <I CLASS="Emphasis">default</I><A NAME="marker=143"> </A> statement shall be optional. Use of multiple default statements in one case statement shall be illegal.</P><P CLASS="Body"><A NAME="pgfId=396"> </A>The case expression and the case item expression can be computed at runtime; neither expression is required to be a constant expression.</P><DIV><H2 CLASS="Example"><A NAME="pgfId=559"> </A></H2><P CLASS="Body"><A NAME="pgfId=384"> </A>A simple example of the use of the case statement is the decoding of register <CODE CLASS="code">rega</CODE> to produce a value for <CODE CLASS="code">result</CODE> as follows:</P><P CLASS="Body"><A NAME="pgfId=632"> </A></P><DIV><IMG SRC="ch09-20.gif"></DIV><P CLASS="Body"><A NAME="pgfId=634"> </A>The <I CLASS="Emphasis">case item expressions</I> shall be evaluated and compared in the exact order in which they are given. During the linear search, if one of the <CODE CLASS="code">case</CODE> item expressions matches the case expression given in parentheses, then the statement associated with that case item shall be executed. If all comparisons fail, and the default item is given, then the default item statement shall be executed. If the default statement is not given, and all of the comparisons fail, then none of the case item statements shall be executed.</P><P CLASS="Body"><A NAME="pgfId=635"> </A>Apart from syntax, the <A NAME="marker=145"> </A><A NAME="marker=146"> </A><CODE CLASS="code">case</CODE> statement differs from the multi-way if-else-if construct in two important ways:</P><OL><P CLASS="NumberedLista"><A NAME="pgfId=636"> </A>a)	The conditional expressions in the if-else-if construct are more general than comparing one expression with several others, as in the case statement.</P><P CLASS="NumberedListb"><A NAME="pgfId=637"> </A>b)	The case statement provides a definitive result when there are <CODE CLASS="code">x</CODE> and <CODE CLASS="code">z</CODE> values in an expression.</P></OL><P CLASS="Body"><A NAME="pgfId=638"> </A>In a case expression comparison, the comparison only succeeds when each bit matches exactly with respect to the values <CODE CLASS="code">0</CODE>, <CODE CLASS="code">1</CODE>, <CODE CLASS="code">x</CODE>, and <CODE CLASS="code">z</CODE>. As a consequence, care is needed in specifying the expressions in the <CODE CLASS="code">case</CODE> statement. The bit length of all the expressions shall be equal so that exact bit-wise matching can be performed. The length of all the <CODE CLASS="code">case</CODE> item expressions, as well as the case expression in the parentheses, shall be made equal to the length of the longest of the case expression and the case item expression. </P><P CLASS="Note"><A NAME="pgfId=504"> </A>NOTE--The default length of <CODE CLASS="code">x</CODE> and <CODE CLASS="code">z</CODE> is same as the default length of an integer.</P><P CLASS="Body"><A NAME="pgfId=640"> </A>The reason for providing a case expression comparison that handles the <CODE CLASS="code">x</CODE> and <CODE CLASS="code">z</CODE> values is that it provides a mechanism for detecting such values and <A NAME="marker=148"> </A>reducing the pessimism that can be generated by their presence. </P></DIV><DIV><H2 CLASS="Example"><A NAME="pgfId=387"> </A></H2><P CLASS="Body"><A NAME="pgfId=485"> </A>1. <A NAME="marker=149"> </A>The following example illustrates the use of case statement to properly handle <CODE CLASS="code">x</CODE> and <CODE CLASS="code">Z </CODE>values.</P><P CLASS="Body"><A NAME="pgfId=641"> </A></P><DIV><IMG SRC="ch09-21.gif"></DIV><P CLASS="Body"><A NAME="pgfId=643"> </A>In the example above, if <CODE CLASS="code">select[1]</CODE> is <CODE CLASS="code">0</CODE> and <CODE CLASS="code">flaga</CODE> is <CODE CLASS="code">0</CODE>, then whatever the value of <CODE CLASS="code">select[2]</CODE> is <CODE CLASS="code">x</CODE> or <CODE CLASS="code">z</CODE>, <CODE CLASS="code">result</CODE> should be <CODE CLASS="code">0</CODE>--which is resolved by the third case.</P><P CLASS="Body"><A NAME="pgfId=644"> </A>2. The example below shows another way to use a case statement to detect <CODE CLASS="code">x</CODE> and <CODE CLASS="code">z</CODE> values.</P><P CLASS="Body"><A NAME="pgfId=645"> </A></P><DIV><IMG SRC="ch09-22.gif"></DIV><P CLASS="SubSection"><A NAME="pgfId=647"> </A><A NAME="95402"> </A><A NAME="marker=153"> </A>Case statement with don't-cares</P><P CLASS="Body"><A NAME="pgfId=649"> </A>Two other types of case statements are provided to allow handling of don't-care conditions in the case comparisons. One of these treats high-impedance values (<CODE CLASS="code">z</CODE>) as don't-cares, and the other treats both high-impedance and unknown (<CODE CLASS="code">x</CODE>) values as don't-cares.</P><P CLASS="Body"><A NAME="pgfId=650"> </A>These case statements can be used in the same way as the traditional case statement, but they begin with keywords <B CLASS="Keyword">casez</B><A NAME="marker=154"> </A> and <B CLASS="Keyword">casex</B><A NAME="marker=155"> </A> respectively.</P><P CLASS="Body"><A NAME="pgfId=651"> </A>Don't-care values (<CODE CLASS="code">z</CODE> values for casez, <CODE CLASS="code">z</CODE> and <CODE CLASS="code">x</CODE> values for casex) in any bit of either the case expression or the case items shall be treated as don't-care conditions during the comparison, and that bit position shall not be considered. The don't care conditions in case expression can be used to dynamically control which bits should be compared at any time.</P><P CLASS="Body"><A NAME="pgfId=653"> </A>The syntax of literal numbers allows the use of the question mark <CODE CLASS="code">(?)</CODE><A NAME="marker=156"> </A> in place of <CODE CLASS="code">z</CODE> in these case statements. This provides a convenient format for specification of <A NAME="marker=157"> </A>don't-care bits in case statements.</P></DIV><DIV><H2 CLASS="Example"><A NAME="pgfId=818"> </A></H2><P CLASS="Body"><A NAME="pgfId=486"> </A>1. The following is an <A NAME="marker=158"> </A>example of the casez statement. It demonstrates an instruction decode, where values of the most significant bits select which task should be called. If the most significant bit of <CODE CLASS="code">ir</CODE> is a <CODE CLASS="code">1</CODE>, then the task <CODE CLASS="code">instruction1</CODE> is called, regardless of the values of the other bits of <CODE CLASS="code">ir</CODE>.</P><P CLASS="Body"><A NAME="pgfId=655"> </A></P><DIV><IMG SRC="ch09-23.gif"></DIV><P CLASS="Body"><A NAME="pgfId=657"> </A>2. The following is an <A NAME="marker=160"> </A>example of the casex statement. It demonstrates an extreme case of how don't-care conditions can be dynamically controlled during simulation. In this case, if <CODE CLASS="code">r = 8&#180;b01100110</CODE>, then the task <CODE CLASS="code">stat2</CODE> is called.</P><P CLASS="Body"><A NAME="pgfId=658"> </A></P><DIV><IMG SRC="ch09-24.gif"></DIV><P CLASS="SubSection"><A NAME="pgfId=875"> </A>Constant expression in case statement</P><P CLASS="Body"><A NAME="pgfId=876"> </A>A constant expression can be used for case expression. The value of the constant expression shall be compared against case item expressions. </P></DIV><DIV><H2 CLASS="Example"><A NAME="pgfId=487"> </A></H2><P CLASS="Body"><A NAME="pgfId=488"> </A>The following example demonstrates the usage by modeling a 3-bit priority encoder.</P><P CLASS="Body"><A NAME="pgfId=877"> </A></P><DIV><IMG SRC="ch09-25.gif"></DIV><P CLASS="Body"><A NAME="pgfId=878"> </A>Note that the case expression is a constant expression (1). The case items are expressions (bit-selects), and are compared against the constant expression for a match. </P></DIV><HR><P><A HREF="ch09.htm">Chapter&nbsp;&nbsp;start</A>&nbsp;&nbsp;&nbsp;<A HREF="ch09.4.htm">Previous&nbsp;&nbsp;page</A>&nbsp;&nbsp;<A HREF="ch09.6.htm">Next&nbsp;&nbsp;page</A></P></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一二三级电影| 国产色产综合产在线视频| 一本色道久久加勒比精品| 日本久久一区二区三区| 制服丝袜av成人在线看| 欧美高清在线精品一区| 最新中文字幕一区二区三区| 亚洲成在线观看| 国产成人亚洲综合a∨婷婷| 99精品在线免费| 3d动漫精品啪啪一区二区竹菊| 欧美精品一区二区三区在线| 最新久久zyz资源站| 日韩国产欧美三级| 成人激情av网| 日韩欧美不卡在线观看视频| 樱桃视频在线观看一区| 国产毛片精品国产一区二区三区| 欧美性欧美巨大黑白大战| 国产欧美精品区一区二区三区| 亚洲大片免费看| 91丨porny丨最新| 国产精品久久久久婷婷二区次| 麻豆久久一区二区| 欧美日韩成人一区二区| 亚洲伊人伊色伊影伊综合网| av成人免费在线观看| 国产欧美一区二区精品忘忧草 | 国产在线看一区| 欧美日韩国产三级| 天天影视网天天综合色在线播放| 成人高清视频免费观看| 中文字幕中文字幕一区二区| 丁香婷婷综合色啪| 中文字幕精品一区二区精品绿巨人| 极品瑜伽女神91| 国产欧美日韩另类视频免费观看| 国产成人免费高清| 久久精品亚洲乱码伦伦中文 | 久久精品一二三| 91视频免费播放| 亚洲国产精品久久久男人的天堂| 欧美一区二区在线播放| 国产一区二区毛片| 亚洲美女淫视频| 777xxx欧美| 国产剧情av麻豆香蕉精品| 中文字幕在线观看不卡| 在线视频国内自拍亚洲视频| 免费观看一级特黄欧美大片| 国产日韩欧美高清在线| 欧美视频一区二区| 国产激情精品久久久第一区二区| 亚洲伦理在线免费看| 精品99999| 欧美日韩视频不卡| 成人美女视频在线观看18| 婷婷开心激情综合| 亚洲欧美综合网| 国产亚洲欧美日韩俺去了| 欧美三级在线看| 99国产麻豆精品| 国产乱码一区二区三区| 六月丁香综合在线视频| 一区二区三区免费在线观看| 精品999在线播放| 欧美mv日韩mv| 久久综合九色综合欧美就去吻| 在线不卡免费欧美| 欧美伊人久久大香线蕉综合69 | 一区二区免费看| 久久久噜噜噜久久中文字幕色伊伊| 在线欧美小视频| 91成人免费电影| 欧洲精品一区二区| 色噜噜夜夜夜综合网| 色av一区二区| 欧美巨大另类极品videosbest | 精品久久99ma| 91精品国产色综合久久不卡蜜臀| 欧美专区在线观看一区| 欧美丝袜丝交足nylons| 欧美久久久久久蜜桃| 欧美日韩国产a| 国产亚洲欧美激情| 中文字幕乱码久久午夜不卡 | 成人黄色小视频在线观看| 成人av免费网站| 欧美影片第一页| 精品福利一区二区三区免费视频| 国产午夜精品美女毛片视频| 国产亚洲午夜高清国产拍精品 | 成人高清免费观看| 欧美电影一区二区| 中文一区二区完整视频在线观看| 日韩毛片高清在线播放| 天堂久久久久va久久久久| 国产成人av电影在线播放| 色综合久久久久久久| 欧美精品一区二区三| 亚洲色图丝袜美腿| 国产高清不卡一区二区| 欧美日韩国产bt| 亚洲欧美另类小说| 国产.欧美.日韩| 在线电影院国产精品| 亚洲欧美另类小说| 97精品视频在线观看自产线路二| 欧美一区午夜精品| 亚洲777理论| 91美女福利视频| 国产亚洲综合色| 韩日欧美一区二区三区| 欧美电影一区二区| 亚洲成人综合网站| 在线观看免费亚洲| 亚洲成人av电影| 色综合欧美在线| 一区二区三区毛片| 色综合 综合色| 亚洲永久精品国产| 欧美性一级生活| 亚洲成a人片在线不卡一二三区| 在线一区二区三区四区| 亚洲午夜一区二区| 6080亚洲精品一区二区| 奇米精品一区二区三区在线观看 | 成人app网站| 亚洲免费观看高清完整版在线 | 奇米影视7777精品一区二区| 欧美精品在线一区二区三区| 午夜精品视频在线观看| 欧美一区二区国产| 国产91在线观看丝袜| 一区二区三区中文字幕| 欧美日韩成人在线| 国产成人av影院| 亚洲一区二区av电影| 91.xcao| 成人一区二区三区| 日本欧美在线观看| 亚洲婷婷在线视频| 欧美一区二区视频在线观看| 韩国成人在线视频| 亚洲与欧洲av电影| 中文字幕中文在线不卡住| 日韩精品一区二区三区四区视频| 国产成人一区在线| 久久成人综合网| 亚洲国产精品天堂| 国产精品电影一区二区三区| 精品国产伦理网| 欧美一区二区三区免费观看视频| 成年人国产精品| 国产剧情av麻豆香蕉精品| 日韩1区2区3区| 午夜精品福利视频网站| 亚洲男同性恋视频| 中文字幕精品一区二区精品绿巨人| 日韩午夜在线观看视频| 欧美日韩国产a| 91精品国产色综合久久不卡电影 | 亚洲天天做日日做天天谢日日欢| 久久一留热品黄| 国产午夜精品一区二区三区嫩草 | 国产成人免费高清| 成人深夜在线观看| 国产成人免费视频| 成人污视频在线观看| 成人综合激情网| 91在线码无精品| 91社区在线播放| 欧美视频中文字幕| 久久品道一品道久久精品| 2020国产精品| 中文字幕综合网| 日欧美一区二区| 高清国产一区二区三区| 99视频在线精品| 日韩一区二区在线观看| 久久久精品国产免大香伊| 国产欧美日韩久久| 一区二区三区小说| 麻豆精品视频在线观看免费| 成人高清免费在线播放| 91.麻豆视频| 国产精品久久久久7777按摩| 亚洲国产毛片aaaaa无费看| 精品一区二区三区在线视频| www.成人在线| 日韩欧美高清dvd碟片| 亚洲色欲色欲www| 狠狠色丁香婷婷综合| 欧美视频在线观看一区| 中文字幕在线免费不卡| 国产乱理伦片在线观看夜一区| 欧美日韩一区国产| 有坂深雪av一区二区精品| 国产福利精品一区二区| 欧美成人官网二区|