Module 1 Assignment: Binary Scientific Notation and Number Systems

Verified

Added on  2022/09/22

|4
|1034
|33
Homework Assignment
AI Summary
This assignment solution addresses several core concepts in computer science, particularly those related to number representation. The solution begins by explaining why a given floating-point value cannot be represented in a 4-bit sign-magnitude representation due to limitations in the available bits for exponent representation, leading to overflow. It then demonstrates how the same value would be represented in a 32-bit single-precision format, detailing the allocation of bits for the sign, exponent, and mantissa. The solution also includes examples of converting binary numbers in two's complement to their decimal equivalents, and representing negative numbers in 4-bit two's complement form. The solution further explores floating-point number precision by 'sandwiching' the exact value between two closest values in a binary system, calculating the binary representation of a decimal number, determining the two closest binary values, calculating sums in 4-bit representation, and determining the percentage difference between the maximum representable value and the actual result. The solution also includes the derivation of a logic expression from a given truth table.
tabler-icon-diamond-filled.svg

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Solutions
Sol-a
Part(i) In binary scientific notation, a decimal number is expressed as
( -1)S × (1 + M) × 2E, where S = sign bit, M = Mantissa, E = (actual
Exponent+Bias)
Here, 3.1*10-9 = (0.0000000031)10 = (0.11)2* 2-28 = (1.1)2 * 2-29 = (1+0.1)2 * 2-29
Comparing with the standard form, in 4-bit sign magnitude representation, the mantissa =1000
But, the exponent = -29+127(in case of single precision) = 98 which needs more than 4 bits for its
binary notation. Hence, it cann’t be expressed in binary scientific notation with only 4-bit sign
magnitude representation. If expressed, it would cause overflow error due to smaller allocation of
register to store the bits.
Part(ii) In binary scientific notation, a decimal number is expressed as
( -1)S × (1 + M) × 2E, where S = sign bit, M = Mantissa, E = (actual
Exponent+Bias)
3.1*10-9 = (-1)0 * (1+0.1)2 * 2-29
In single precision i.e. 32-bit word register, 1 bit is allocated for sign bit, 8 bits for exponent
and 23 bits for Mantissa. Sign bit = 0. Mantissa = 00000000000000000000001. The exponent
= actual exponent +bias = -29+127 = 98 = (01100010)2
Hence, the binary word is,
S E M
0 01100010 00000000000000000000001
Part(iii) (1011)2 in 2’s complement , is the representation of the decimal number ‘x’ that can be
found out by subtracting (0001)2 from the given number and then, taking the 1’s complement of the
resulting number .
Hence, x = 1’s complement of {(1011)2-(0001)2 } = 1’s complement of (1010)2 =negative of (0101)2 =
¿5.
Part(iv) In 4-bit 2’s complement representation, (-1)10 can be represented as follows:
We know that (1)10 = (0001)2.
A negative number is represented as 2’s complement of its magnitude representation.
The 2’s complement is represented as 1+one’s complement representation of the number.
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
So, (-1)10 = (0001)2+(1110)2 = (1111)2
Sol-b
Part(i) Multiplying 0.4062510 by 2, we get 0.812502.
The integer part of 0.812502 = 0
Again, multiplying the fractional part of last product, 0.812502 by 2 gives 1.625004
The integer part of 1.625004 = 1
Multiplying the fractional part of last product, 0.625004 by 2 gives 1.250008
The integer part of 1.250008 = 1
Multiplying the fractional part of last product, 0.250008 by 2 gives 0.500016
The integer part of 0.500016 = 0
Multiplying the fractional part of last product, 0.500016 by 2 gives 1.000032
The integer part of 1.000032 = 1
Multiplying the fractional part of last product, 0.000032 by 2 gives 0.000064
The integer part of 0.000064= 0
Multiplying the fractional part of last product, 0.000064 by 2 gives 0.000128
The integer part of 0.000128= 0
Multiplying the fractional part of last product, 0.000128 by 2 gives 0.000256
The integer part of 0.000256= 0
Multiplying the fractional part of last product, 0.000256 by 2 gives 0.000512 …
and this stream of (integer part =0) continues for next ten such steps.
Therefore, the binary representation of decimal number 0.4062510 can be written as
(0.011010000000000000)2 (0.01101)2
Part(ii) The two binary values that sandwich (0.01101)2 are (0.0110)2 and (0.0111)2
Part(iii) Sum of (0.01101)2 + (0.01101)2 = (0.11010)2 . In 4-bit representation, it is given as
(0.1101)2
When we add the min value twice, we get (0.0110)2 +(0.0110)2 = (0.1100)2
When we add the max value twice, we get (0.0111)2 +(0.0111)2 = (0.1110)2
Document Page
And, the only 4-bit number that is sandwiched between these sums is (0.1101)2
So, the sum of (0.01101)2 + (0.01101)2 = (0.1101)2 in 4-bit representation.
Also, on adding (0.01101)2 + (0.01101)2, we get (0.11010)2 that is equal to the above result.
Part(iv) In decimal notation, (0.1101)2 = 0.5+0.25+.0625 = 0.8125
Minimum value just smaller than 0.8125 that can be represented in 4-bit = 0.5+0.25 = 0.75
and the maximum value just greater than 0.8125 that can be represented in 4-bit =
0.5+0.25+0.0625+0.03125 = 0.84375
Part(v) The value of 0.4062510 + 0.4063510 = 0.812602
The maximum value found in part(iv) is 0.84375. So, the percentage of difference between max and
actual value = (0.84375-0.812602)*100/(0.812602) = 3.833 % 4 %
Sol-c
Part(i)
Part(ii)
If the truth table for a logic expression is given by
X Y Z Output
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 0
Document Page
Then, the logic expression must be X . Y . Z. This implies that when X = 1 and Y = 0 and Z = 0, then
only, the output is 1 else the output is always 0.
chevron_up_icon
1 out of 4
circle_padding
hide_on_mobile
zoom_out_icon
logo.png

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]