Number | 44
|
Category | errata
|
Synopsis | Misleading comment: Section 4, example 4.4.3 -- value can't be verified
|
State | lrmdraft
|
Class | errata-simple
|
Arrival-Date | Oct 08 2001
|
Originator | tiao@agere.com
|
Release | 2001b, 4.4.3
|
Environment |
|
Description |
For page 64, Section 4, example 4.4.3, I can't seem to verify the value, though all of the resulting bit sizes seemed correct. if a = 4'hF b = 6'ha <-- is this 'a'? if so, how can a * b results in a value of 96? the expression size is 6, and this is indeed correct. |
Fix |
Passed 10/7/02: Section 4.4.3 example: REPLACE: b = 6'ha; WITH: b = 6'hA; REPLACE: a*b=16 // 96 was truncated since expression size is 6 WITH: a*b=16 // 'h96 was truncated to 'h16 since expression size is 6 REPLACE (%x changed to %h): $display ("a*b=%x", a*b); // expression size is self determined c = {a**b}; // expression a**b is self determined $display ("a**b=%x", c); // due to {} c = a**b; // expression size is determined by c $display ("c=%x", c); WITH: $display ("a*b=%h", a*b); // expression size is self determined c = {a**b}; // expression a**b is self determined // due to concatenation operator {} $display ("a**b=%h", c); c = a**b; // expression size is determined by c $display ("c=%h", c); Editors note: Note that this includes changes to comments from issue #40 |
Audit-Trail |
From: Steven Sharp <sharp@cadence.com> To: btf-bugs@boyd.com, tiao@agere.com Cc: Subject: Re: errata/44: For page 64, Section 4, example 4.4.3 -- value can't be verified Date: Mon, 8 Oct 2001 16:59:42 -0400 (EDT) >>Number: 44 >>Category: errata >>Originator: tiao@agere.com >>Description: > >For page 64, Section 4, example 4.4.3, >I can't seem to verify the value, >though all of the resulting bit sizes seemed correct. > >if >a = 4'hF >b = 6'ha <-- is this 'a'? > >if so, how can a * b results in a value of 96? >the expression size is 6, and this is indeed correct. The example is wrong, but not because the values are wrong. The values are correct if you realize that they are being printed in hexadecimal. The example is wrong because it is using the illegal format descriptor %x instead of the correct %h. This makes an already confusing example even worse. Steven Sharp sharp@cadence.com From: Adam Krolnik <krolnik@lsil.com> To: tiao@agere.com Cc: btf-bugs@boyd.com Subject: Re: errata/44: For page 64, Section 4, example 4.4.3 -- value can't be verified Date: Mon, 08 Oct 2001 17:01:50 -0500 >if so, how can a * b results in a value of 96? What is A * F equal to? what is the default base? A * F == 96 (when the base is 16) the same as (from Hitchhikers Guide) 6 * 8 = 42 (when the base is 13) Adam Krolnik Verification Mgr. LSI Logic Corp. Plano TX. 75074 From: Michael McNamara <mac@verisity.com> To: Adam Krolnik <krolnik@lsil.com> Cc: btf-bugs@boyd.com Subject: Re: errata/44: For page 64, Section 4, example 4.4.3 -- value can't be verified Date: Mon, 8 Oct 2001 19:59:37 -0700 Adam Krolnik writes: > Precedence: bulk > > The following reply was made to PR errata/44; it has been noted by GNATS. > > From: Adam Krolnik <krolnik@lsil.com> > To: tiao@agere.com > Cc: btf-bugs@boyd.com > Subject: Re: errata/44: For page 64, Section 4, example 4.4.3 -- value can't be verified > Date: Mon, 08 Oct 2001 17:01:50 -0500 > > >if so, how can a * b results in a value of 96? > > What is A * F equal to? > > what is the default base? > > > A * F == 96 (when the base is 16) Agreed. > > as (from Hitchhikers Guide) 6 * 8 = 42 (when the base is 13) No, 6*8 = 39 in base 13 (48 = 3*13 + 9) Perhaps you (or Douglas Addams, I haven't checked my copy to see if the error is yours or his) meant that '6*9 = 42 (when the base is 13)' -mac > > Adam Krolnik > Verification Mgr. > LSI Logic Corp. > Plano TX. 75074 > From: Shalom Bresticker <Shalom.Bresticker@motorola.com> To: tiao@agere.com Cc: btf-bugs@boyd.com Subject: Re: errata/44: For page 64, Section 4, example 4.4.3 -- value can't be verified Date: Wed, 10 Oct 2001 08:55:36 +0200 --------------AE2BD114949BA345F7BD2935 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Following up on Adam's reply: 'h f * 'h a = `d 150 = `h 96. That is, a * b is indeed 96 in hex. However, since a number without a base format specification is considered decimal, the "96" should have been written either as "150" (i.e., decimal) or as " 'h 96". (Then, when the `h96 is truncated to 6 bits, you get 6'h16.) So yes, this is a typo. But I think the entire example would have been clearer if all the numbers were written in decimal. I.e., "a = 4'd10 ; b = 4'd15 ; $display ("a*b=", a*b) ; output: a*b=22 // Output was truncated from 150 to 22 because expression size is 6 bits" But there is yet another typo in this example: All the $display statements in this example use the format "%x". This format is not defined in IEEE-1364 (see 17.1.1.2). While it may be informally supported by some of the tools, it is not part of the standard. Presumably the intent here was "%h". Shalom tiao@agere.com wrote: > For page 64, Section 4, example 4.4.3, > I can't seem to verify the value, > though all of the resulting bit sizes seemed correct. > > if > a = 4'hF > b = 6'ha <-- is this 'a'? > > if so, how can a * b results in a value of 96? > the expression size is 6, and this is indeed correct. -- ************************************************************************** Shalom Bresticker Shalom.Bresticker@motorola.com Motorola Semiconductor Israel, Ltd. Tel #: +972 9 9522268 P.O.B. 2208, Herzlia 46120, ISRAEL Fax #: +972 9 9522890 ************************************************************************** --------------AE2BD114949BA345F7BD2935 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> Following up on Adam's reply: 'h f * 'h a = `d 150 = `h 96.
That is, a * b is indeed 96 in hex.
However, since a number without a base format specification is considered
(Then, when the `h96 is truncated to 6 bits, you get 6'h16.)
So yes, this is a typo.
But I think the entire example would have been clearer if all the
output:
But there is yet another typo in this example:
All the $display statements in this example use the format "%x".
This format is not defined in IEEE-1364 (see 17.1.1.2).
Shalom
tiao@agere.com wrote:
if
if so, how can a * b results in a value of 96?
-- ************************************************************************** Shalom Bresticker Shalom.Bresticker@motorola.com Motorola Semiconductor Israel, Ltd. Tel #: +972 9 9522268 P.O.B. 2208, Herzlia 46120, ISRAEL Fax #: +972 9 9522890 ************************************************************************** --------------AE2BD114949BA345F7BD2935-- |
Unformatted |
|
Hosted by Boyd Technology