There are three primitive RTL binary logical operations, which we define recursively.
We first note the trivial case
.
The operands may be truncated without affecting the result.
|
(a)
|
|
(b)
|
|
(c)
|
PROOF: We present the proof of (a); (b) and (c) are similar.
The case
follows from Lemma 3.2.1. Let
and proceed by induction,
assuming that the equation holds with
replaced by
. Then by Lemma 2.2.14,
It may be similarly shown that
The third argument determines the width of the result.
|
(a)
|
|
(b)
|
|
(c)
|
PROOF: We present the proof of (a); (b) and (c) are similar.
The case
follows from Lemma 3.2.1. Let
and proceed by induction,
assuming that the equation holds with
replaced by
. Then
It follows from Definition 3.2.1 that
Notation: For any expressions,
, and
, the size the expressions `
' `
', and `
' are defined to be
(cf. Figure 2.4).
Ifand
are expressions of sizes
and
, respectively, then `
', `
', and `
' are abbreviations for `
', `
', and `
' (cf. Figure 2.4).
For example, `-
-
' is an abbreviation for
and according to Lemma 3.2.2, may also be used as an abbreviation for `'.
As a consequence of Lemmas 3.1.2 and 3.2.3, it remains true that ifis any expression of size
, then the value of
is a bit vector whose width is the value of
.
The recursive case of each definition may be restated as follows.
PROOF: To prove (a), we substitute 0 for
in Definition 3.2.1 and conclude that
The desired equation is now easily seen to be a restatement of the definition. Similar reasoning applies to (b) and (c).
The following lemma belongs to the topic of Section 3.3, but it is needed for the proofs of this section.
PROOF: Each equation is trivial in the case
. We proceed by induction,
noting first that as immediate
consequences of Definitions 3.2.1, 3.2.2, and 3.2.3,
(a)
,
(b)
, and
(c)
.
The proofs are completed by applying Lemma 3.2.4 in the case
:
(a) By inductive hypothesis,
(b) By inductive hypothesis and Lemmas 2.2.13 and 2.3.14,
(c) By inductive hypothesis and Lemmas 2.2.13 and 2.3.14,
The next six results are analogous to Lemmas 3.1.4-3.1.9 of the preceding section.
PROOF: We present the proof for (a); (b) and (c) are similar.
The proof is by induction on
. The statement is vacuous for
. For
, since
, by Definition 3.2.1,
Applying the inductive hypothesis, we may write this as
or
PROOF: For the proof of (a), we note that the statement is vacuous for
,
and proceed by induction:
|
|
|
| =
|
(by Lemma 1.1.7) |
| =
|
(by Definition 3.2.1) |
| =
|
(by induction) |
| =
|
(by Lemma 1.1.7) |
The proofs of (b) and (c) are similar.
PROOF: We present the proof for (a); (b) and (c) are similar.
The statement is vacuous for
. We proceed by induction, assuming
.
By Lemma 3.2.4, the left-hand side may be written as
which, using to Lemma 1.2.19, we may rewrite as
Now by Lemma 1.2.24, the first argument of this expression is
According to our inductive hypothesis, this reduces to
Our original expression, therefore, becomes
But, according to Definition 3.2.1, this is equivalent to
which, by Lemmas 3.2.3 and 1.2.7, is just
PROOF: We present the proof for (a); (b) and (c) are similar.
By Definition 3.2.1,
If
by Lemma 3.2.8; otherwise, Lemmas 1.2.7 and 3.2.3 yield
In either case, we have
where
which, according to Lemma 2.2.13, reduces to
PROOF: This is the case of Lemma 3.1.7 with
.
(a)
-
-
-
-
=
-
-
-
-
(b)
-
-
-
-
=
-
-
-
-
(c)
-
-
-
-
=
-
-
-
-
PROOF: We present the proof for (a); (b) and (c) are similar.
Let
-
-
-
-
.
By Lemmas 3.2.8 and 2.4.13,
where, by Definition 2.4.1 and the properties of the floor,
Finally, by Definitions 1.2.1 and 2.4.1,
Results of the binary operations are ordered as follows.
PROOF: We shall present an inductive proof of (a). For
, the statement is trivial.
For
,
But clearly,
but by Lemmas 2.2.13 and 2.3.14,
The proofs of (b) and (c) are similar, requiring the observations that
and
respectively.
PROOF: By Lemma 3.2.4,
and by Lemma 3.2.7,
Therefore, applying induction, we may assume that
It is easily verified that in the present case,
which reduces, by Lemmas 2.2.13 and 2.3.13, to
We note two results pertaining to special cases of shifted arguments.
PROOF: The claim is trivial for the case
.
Assume
. Then by Lemma 3.2.4, the left-hand side may be written as
or
But
and by induction,
Thus, the original expression reduces to
and the lemma follows from Lemma 2.2.13.
PROOF: By hypothesis,
-
, and therefore, by
Lemma 3.2.14,
The lemma now follows from Lemma 3.2.13.
PROOF:
(a) In the case
, according to Lemma 3.2.5(a), we have
and for
(b) For
, applying Lemmas 3.2.5(b), 2.2.13 and 2.3.14, we have
(c) For
, applying Lemmas 3.2.5(c), 2.2.13 and 2.3.14, we have
Next, we consider a string of 1's. Note that for
,
PROOF: For each equation, the case
is trivial. We proceed by induction,
assuming
:
(a) By Lemma 3.2.4, the left-hand side may be written as
Now
and hence, by induction and Lemma 2.2.13,
our original expression reduces to
by Lemma 2.3.14.
(b) By Lemma 3.2.4, the left-hand side may be written as
By induction,
(c) By Lemma 3.2.4, the left-hand side may be written as
By induction and Lemma 2.2.13,
Thus, our original expression reduces to
The following lemma is a generalization of Lemma 3.2.17. Since
the expression `
PROOF: By Lemma 2.4.9,
and since
To prove (a), we apply Lemma 3.2.11 to write the left-hand side as
The result then follows from Lemmas 3.2.5 and 3.2.17. The proofs of (b) and (c) are similar.
Here is a special case of Lemma 3.2.18(a) that finds application in floating-point design.
PROOF:
Applying Lemmas 3.2.18, 1.1.6, and 1.1.3, we have