Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: Fixed point number truncation ... Help !!!!!

$
0
0
The range of b is -4 to 3.875. It overflowed and saturated when you assigned a value of 6.375 into it.

Best wishes,
Tom Bryan


"Dinesh" wrote in message <kud3ln$jfa$1@newscl01ah.mathworks.com>...
> Hi,
>
> I have tried the following.
>
> a = fi(6.375,1,8,4,'Roundmode','floor');
> >> b = fi(0,1,6,3,'Roundmode','floor');
> >> b(1) = a
>
> b =
>
> 3.8750
>
> DataTypeMode: Fixed-point: binary point scaling
> Signedness: Signed
> WordLength: 6
> FractionLength: 3
>
> RoundingMethod: Floor
> OverflowAction: Saturate
> ProductMode: FullPrecision
> SumMode: FullPrecision
> >> a.bin
>
> ans =
>
> 01100110
>
> >> b.bin
>
> ans =
>
> 011111
>
> But the answer that I expected was 011011
> Can you please tell me if I am missing anything

Viewing all articles
Browse latest Browse all 19628

Trending Articles