Questions from Sam's TextBook (1 Viewer)

Winston

Active Member
Joined
Aug 30, 2002
Messages
6,128
Gender
Undisclosed
HSC
2003
Hey Sam, i'm sure by now you'll be sooo sick of all these questions your going to unregister lol....

sorry i got some more quesys for you

in your text book


Page 345 Question 6

Page 353, Question 7,8,9,10

i'm stuck on those


Thanks
 

SamD

Member
Joined
Jul 21, 2002
Messages
256
Gender
Male
HSC
N/A
Set 10B Q6
10101010 (twos complement) in decimal is...

=-128 + 32 + 8 + 2
= -128 + 42
= -86 which is answer A

Set 10C Q7
Multiplying by 4 in binary is achieved by....

Try an example, say 8 * 4 =32 in binary

8 = 00001000 in 8 bit binary
32 = 00100000 in 8 bit binary

To get from 00001000 to 00100000 we've shifted all the bits 2 places to the left, so D is the answer.

Set 10C Q8
Dividing by 8 in binary is achieved....

This is the opposite of Q7 except 8 is 2^3 so we shift 3 places to the right. (Answer B)

Set 10C Q9
1/5 is approximately 1/8 + 1/16 + 1/128 so the binary division
1100100 / 101 could be performed....

Finding 1/5 of something is equivalent to dividing by 5 and 101 is 5 in binary.
So an approximation for dividing by 5 is to divide the original thing by 8 (shift 3 places right in binary), divide the original thing by 16 (shift 4 to the right), divide the original thing by 128 (shift 7 to the right). And then add up these three results. Answer A.

Try it in decimal say, 20/5 (which equals 4)

20/8 + 20/16 + 20/128 = 2.5 + 1.25 + 0.15625 = 3.90625 which is about 4. The more fractions you use the better the answer becomes.

Set 10C Q10
-100 + -100 in 8 bit twos complement, ignoring overflows...

-100 = -128 + 16 + 8 + 4 which in 8 bit twos comp binary is 10011100

10011100 +
10011100
----------------
100111000 but we lose the leading one as we've only got 8 bits, so the result is 00111000 which in decimal is 32+16+8 = 56. So the answer is C.

We get the answer 56 because the system has "overflowed". It's gone round the loop, so to speak. The answer in decimal is -200, what's happened is that we've gone past -128 and back into the positives, through 127, 126, etc... in fact we've gone past 72 positives and ended up at 56. (NB. -128 - 72 = -200).

HTH
Sam
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top