Cs 101 Assignment..
Cs 101 Assignment..
Tanvir Afzal
Submitted By: Sania Tanveer
Student ID: mc210204427
Course name: Introduction to computing
Course code: CS 101
Assignment No: 01
Question: No: 01
(A)
Encode the following decimal fractional value to binary floating point notation using the
8-bit floating-point format.
Solution
-3.5
Mantissa field:
0111
011.1
So exponent is positive 3…
1 1 1 1 0 1 1 1
Decode the following 8-bit floating point binary value to decimal fractional value.
00101100
0 0 1 0 1 1 0 0
Mantissa is:
.1100
.1100
010
It is in 3-bit excess notation-4:
-2
Exponent is negative so shift radix (.1100) left
.001100
Convert it into decimal fractional value
.001100 is equal to .0011
. 0 0 1 1
0+0+1/8+1/16=0.1875 Answer
Question No: 02
Perform the binary addition on the following decimal numbers.
46( 3/8) and 92(7/8)
Solution
Convert into binary
46(3/8)=101110.0110
92(7/8)=1011100.1110
Now,
Addition
1+0=1
1+1=0 (1 carry)
1+1+1=1(1 carry)
0+1=1
1 0 1 1 1 0 0 . 1 1 1
0 1 0 1 1 1 0 . 0 1 1
+
1 0 0 0 1 0 1 1 . 0 1 0
So,
10001011.010 Answer
Question No: 03
The logical operations (AND, OR, NOT, and XOR etc.) discussed in the video
lessons can be combined to perform some specific operations. Two such operations
(circuits) are depicted in the first column “Circuits” of the following table. You are
required to determine the output of each of the following circuits for the input values
given in column 2 and column 3.
Solution
INPUTS OUTPUT 0 0
INPUTS OUTPUT 0 1