Tutorial 2
Tutorial 2
Tutorial Assignment: 2
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.
To convert the octal to hexadecimal: In order to convert the octal number into binary, we need to express
every octal value using 3 binary bits. And after that, we need to group every 4 binary bits and calculate the
value [From left to right]. For example: (41)8 = 100 001. Combine the groups = (100001)2. Divide the binary
digits from previous groups of 4 digits, starting from the right. = 0010 0001. Convert each group of 4 binary
digits into 1 hexadecimal digit. 0010 = 2, 0001 = 1, = (21)16.
Tutorial on Number system
Conversion of Decimal to Other Number Systems
To convert a decimal number to binary we need to divide the given number by 2 until the quotient is
equal to 0. We keep the remainders aside during the division process. Once the quotient is equal to zero, we
write the remainder along with the last numbers starting from the bottom to the top to obtain the binary number.
For example, (20)10 = (10000000)2
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:
13. Which number system has a base value of 16 and includes numbers from 0 to 9 and the letters A
to F?
a) Binary
b) Octal
c) Decimal
d) Hexadecimal
Answer: d) Hexadecimal
14. How do you convert the binary number (10101)2 to its decimal equivalent?
b) Divide by 2 until the quotient is zero, then write the remainders in reverse order.
d) Divide by 4 until the quotient is zero, then write the remainders in reverse order.
Answer: b) Divide by 2 until the quotient is zero, then write the remainders in reverse
order.
17. What is the hexadecimal equivalent of the binary number 0001 0101?
a) 13
b) 14
c) 15
d) 16
Answer: c) 15
18. Which of the following is not a correct extension for a Python file?
a) .py
b) .p
c) .python
d) .pl
Answer: b) .p and d) .pl
19. How do you convert the decimal number (45)10 to its octal equivalent?
a) Divide by 2 until the quotient is zero.
b) Divide by 16 until the quotient is zero.
c) Divide by 8 and record the remainders, then write the remainders in reverse order.
d) Divide by 4 until the quotient is zero.
Answer: c) Divide by 8 and record the remainders, then write the remainders in reverse
order.
20. Convert the hexadecimal number (100)16 to its binary equivalent.
a) 1100000
b) 100000000
c) 1010101
d) 1110000
Answer: b) 100000000
21. What is the first step to convert a hexadecimal number to a binary number?
a) Convert it to decimal first
b) Convert it to octal first
c) Group into sets of four bits from the right
d) Divide by 2 and record the remainders
Tutorial on Number system
Answer: c) Group into sets of four bits from the right
22. Convert the hexadecimal number (100)16 to its decimal equivalent.
a) (250)10
b) (255)10
c) (256)10
d) (257)10
Answer: c) (256)10
23. What is the base value of the Decimal number system?
a) 2
b) 8
c) 10
d) 16
Answer: c) 10
24. Convert the decimal number (45)10 to its octal equivalent.
a) (54)8
b) (55)8
c) (56)8
d) (57)8
Answer: b) (55)8
25. What is the first step to convert a decimal number to hexadecimal?
a) Divide by 2 and record the remainders
b) Divide by 4 and record the remainders
c) Divide by 8 and record the remainders
d) Divide by 16 and record the remainders
Answer: d) Divide by 16 and record the remainders
26. What is the decimal equivalent of the octal number (254)8?
a) (172)10
b) (170)10
c) (168)10
d) (166)10
Answer: a) (172)10
27. How is the decimal number (1032)10 converted to its octal equivalent?
a) Divide by 2 until the quotient is zero
b) Divide by 8 until the quotient is zero
Tutorial on Number system
c) Divide by 16 until the quotient is zero
d) Divide by 4 until the quotient is zero
Answer: b) Divide by 8 until the quotient is zero
28. Convert the decimal number (1032)10 to its octal equivalent.
a) (2010)8
b) (1770)8
c) (2050)8
d) (3000)8
Answer: a) (2010)8
29. Convert the octal number (11672)8 to its hexadecimal equivalent.
a) (13BA)16
b) (4EA)16
c) (4DA)16
d) (4CA)16
Answer: a) (13BA)16