📄 ch02.13.htm
字号:
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="Adobe PageMill 2.0 Mac">
<TITLE> 2.6.1 Datapath Elements</TITLE>
</HEAD><!--#include file="top.html"--><!--#include file="header.html"-->
<P><A NAME="pgfId=83863"></A><HR ALIGN=LEFT></P>
<P><A HREF="CH02.12.htm">Chapter start</A> <A
HREF="CH02.12.htm">Previous page</A> <A HREF="CH02.14.htm">Next page</A></P>
<H2>2.6.1 Datapath Elements</H2>
<P><P CLASS="BodyAfterHead"><A NAME="pgfId=129197"></A>Figure 2.21
shows some typical datapath symbols for an adder (people rarely use the
IEEE standards in ASIC datapath libraries). I use heavy lines (they are
1.5<SPAN CLASS="White"> </SPAN>point wide) with
a stroke to denote a data bus (that flows in the horizontal direction in
a datapath), and regular lines (0.5<SPAN CLASS="White"> </SPAN>point)
to denote the control signals (that flow vertically in a datapath). At the
risk of adding confusion where there is none, this stroke to indicate a
data bus has nothing to do with mixed-logic conventions. For a bus, A[31:0]
denotes a 32-bit bus with A[31] as the leftmost or <B>most-significant bit</B>
or <B>MSB</B> , and A[0] as the <B>least-significant bit</B> or <B>LSB</B>
. Sometimes we shall use A[MSB] or A[LSB] to refer to these bits. Notice
that if we have an <SPAN CLASS="EquationVariables"> n</SPAN> -bit bus and
LSB<SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN>0,
then MSB<SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN><SPAN CLASS="EquationVariables">
n</SPAN> <SPAN CLASS="White"> </SPAN>–<SPAN CLASS="White"> </SPAN>1.
Also, for example, A[4] is the fifth bit on the bus (from the LSB). We use
a '<SPAN CLASS="Symbol"> S</SPAN> ' or 'ADD' inside the symbol to denote
an adder instead of '+', so we can attach '' or '+/' to the inputs for a
subtracter or adder/subtracter.</P>
<P><TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0">
<TR>
<TD><P><P CLASS="TableFigure"><A NAME="pgfId=162514"></A> </P>
<P><IMG SRC="CH02-63.gif" WIDTH="447" HEIGHT="132" NATURALSIZEFLAG="3"
ALIGN="BOTTOM"></TD></TR>
<TR>
<TD><P CLASS="TableFigureTitle"><A NAME="pgfId=162517"></A>FIGURE 2.21 Symbols
for a datapath adder. (a) A data bus is shown by a heavy line (1.5<SPAN CLASS="White"> </SPAN>point)
and a bus symbol. If the bus is <SPAN CLASS="EquationVariables"> n</SPAN>
-bits wide then MSB<SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN><SPAN CLASS="EquationVariables">
n</SPAN> <SPAN CLASS="White"> </SPAN>–<SPAN CLASS="White"> </SPAN>1.
(b) An alternative symbol for an adder. (c) Control signals are
shown as lightweight (0.5<SPAN CLASS="White"> </SPAN>point)
lines.</TD></TR>
</TABLE>
<P CLASS="Body"><A NAME="pgfId=162204"></A>Some schematic datapath symbols
include only data signals and omit the control signalsbut we must not forget
them. In Figure 2.21, for example, we may need to explicitly tie CIN[0]
to VSS and use COUT[MSB] and COUT[MSB<SPAN CLASS="White"> </SPAN><SPAN CLASS="White"> </SPAN>1]
to detect overflow. Why might we need both of these control signals? Table 2.11
shows the process of simple arithmetic for the different binary number representations,
including unsigned, signed magnitude, ones' complement, and two's complement.</P>
<P><TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0">
<TR>
<TD COLSPAN="5"><P CLASS="TableTitle"><A NAME="pgfId=162232"></A>TABLE 2.11 Binary
arithmetic.</TD></TR>
<TR>
<TD ROWSPAN="2"><P CLASS="TableFirst"><A NAME="pgfId=162242"></A><B>Operation</B></TD>
<TD COLSPAN="4"><P CLASS="TableFirst"><A NAME="pgfId=162244"></A><B>Binary Number Representation</B></TD></TR>
<TR>
<TD><P CLASS="TableFirst"><A NAME="pgfId=162254"></A><B>Unsigned</B></TD>
<TD><P><P CLASS="TableFirst"><A NAME="pgfId=162256"></A><B>Signed</B></P>
<P><P CLASS="TableFirst"><A NAME="pgfId=162257"></A><B>magnitude</B></TD>
<TD><P><P CLASS="TableFirst"><A NAME="pgfId=162259"></A><B>Ones' </B></P>
<P><P CLASS="TableFirst"><A NAME="pgfId=162260"></A><B>complement</B></TD>
<TD><P><P CLASS="TableFirst"><A NAME="pgfId=162262"></A><B>Two's</B></P>
<P><P CLASS="TableFirst"><A NAME="pgfId=162263"></A><B>complement</B></TD></TR>
<TR>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162265"></A> </TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162267"></A>no change</TD>
<TD><P><P CLASS="TableLeft"><A NAME="pgfId=162269"></A><B>if</B> positive<B>
then</B> MSB<SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN>0</P>
<P><P CLASS="TableLeft"><A NAME="pgfId=162270"></A><B>else</B> MSB<SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN>1</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162272"></A><B>if</B> negative <B>then</B>
flip bits</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162274"></A><B>if</B> negative <B>then</B>
{flip bits; add 1}</TD></TR>
<TR>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162276"></A>3<SPAN CLASS="White"> </SPAN>=</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162278"></A>0011</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162280"></A>0011</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162282"></A>0011</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162284"></A>0011</TD></TR>
<TR>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162286"></A>3<SPAN CLASS="White"> </SPAN>=</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162288"></A>NA</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162290"></A>1011</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162292"></A>1100</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162294"></A>1101</TD></TR>
<TR>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162296"></A>zero<SPAN CLASS="White"> </SPAN>=</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162298"></A>0000</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162300"></A>0000 or 1000</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162302"></A>1111 or 0000</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162304"></A>0000</TD></TR>
<TR>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162306"></A>max. positive<SPAN CLASS="White"> </SPAN>=</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162308"></A>1111<SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN>15</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162310"></A>0111<SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN>7</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162312"></A>0111<SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN>7</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162314"></A>0111<SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN>7</TD></TR>
<TR>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162316"></A>max. negative<SPAN CLASS="White"> </SPAN>=</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162318"></A>0000<SPAN CLASS="White"> </SPAN><SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN>0</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162320"></A>1111<SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN>7</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162322"></A>1000<SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN>7</TD>
<TD><P CLASS="TableLeft"><A NAME="pgfId=162324"></A>1000<SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN>8</TD></TR>
<TR>
<TD><P><P CLASS="TableLeft"><A NAME="pgfId=162326"></A>addition<SPAN CLASS="White"> </SPAN>=</P>
<P><P CLASS="TableLeft"><A NAME="pgfId=162327"></A>S<SPAN CLASS="White"> </SPAN>=<SPAN CLASS="White"> </SPAN>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -