Week2 - Set 4 (Thursday)
Week2 - Set 4 (Thursday)
Tutorial Assignment: 1
CO Mapping
Name CO1 CO2 CO3
Number System Conversion ✓ - -
In computer applications the Binary numbers are represented by only two symbols or digits, i.e. 0 and 1. The
binary numbers here are expressed in the base-2 numeral system. For example, (101)2 is a binary number. Each
digit in this system is said to be a bit. The Octal number system has base value equal to 8 and comprise
numbers 0 to 7. The Decimal number system is the number system that we use on a daily basis based on the
10 digits (0-9). The Hexadecimal number system number system has a base value equal to 16. containing
numbers from 0 to 9 and the capital letters A to F to represent its Binary or Decimal number equivalent.
Conversion of Binary to Other Number Systems
To convert a binary number to octal number then Group all the 1's and 0's in the binary number in
sets of three, starting from the far right. Add zeros to the left of the last digit if you don't have enough digits to
make a set of three. Add up the new numbers in each set of three. For example: 10101 2 is the binary number.
We can write the given binary number as: 010 101. Now as we know, in the octal number system, 010 → 2 and
101 → 5. Therefore, the required octal number is (25)8.
To convert the binary number to decimal is equal to the sum of binary digits (dn) times their power
of 2 (2n). For example: (10101)2 = 1 × 24 + 0 × 23 + 1 × 22 + 0 × 21 + 1 × 20 = 16 + 4 + 1 == (21)10.
To convert binary number to hexadecimal: Divide the binary digits into groups of four (starting from
right) for integer part and start from left for fraction part. Convert each group of four binary digits to one
hexadecimal digit. For example: 0001 0101 = (15)16.
To convert decimal to octal, the decimal number is divided by 8 and record the remainders. Once the
quotient is less than 8, we obtain the octal number by writing the remainder in reverse order. For example, (45)10
= (55)8
The decimal to hexadecimal conversion is done similarly to the other two number systems. The base number
of hexadecimal is 16 so the number needs to be divided by 16 until the quotient is zero.
Questions:
1. What does pip stand for python?
a) unlimited length
b) all private members must have leading and trailing underscores
c) Preferred Installer Program
d) none of the mentioned
2. Which of the following is not a core data type in Python programming?
a) Tuples
b) Lists
c) Class
d) Dictionary
b. (2020.65625)10
c. (172)10
d. (172.983)10
9. What least digit should come in place of # in the 9-digit number 15549#325, for which the
number is divisible by 3?
10. Convert following
a. binary number into octal representation?
a) 110111
b) 001011010
b. Convert following binary number to decimal representation.
a)110111
b)001011010
c. Convert following binary number to hexadecimal representation?
a)110111
b) 00101101