Here you can ask questions and find or give answers to organizational, academic and other questions about studying computer science.

1.2k questions

1.3k answers

1.7k comments

581 users

0 votes
t[i+1] = (ds>=D?1:(ds<=−D?−1:0));

we got this expression for calculating a transfer digit array.

but X = (4,-5,3,6) Y= (1,-2,3,6)

but on page 18 we got transfer digit as = [(0, −1, 1, 1, 0)] but when calculating by self I am getting [0,0,-1,1,1]

t[0] = 0;

t[1] = 4+1>=6 false ...> 5<= -6 false then 0

t[2] = -5-2 >= 6 false ...> -7<=-6 true then -1

t[3] = 3+3>=6 true then 1

t[4] = 6+6>=6 true then 1.

can you clarify this
in # Study-Organisation (Master) by (500 points)

1 Answer

0 votes

The calculation on page 18 is correct and is done in detail as shown below. It seems to me that you were reading the digits in the wrong order, since (4,-5,3,6) has most significant digit 4 which you consider as least significant digit. 

The computation should be as follows for the signed digit numbers to base B=10 with digit set -6,...,+6:

    x[0] := 6
    x[1] := 3
    x[2] := -5
    x[3] := 4

    y[0] := 6
    y[1] := 3
    y[2] := -2
    y[3] := 1

For them, we compute the transfer digits in a first step:

    t[0] := 0
    t[1] := (x[0]+y[0]>=6?1:(x[0]+y[0]<=-6?-1:0)) = (12>=6?1:...) = 1
    t[2] := (x[1]+y[1]>=6?1:(x[1]+y[1]<=-6?-1:0)) = ( 6>=6?1:...) = 1
    t[3] := (x[2]+y[2]>=6?1:(x[2]+y[2]<=-6?-1:0)) = (-7>=6?1:(-7<=-6?-1:0)) = -1
    t[4] := (x[3]+y[3]>=6?1:(x[3]+y[3]<=-6?-1:0)) = (5>=6?1:(5<=-6?-1:0)) = 0

Hence, we compute the sum digits as

    s[0] := x[0]+y[0]+t[0]-t[1]*10 = 2
    s[1] := x[1]+y[1]+t[1]-t[2]*10 = -3
    s[2] := x[2]+y[2]+t[2]-t[3]*10 = 4
    s[3] := x[3]+y[3]+t[3]-t[4]*10 = 4
    s[4] := t[4] = 0

by (171k points)

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Aug 15, 2020 in * TF "Emb. Sys. and Rob." by SKH (350 points)
Imprint | Privacy Policy
...