Number | 49
|
Category | errata
|
Synopsis | Section 4.4.3: incorrect output in example
|
State | lrmdraft
|
Class | errata-simple
|
Arrival-Date | Oct 14 2001
|
Originator | Shalom.Bresticker@motorola.com
|
Release | 2001b, 4.4.3
|
Environment |
http://boydtechinc.com/btf/archive/btf_1999/0694.html |
Description |
Date: Wed, 10 Oct 2001 09:06:34 +0200 Can someone explain to me the following: reg [3:0] a ; reg [5:0] b ; reg [15:0] c ; initial begin a = 4'hf ; b = 6'ha ; ... c = a**b ; // expression size is determined by c $display ("c=%x", c) ; end Why is the output c=21 // example size is 16 bits (size of c) ? * * According to my calculator, 'hf**'ha = 86430aac61, which should have been truncated to "ac61" ? |
Fix |
Passed 10/7/02: Section 4.4.3 example: REPLACE: c=21 // example size is 16 bits (size of c) WITH: c=ac61 // expression size is 16 bits (size of c) |
Audit-Trail |
From: Steven Sharp <sharp@cadence.com> To: btf-bugs@boyd.com, Shalom.Bresticker@motorola.com Cc: Subject: Re: errata/49: another error in 4.4.3 ? Date: Mon, 15 Oct 2001 15:45:42 -0400 (EDT) >Why is the output > c=21 // example size is 16 bits (size of c) >? >* * >According to my calculator, 'hf**'ha = 86430aac61, >which should have been truncated to "ac61" ? Well, 21 is the result truncated to 6 bits. Perhaps someone thought the result would be 6 bits when they calculated the original result. Note that the widest object if the LHS is not considered is 6 bits. Perhaps the comment got fixed to say the width was 16 bits, but the resulting printed value did not get adjusted accordingly. Steven Sharp sharp@cadence.com |
Unformatted |
|
Hosted by Boyd Technology