MATH 243 Homework Solution: Exploring Number Systems and Arithmetic

Verified

Added on  2023/06/05

|8
|944
|116
Homework Assignment
AI Summary
This document presents the solutions to a MATH 243 assignment, covering various aspects of number systems and arithmetic. The solutions include conversions between hexadecimal, decimal, and binary number systems, along with arithmetic operations in different bases, such as addition, multiplication, and division. The assignment also explores the division algorithm, bitwise operations (left bit shift and LSR), and modular exponentiation. Specific problems address converting decimal numbers to hexadecimal, performing hexadecimal and binary arithmetic, determining memory addresses, and applying the division algorithm. Additionally, the solution details how to calculate the number of digits in binary, octal, and decimal expansions of a given number and applies the fast modular exponentiation algorithm. The final question involves calculating a summation involving powers of 16. Desklib provides this and other solved assignments.
Document Page
Running head: MATH 243 1
Math 243
Name
Institution
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
MATH 243 2
Question 1
4134 6=(2584 ×16)+2
2584=(161×16)+8
161=(10 ×16)+1
10= ( 10× 0 ) +10=0+10= A
Reading the remainders upwards we get: A182
Therefore, 4134 6 in hexadecimal equals A182.
Question 2
+ FFAC
31 A 1
1314 D
In the first, second and the third column from the right, we had to carry a 1 since A+A and F+1
and F+3 exceed the (decimal) value 16. Therefore, the answer is 1314D.
Question 3
10000011
× 1001
10000011
00000000
00000000
10000011
10010011011
The answer is 10010011011
Question 4
Document Page
MATH 243 3
Part a
The addresses of 5 bytes within a pixel are ...ZZZ 00 , ... ZZZ 01 ,... ZZZ 10... ZZZ 11. Therefore,
the offset is formula is ...ZZZ xy where xy is the pixel position.
Part b
The right most bit which is 7. That is bit y XXX 0 y.
Question 5
We know that a left bit shift is equivalent to multiplication by 2. Multiplying a given quantity n
by 40=25 +23 which can be achieved through the following way: First, 3 successive left bit shifts
of n. and store the result in the memory. Second, additional left bit shifts of n. Then, add the
results obtained in the preceding steps and store the result in memory which is the product, 40n.
Question 6
Part a
The algorithm is known as division algorithm.
Part b
For given integers a and d given that d 0, there are unique integers q and r with 0 r <d such
that a=qd +r
Part c
The LSR represents the special case of the Division Algorithm with d=2, which is equal to (10)2
in binary form.
Part d
Document Page
MATH 243 4
The value produced by LSR is q (the quotient)
The carry flag produced by LSR is r (the remainder)
Question 7
Part a
(FA 3 C)16 ×(10)16
Add a zero at the end of FA 3 C the same way we do in decimal notation to get:
(FA 3 C)16 ×(10)16=(FA 3 C 0)16
Part b
(10111)2 ×(10)2
10 1 11
× 1 0
00000
10111

101110
(10111)2 ×(10)2=(101110)2
Part c
For any base b, add a zero at the end of that number when multiplying by (10)b.
Question 8
Part a
(E 1 F 9 D)16 ÷(10)16
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
MATH 243 5
We get the quotient and remainder as:
(E 1 F 9 D)16 ÷(10)16=(E 1 F 9)16 ×(10)16 + D
Quotient=(E 1 F 9)16 ×(10)16=( E 1 F 90)16remainder=D
Part b
(10110101)2 ÷(10)2
(10110101)2 ÷(10)2=(1011010)2 ×(10)2 +(1)2
Quotient=(1011010)2 ×(10)2=(10110100)2
Remainder=(1)2
Part c
For any base b, a number divided by (10)b , the quotient will be the same number with the last
digit replaced with a zero whereas the remainder will be the last digit of the number.
Question 9
The largest octal number with 100 digits is
i=0
99
7 × 8i since the largest octal digit is 7. Using the
formula for the sum of the terms of a geometric sequence
i=0
99
7 × 8i=81001
Question 10
Part a
The number of digits k of the number n in the expansion b is k = [ logb n ]+1 so that:
Document Page
MATH 243 6
In binary, k = [ log2 2314159924 ] +1=31415924+1=31415925
Part b
In octal, k = [ log8 2314159924
] +1= 31415924
3 + 1=10471974.67 10471975
Part c
In decimal, k = [ log10 2314159924 ] +1=31415924+1=310471975 log10 2
¿ 310471975 ×0.301029995 9457136
Question 11
We first determine the binary form of the exponent. Repeated division by 2 shows that
65536=216.We now perform the fast modular exponentiation algorithm.
720
mod 13=71 mod 13=7
721
mod 13=72 mod 13=10
722
mod 13=102 mod 13=9
723
mod 13=81mod 13=3
724
mod 13=9 mod 13=9
Note that, the 102 in the third equation was obtained by squaring 10 in step 2. Otherwise, the
main point of the algorithm could have been lost. We stop since we have obtained the second
remainder 9 implying that the remainders are repetitive in a cycle of 2.
In case of exponent 16, 7216
mod 13=722
mod 13=9
Document Page
MATH 243 7
Question 12
¿
k=0
n1
12. 16k
¿ 12 ( 16n1
161 )
¿ 12
15 ( 16n 1 )
¿ 4
5 (16n 1 )
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
MATH 243 8
chevron_up_icon
1 out of 8
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]