logo

Question 1.. a) Determine the value of base b if (152)b = 0x6A.

   

Added on  2022-11-29

8 Pages2102 Words1 Views
 | 
 | 
 | 
Question 1.
a) Determine the value of base b if (152)b = 0x6A. Please show all steps. [3 marks]
0x6a = 161 x 6 + 160 x 10
= 96 + 10
= 106
152b = = b2 x 1 + b1 x 5 + b0 x 2 = b2 + 5b + 2
Since both values are equal then
b2 + 5b + 2 = 106
(b + 13) ( b – 8 ) = 0
The solution for b is -13 and +8. –ve base would result in values less than 1. So base
must be +ve number i.e. 8
b) Convert the followings: (Please show all steps; no marks will be awarded if no steps are
shown) [1.5x4 = 6 marks]
i) 0xBAD into 3-base representation
0xBAD = 162 x 11 + 161 x 10 + 160 x 13
= 2816 + 160 + 13
= 2989 in decimal
Converting this to Base 3 using repeated division
2989 / 3 = 996 R 1
996 / 3 = 332 R 0
332 / 3 = 110 R 2
110 / 3 = 36 R 2
36 / 3 = 12 R 0
12 / 3 = 4 R 0
4 / 3 = 1 R 1
1/ 3 = 0 R 1
0x BAD = 110022013
ii) 3217 into 2-base (binary) representation
Converting 3217 to base 2 using repeated division
3217 / 2 = 1608 R 1
1608 / 2 = 804 R 0
804 / 2 = 402 R 0
402 / 2 = 201 R 0
Question 1.. a) Determine the value of base b if (152)b = 0x6A._1

201 / 2 = 100 R 1
100 / 2 = 50 R 0
50 / 2 = 25 R 0
25 / 2 = 12 R 1
12 / 2 = 6 R 0
6 / 2 = 3 R 0
3 / 2 = 1 R 1
1 / 2 = 0 R 1
3217 = 110010010001b
iii) 1235 into octal representation
Converting 1235 to base 8 by repeated division
1235 / 8 = 154 R 3
154 / 8 = 19 R 2
19 / 8 = 2 R 3
2 / 8 = 0 R 2
1235 = 23238
iv) 21.218 into decimal representation
c) Given a (very) tiny computer that has a word size of 3 bits, what are the lowest value
(negative number) and the highest value (positive number) that this computer can represent in
each of the following representations? [3 marks]
i) One's complement
Highest Positive Value = 2(3-1) -1 = + 3
Highest Negative Value = - (2(3-1) -1) = -3
ii) Two's complement
Highest Positive Value = 2(3-1) -1 = + 3
Highest Negative Value = - (2(3-1)) = -4
iii) Signed Magnitude
Highest Positive Value = 2(3-1) -1 = + 3
Highest Negative Value = - (2(3-1) -1) = -3
Question 1.. a) Determine the value of base b if (152)b = 0x6A._2

Question 2.
a) The Fibonacci numbers are the numbers in the following integer sequence, called the
Fibonacci sequence, and are characterised by the fact that every number after the first two is
the sum of the two preceding ones: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 114, ... etc.
By definition, the first two numbers in the Fibonacci sequence are 0 and 1, and each
subsequent number is the sum of the previous two. We define Fib(0)=0, Fib(1)=1, Fib(2)=1,
Fib(3)=2, Fib(4)=3, etc. The first 22 Fibonacci numbers given below:
Fib(0)
Fib(1)
Fib(2)
Fib(3)
Fib(4)
Fib(5)
Fib(6)
Fib(7)
Fib(8)
Fib(9)
Fib(10)
0
1
1
2
3
5
8
13
21
34
55
Fib(11)
Fib(12)
Fib(13)
Fib(14)
Fib(15)
Fib(16)
Fib(17)
Fib(18)
Fib(19)
Fib(20)
Fib(21)
89
144
233
377
610
Question 1.. a) Determine the value of base b if (152)b = 0x6A._3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents