This document provides study material for Discrete Mathematics. It includes solved assignments and essays on various topics related to Discrete Mathematics. The document also discusses the representation of numbers in different number systems and the storage of characters in computer systems.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
1 DISCRETE MATHEMATIC Student’s Name: University Affiliation:
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
2 Problem 1 The maximum value of the exponential x in 12-bits can be found as; 10x=22047which tends to x=616. As a result, the maximum positive number in 12 bits 2’s complement is 2047. But 2047 is equivalent to 011111111111 in binary system. You notice that the decimal component i.e 2047 is obtained by converting 011111111111 as illustrated below; (1024 +512 +256 +128 + 64 + 32 + 16 +8 + 4 +2 + 1)~(01 111 1 1 1 1 1 1 1 1 ) 2047. Problem 2 To find the values of a 12-bits representation of a signed integer, the following steps are involved; i)Find the positive value. ii)Switch to 1s and 0s. iii)Add 1. This can be expressed as; (-128 + 64 + 32 +16 + 8 + 4 + 2 + 1) = -95 (-128 + 0+ 32 + 0 + 0 + 0 + 0 +0 + 1) = -95 (1 0 1 0 0 0 0 0 1) Problem 3 Computers use a form of scientific notation for floating point representation. The numbers themselves are written in scientific notation that have got three components as a whole. Therefore, 121.12 can also be expressed in scientific notation;
3 121.12=1.2112 * 103 But; 121 can be expressed to be equivalent to (64 +32 + 16 + 8 + 0 + 0 + 1) in a 12- bits notation. This gives, (1 1 1 1 0 0 1) ~ exponent However, this is not the exact; You can also express 1.2112 * 103as 0.12112 * 104 Hence, you can use your 13 biased experiment and add 4 to give; 1710=(16+0+0+0+1) ~(1 0 0 0 1 )~ mantissa But; The floating-point number is represented as sign| mantissa |Exponent; Expressed as 0 |1 0 0 0 1 | 1 1 1 1 0 0 1| The integer number is a positive hence expressed as o in the float. Problem 4 The number stored in question 3 is not exact due to some errors. The errors can be corrected by finding the quotient value; 1 1 1 0 =1 0 0 0 1√1 1 1 1 0 0 1 -1 0 0 0 1 11 1 1 1 1 1 1 0 -1 1 1 1 1 -1 00 0 1
4 1 0 10 Hence the exact number to be stored is given as 1 1 1 0. Problem 5 The bits in electronic form can only take two values i.e. 0 and 1. A letter is usually stored using a byte (8 bits) which should be confirmed, otherwise, a challenge. “Bob” is a text which is stored on a computer by first converting each character to an integer and then storing the integer. For instance, You are to store “B” as 66, and “O” as 79 as the integer numbers assigned. But, “Bob” have got three characters each with independent integer values. This is equivalent to; 66 + 66 + 79 =211. 211~(128 +64 +32+ 0+ 0 + 4 + 2 +1+ 1) =(1 1 1 0 0 1 1 1 1) Therefor, “Bob” would be stored as 9 bits in the computer system. Problem 6 To get the actual pattern required to store “Bob”, You are required to assign a different pattern of bits to each of the characters. For instance, “Bob” has got only three characters. Each is usually stored in 8 bits but with limitations, with one wasted bit. The first bit in each of the 8 bits pattern is a 0. To confirm the pattern; Let character “B” and “b” be represented by 66 as the integer values and character “o” as 79.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
5 Therefore, B~66 = (64 + 0 + 0 + 0 + 0 + 2) (10 0 0 0 1) Hence the pattern would be (0 1 0 0 0 0 1) O~79= (64 + 0 + 0 + 8 + 4 + 2 + 1) = (1 0 0 1 1 1 1) The exact pattern is (0 1 0 0 1 1 1 1) Problem 7 The decimal number system is also known as base 10, consisting of ten numerals i.e. 0 to 9, where 9 refer to the 10th item. You are to represent the current state of 24-bits as a single hexadecimal. 0 1 0 1 0 0 1 1 1 11 1 1 1 1 0 1 0 1 1 1 1 1isthe24-bits Youcan convert this to a binary system and decimals; 0 1 0 1 0 0 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 =217– 1 =131072-1 =131071. Hence,131071 is the decimal value. To convert this to hexadecimal, you subtract one. i.e. 131071-1 =131070. Problem 8 From a string, one character is often equivalent to 8 bits. But 0 1 0 1 0 0 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 01is a 24 bits system. You are asked to determine the characters involved in the 24-bits system.
6 If one character is equivalent to 8 bits, how many characters are involved in a 24-bits system? =24/8 = 3 From table 1,the characters;”CAN”,”HTS”,”SOS”,”ESA”,”EPA”,HTJ”,”XXX” possibly are involved. Problem 9 If 24-bits are used for binary presentation, you are to select the bias in such a way that you split the range equally, that is, you can choose a bias of 2n-1- 1. However, there is a specified range of values that can be expressed in 24 – bits. For instance; 224-1-1=8388607 is a decimal value This can also be represented as 8388607 + 23=8388630 ads a decimal value. Problem 10 You are to express the binary number system to decimal in finding the pair of single precision floating point number representation of 24-bits. 2n=10x But n=24, Hence; 224=10x 10x=16777216 Xlog10=log16777216 X=7.2247
7 You can then use your 25 biased experiment and add 7.22247 to get 32.224710 But; 32.224710= (32 + 0) = (1 0) Similarly; 32.2247= (16 + 8 + 4 + 2 + 1 + 1) = (1 1 1 1 1 1) Problem 11 In double precision, the smallest positive floating-point number is the positive number closest to zero. This is represented as the demoralized value with all 0’s in the exponential field and binary value 1 in the fraction field. This is given as; 2-52* 2-1022 Which is equivalent to; 4.94066 * 10-324 Problem 12 You are to use the procedure below; i)Find the positive value. ii)Switch to 0s and 1s Add 1. For instance; -121.12 ~121.12
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
8 This can be expressed to the scientific notation; 121.12=1.2112* 102=0.12121* 103 This is equivalent to; 121.12= (64 + 32 +16 +8 +4 +2 +1) = (1 1 11 1 1) This can be represented as; 1|1 0 0 0 1|1 1 1 1 0 01| Problem 13 Use Pseud0-code, for values of F, thus, converted to a single execution. F͢True While F =TRUE Input F F1= 0 F2=--5 F3=10 Print -F Input count, If CONT=1 F ͢FALSE. End while. Problem 14 L0=TRUE While l0=TRUE.
9 Input l L1=20 L2=128 L3=210. Print l0and l Input COUNT If count=1 L0͢False. End if End while.
10 Reference Knill, E. (1996).Conventions for quantum pseudocode(No. LA-UR-96-2724). Los Alamos National Lab., NM (United States). Erin Liong, V., Lu, J., Wang, G., Moulin, P., & Zhou, J. (2015). Deep hashing for compact binary codes learning. InProceedings of the IEEE conference on computer vision and pattern recognition(pp. 2475-2483).
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser