number system assignment2013

advertisement
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
Page No
1
Quick review:

Number System can be categorized in two systems:(a) Non-Positional Number System
(b) Positional Number System




Decimal System has Base 10 and valid digits - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Binary System has Base 2 and valid digits - 0, 1
Octal System has Base 8 and valid digits - 0, 1, 2, 3, 4, 5, 6, 7
Hexadecimal System has Base 16 and valid digits - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B,
C, D, E, F where A refers to decimal 10, B refers to decimal 11, etc.
Decimal number without fractions gets converted to any other number by
repeated division method For binary divide by 2 for octal number divide by 8
and for hexadecimal number divide by 16.
Decimal numbers with fractions gets converted to any other number


Number conversion
Decimal to binary
,octal ,hexadecimal
Binary to decimal
Without fractions
Divide by 2 for binary, divide by
8 for octal and divide by 16 for
hexadecimal
Add the weighted value to the
decimal number ( base 2) where
place holder is 0 to n
Fractions
Multiply fractional part by 2
in binary .
By 8 for octal and by 16 for
hexadecimal
Add the weighted value to
the decimal number ( base 2)
where fractional placeholder
is 2-1, 2-2………
2 2 , 2 1 ,2 0
Same applies for octal
and hexadecimal
Binary to octal
Binary to hexadecimal
Base 8 and 16 respectively
Base 8 and 16 respectively
Create a group of 3 bits ,add
trailing bits to the left with 0,
and assign the corresponding
value
Create a group of 4 bits ,add
Create a group of 3 bits and
add trailing bits to the right
with 0,assign the
corresponding value
Create a group of 4bits and
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
trailing bits to the left with 0
Octal and hexadecimal
to binary
Octal to hexadecimal
Hexadecimal to octal
Binary
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
Hex
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
Same as for integers
Same as for integers
Binary
Octal
000
001
010
011
100
101
110
111
0
1
2
3
4
5
6
7
Multiple Choice Questions :
1. Conversion of decimal number 6110 to its binary number equivalent is
b.1111002
c. 1100112
e. None of the above
d. 0011012
2
add trailing bits to the right
with 0
Write binary equivalent of
each digit after decimal
point towards right
Write binary equivalent of each
digit towards left. (For octal
form group of3bits and for
hexadecimal in 4bits)
First convert octal to binary then
binary to hexadecimal
First convert hexadecimal to
binary then binary to octal
a. 1100012
Page No
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
2.
Conversion of decimal number 9910 to its binary number equivalent is
a. 11000112
c. 1111012
3.
|29/8/2010
b.110011102
d. 111112
e. None of the above
Conversion of decimal number 7110 to its binary number equivalent is
a. 1100112
b.11100112
c. 01100112
d. 10001112
e. None of the above
4. Conversion of decimal number 8910 to its binary number equivalent is
a. 10110112
b.11001112
c. 10110012
d. 100112
e. None of the above
5. Conversion of decimal number 1310 to its octal number equivalent i
a. 158
b.178
c. 138
e. None of the above
d. 118
6. Conversion of decimal number 4210 to its octal number equivalent is
a. 578
b.428
c. 478
d. 528
e. None of the above
7. Conversion of decimal number 6710 to its octal number equivalent is
a. 1008
b.1038
c. 1098
e. None of the above
d. 998
8. Conversion of an octal number 31378 to its decimal equivalent is
a. 163110
b.163210
c. 153110
d. 193110
e. None of the above
Page No
3
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
9. Conversion of an octal number 1348 to a binary number is
a. 0010110112
b.0011011002
c. 0010111002
d. 1100112
e. None of the above
10. Conversion of an octal number 74328 to a binary number is
a. 11110001101112
b.1111000110102
c. 1100110101112
d. 1111111110002
e. None of the above
11. Conversion of hexadecimal number ID7F16 to a decimal number is
a. 755110
b.877110
c. 555710
e. None of the above
d. 778110
12. Conversion of hexadecimal number 6B216 to its binary number equivalent is
a. 11110001101112
b.0110101100102
c. 01100110011112
d. 111111112
e. None of the above
13. Conversion of binary number 11000112 to an octal number is
a. 1408
b.1438
c. 1478
e. None of the above
d. 1498
14. Conversion of binary number 10100002 to an octal number is
a. 1198
b.1018
c. 1118
d. 1208
e. None of the above
15. Conversion of binary number 1011102 to hexadecimal is
Page No
4
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
a. 358
b.468
c. 568
d. 508
e. None of the above
16. Conversion of binary number 11000112 to hexadecimal is
a. 6316
b.5716
c. 4616
e. None of the above
d. 4016
17. Conversion of a hexadecimal number 4E16 to binary number is
a. 10011012
b.10011102
c. 11011002
d. 1101112
e. None of the above
18. Conversion of a hexadecimal number 3A16 to binary number is
a. 11011012
b.1110102
c. 1001102
d. 1100112
e. None of the above
19. Conversion of a octal number 638 to its decimal number is
a. 5110
b. 6110
c. 5710
d. 5310
e. None of the above
20. Conversion of an octal number 1438 to its decimal number is
a. 9010
b. 97110
c. 9910
d. 10710
e. None of the above
21. Conversion of an octal number 1258 to its decimal number is
|29/8/2010
Page No
5
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
a. 9010
b. 8510
c. 8710
d. 9910
e. None of the above
22. Conversion of an octal number 1368 to hexadecimal number is
a. 7E16
c. 5A16
b. 5E16
d. 5D16
e. None of the above
23. Conversion of an octal number 1128 to hexadecimal number is
a. 4A16
b. 5A16
c. 1516
e. None of the above
d. 2016
24. Conversion of an octal number 568 hexadecimal number is
a. 2A16
b. 3A16
c. 2E16
d. F16
e. None of the above
25. Conversion of an octal number 208 to its binary number is
a. 1000010
b.1011110
c. 1011016
e. None of the above
d. 1111016
26. Addition of 1101012 and 1011112 is
a. 11001002
b.11010002
|29/8/2010
Page No
6
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
c. 11101112
|29/8/2010
d. 1100112
e. None of the above
27. Addition of 1101011012, 1110111012, 0001111112, 1001011012, 1111101112 is
a. 1011010111010 2
b.11110110000102
c. 1000101000101 2
e. None of the above
d.010010000000102
28. Subtraction of 1001011002 from 11101010102 is
a. 10010111102
b.01101000012
c. 11110000012
e. None of the above
d. 11110111112
29. Addition of 102 and 112 is
a. 1002
b. 1012
c. 1112
d. 1102
e. None of the above
30. Addition of 11012 and 10102 is
a. 101112
b. 110002
c. 110112
d. 101112
e. None of the above
Answers:
Page No
7
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
1)
|29/8/2010
Page No
8
a 2) a 3) d 4) c 5) a 6) d 7) b 8) a 9) c 10) b.
11) a 12) b. 13) b. 14) d 15) c 16) a 17) b 18) b 19) a 20) c.
21) b 22) b 23) b 24) c 25) a. 26) a 27) a 28)a 29) b 30) b
Solved Exercises:
1. Define the following terms:
a. Byte
b) unicode
a) Byte: A group of 8 bits is referred to as a byte.
b) Unicode :A symbol encoding system that uses 16 bits to represent of all world
languages. It can represent about 65536 symbols. Similar to ASCII, each symbol is
assigned a (16-bit) numerical code.
2.
A:
What is the importance of binary number system in building computers ?
A computer can represent information as electrical pulses or
magnetic fields. A computer uses and works with two voltage
states: high or low (to represent one bit of information). As such
it makes sense to use a number system that also just uses two
possible states: 1 or 0 (On or off).
3. Explain why the computer must convert between the decimal and
binary systems? (Why can’t it just store decimal numbers, for example?)
A:
The computer cannot and doesn’t store decimal numbers directly.
As stated above it can only store and transmit electrical pulses
(high or low). As such decimal numbers must be converted into a
sequence of 1’s and 0’s, which can then easily be translated into
high or low voltages.
4. How many distinct values can we represent with
a) 4 bits b) 5 bits
A: a) 24 =16
b) 25 = 32
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
5.
A:
|29/8/2010
Page No
9
What is the largest positive number one can represent in 5-bit 2’s complement
code?
25-1 -1 = 15
6. What is the largest number that can be represented if we use 6
bits? Show your work / reasoning.
A: We get the largest number by using all bits (digits). For 6 digits,
the number in binary will be 11 1111. In decimal,
11 1112 = 32 +16+ 8+4+2+1 = 6310
7. We could use the most significant digit to represent the sign of a number. If it is 1,
the number is negative. Otherwise, it is positive.
What problems do we run into if we use this system?
A:
The problem is that the arithmetic (addition and subtraction)
doesn’t give reasonable results. This can be illustrated with the
following example. Suppose we represent 5 and –5 using this
scheme. Then,
510 = 0000 01012 and -510 = 1000 01012
Now we know that 5 + (-5) = 0 and 010 = 0000 00002
But, when we add 0000 01012 and 1000 01012 together, we do not
get 010 as expected!
0000 01012
+ 1000 01012
-----------------1000 10102 = -1010
8. What is the general technique for converting a decimal number to binary?
A: The general technique for converting a decimal number to binary involves repeatedly
dividing the decimal number by 2 and then collecting the reminders to form the
binary answer. The steps are as follows:
i.
ii.
Divide the decimal number by 2.
Working from right to left, use the remainder as the next digit of your
binary answer.
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
iii.
|29/8/2010
Page No
10
Use the quotient from your previous division to repeat steps 1 and 2 until
you get zero for a quotient.
9. Which digit is the least significant digit of a number? Which digit is the most
significant digit of a number?
A: The rightmost digit is the least significant digit of a number, and the leftmost digit is
the most significant digit of a number. For example, in the number 2045.9610 the least
significant digit is 6 and the most significant digit is 2.
10. When converting a decimal number to binary with repeated division, does the
remainder from your first division represent the least significant digit of your
answer or the most significant digit of your answer?
A: The remainder from your first division represents the least significant digit of your binary
answer. When you convert integers from decimal to binary, you work from the least
significant digit to the most significant digit (i.e. right to left).
11.
A:
Convert the decimal numbers 0 - 15 to binary and list the answers in a table
beside their decimal equivalents. You should become familiar with these
numbers so that you do not need to use repeated division when you need to write
the binary.
The table below lists the the numbers 0 - 15 in binary and decimal.
B
D
B
D
B
D
B
D
0000
0001
0010
0011
0
1
2
3
0100
0101
0110
0111
4
5
6
7
1000
1001
1010
1011
8
9
10
11
1100
1101
1110
1111
12
13
14
15
12. Come up with a scheme that will allow us to represent fractions in
binary (e.g. 2.5, 3.75)
A:
Method 1: Use half of the bits to represent the number left of the decimal point
and the other half to represent the fractional part.
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
Page No
11
Example: (Using 8 bits in total; 4 right most for fractional part)
8.2 = 1000 0010
Method 2: For binary numbers, the position of the digit corresponds to a power of
2. So, we could use negative powers of 2 to represent the fractional parts. Just as
above, only some of the bits will be used for the fractional part.
Example: (Using 8 bits in total; 4 right most for fractional part)
1011.0111 = 23 + 21 + 20 + 2-2 + 2-3 + 2-4
= 8 + 2 + 1 + 0.25 + 0.125 + 0.0625
= 11.4375
When converting from decimal to binary, a fraction will have to be
represented as sum of negative powers of 2 (1/2, 1/4, 1/8, 1/16,…).
Method3: Write the number in a modified scientific form such that the digit to the
left of the decimal point is always 0 i.e. 34.619 becomes 0.34619 x 102.
Now we could use some of the bits to represent the number right of the decimal
point and rest of the digits to represent the exponent of 10.
13. Convert the following signed numbers from decimal to binary. You
may only use 8 bits.
A:
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
14. Convert the following decimal numbers to binary:
a) 27
b) 75
c)164
d) 255
e) 94
A:
a) 27
2
2
2
2
2
27
13
6
3
1
Remainder
1 (LSB)
1
0
1
1 1 0 1 1
Page No
12
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
0
1(MSB)
Thus (27)10 = (11011)2
b)
A:
75
2
2
2
2
2
2
2
75
37
18
9
4
2
1
0
Remainder
1 (LSB)
1
0
1
0
0
1(MSB)
thus (75)10 = (1001011)2
c) 164
A:
2
2
2
2
2
164
82
41
20
10
Remainder
0 (LSB)
0
1
0
|29/8/2010
Page No
13
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
2
2
2
Thus
5
2
1
0
0
1
0
1(MSB)
(164)10 = (10100100)2
d) 255
A:
2
2
2
2
2
2
2
2
255
127
63
31
15
7
3
1
0
Remainder
1 (LSB)
1
1
1
1
1
1
1(MSB)
Thus (255)10 = (11111111)2
|29/8/2010
Page No
14
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
e) 94
2
2
2
2
2
2
2
94
47
23
11
5
2
1
0
Remainder
0 (LSB)
1
1
1
1
0
1(MSB)
Thus (94)10 = (1011110)2
15. Convert the following binary numbers to decimal:
a) 1
b) 1010
A: a) 1x20
b) 1010
c)11001
d) 10000
= (1)10
= 1x23 + 0x22 + 1x21 + 0x20
= 8 + 0 + 2+ 0
= (10)10
c) 11001
=
1x24 + 1x23 + 0x22 + 0x21 + 1x20
= 16+ 8 +1
=
(25 )10
d) 10000
= 1x24 + 0x23 + 0x22 + 0x21 + 0x20
|29/8/2010
Page No
15
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
=
=
|29/8/2010
Page No
16
16+ 0 +0 +0 +0
(16 )10
16. Convert the following decimal fractions into binary .
a. 68.5625
b. 43.625
A:
a. 68.5625
First solve the integer part by repeated division method and then solve the fraction part
by multiplication method .
Solving 68
2
2
2
2
2
2
2
68
34
17
8
4
2
1
0
Remainder
0 (LSB)
0
1
0
0
0
1(MSB)
it is 1000100
Now solving 0.5625
0.5625 x 2 = 1.125
0.125 x 2 = 0.25
0.25 x 2 = 0.50
0.50 x 2 = 1.00
Integer part
1
0
0
1
it is 1001
Adding both the values :
(68.5625)10 = (1000100.1001)2
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
43.625
b)
A:
Solving 43
2
2
2
2
2
2
43
21
10
5
2
1
0
Remainder
1 (LSB)
1
0
1
0
1(MSB)
it is 101011
Now solving 0.625
Integer part
0.625 x 2 = 1.25
1
0.25
x 2 = 0.50
0.50 x 2 = 1.00
1
0
it is 101
Adding both the values :
(43.625)10 = (101011.101)2
17. Convert the following binary fractions into decimal
a) 00111011.01
b) 1110.001
A:
111011.01 is represented as
= 1x25 + 1x24 + 1x23 + 0x22 + 1x21 +1x20 + 0x2-1 + 1x2-2
Page No
17
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
Page No
18
= 32+ 16+ 8 + 2+1+ 0.25
= (59.25)10
1110.001
A:
= 1x23 + 1x22 + 1x21 +0x20 + 0x2-1 + 0x2-2 + 1x2-3
b)
= 8+ 4+ 2+ 0.125
= (14.125)10
Express the hexadecimal unsigned integer 5C with the equivalent decimal
number
18.
A : To express the hexadecimal unsigned integer 5C with the equivalent decimal number, we must convert
the hexadecimal digits to decimal numbers as well as expand:
5C = 5(161) + 12(160)
= 5 (16) + 12 (1)
= 92
19. Convert 3724 8 into binary number
A:
3724 8 (Write 3 bit binary form for every digit)
= 3
7
2
4
011 111 010 100
= 11111 0101 2
20. Convert (100100101011)2 to octal
A: 1) Write down your binary number:
100100101011
2) Divide your binary number into groups of 3 bits
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
(if you have an amount of bits that is not evenly divisible by 3 you add 0
bits onto the left side.)
100 100 101 011
3) Convert each group into a octal digit using this formula:
100, 100 ,101, 011
4 4 5 3
Thus 100100101011(2) = 4453(8)
21. convert (632)8 to decimal
A:
= (6 x 82) + (3 x 81) + (2 x 80)
= (6 x 64) + (3 x 8) + (2 x 1)
= 384 + 24 + 2
= (410)10
22. convert (177)10 to octal
A:
8
8
8
177
22
2
Remainder
1 (LSB)
6
2(MSB)
=261
23. convert (F4C)16 to decimal
= (F x 162) + (4 x 161) + (C x 160)
= (15 x 256) + (4 x 16) + (12 x 1)
= (61516)10
24. Convert the following numbers from decimal to hexadecimal
(use any methods). Show all steps.
a. (4768)10 to hex.
Page No
19
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
A
16
16
16
16
4768
298
18
1
0
Remainder
0 (LSB)
10 (10=A)
2
1(MSB)
Hence (4768)10 = 1 2 A 0
b)
A:
(159)10
16
16
159
9
Remainder
15(15 =F)
9
Hence (159)10 = 9F16
c)
215
A
16
16
215
13
Remainder
7
13 ( 13=D)
Hence (215)10 = D716
25. Convert the following numbers from binary to hexadecimal.
a)
0111 11012
A:
01112 = 7
11012 = 13 (D)
Page No
20
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
Page No
21
Hence 0111 11012 = 7D16
b) 1011 01012
A:
10112 = 1110 (B)
01012 = 5
Hence 1011 01012 = B5
26. Convert (6438)8 to base 10.
A:
6438 = 6 * 82 + 4 * 81 + 3 * 80
= 6 * 64 + 4 * 8 + 3 * 1
= 384 + 32 + 3
= 419 in base 10
27. Convert hexadecimal (base-16) 1EA to base 10.
Here we know what the letters A through F in base 16 represent. A represents 10,
B represents 11, C is 12, D is 13, E is 14 and F is 15. With that in mind, we have
1EA16 = 1 * 162 + 14 * 161 + 10 * 160
= 1 * 256 + 14 * 16 + 10 * 1
= 256 + 224 + 10
= 490 in base 10
28. Convert hexadecimal F8 to binary .
A: To convert hexadecimal F8 to binary, write down the binary for F first, then the binary
for 8.
F
8
1111 1000
Hence F8
=
11111000.
29. Convert hex number 1 A to binary
A
Hence
Convert hex number 1A to binary.
1
A
0001 1010
1A = 0001 1010
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
Page No
30. Convert the following from 2’s complement to Decimal 1010
A:
This is a negative number as the most significant bit is 1. Find out its positive
counter by flipping all bits and then adding 1.
0101 + 1 = 0110
= 0 x 23 + 1 x 22 + 1 x 21 + 0 x 20
=4+2=6
Hence the number is -6.
31. Convert the following numbers to their binary equivalents.
a. 2710
b. 3310
c. 5410
d. 4710
e. 7810
A
The decimal and binary equivalents are listed below.
a.
b.
c.
d.
e.
2710
3310
5410
4710
7810
=
=
=
=
=
110112
1000012
1101102
1011112
10011102
32. Convert the following numbers to their binary equivalents.
a. 13010
b. 20010
c. 54910
d. 30410
e. 101010
A:
The decimal and binary equivalents are listed below.
a. 13010 = 100000102
b. 20010 = 110010002
22
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
Page No
23
c. 54910 = 10001001012
d. 30410 = 1001100002
e. 101010 = 11111100102
33. Convert the following numbers from decimal to binary.
Assume we are using 8 bits to represent signed numbers. Show all
steps.
[Use 2’s complement in both cases.]
a) -104
b) -49
A:
104 = 64 + 32 + 8
= 26+25+23
= 0110 10002
1’s Complement: 1001 01112
+0000 00012
2’s Complement: 1001 10002
Hence –104 = 1001 10002
b) -49
49 = 32 + 16 + 1
= 25+24+20
= 0011 00012
1’s Complement: 1100 11102
+0000 00012
2’s Complement: 1100 11112
Hence –49
= 1100 11112
34. Briefly describe the ASCII system and explain how it works(ie. How is it used to
represent data).
A:
The ASCII system was devised in 1960s. In this system 128 symbols including the
alphabet letters, digits, and punctuation marks are assigned a unique decimal
code from 0 to 127. As such these symbols can be represented as a sequence of 7
bits on the computer.
35. Give the decimal equivalent of the following symbols (characters) in
ASCII?
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
A:
M = 65+12 = 77
(13th letter)
d = 97+3 = 100
|29/8/2010
Page No
24
7 = 48+7 = 55
36. Explain how you did the conversion in Question 32
A:
M is the 12th letter after ‘A’ so add 12 to the ASCII code for A. Similarly, d is the 3rd
letter after a so add 3 to ASCII code for a. ASCII code for 48 is 0 so add 6 to it to
get the code for 7.
37. Use ASCII conversion to decode the following message from
binary to text. Show all your steps and explanations.
0100 10002 0110 10012
A:
0100 10002 = 64 + 8 = 65 + 7 = ‘H’
0110 10012 = 64 + 32+8+1 = 105 = 97 + 8 = ‘i’
Decoded message = Hi
38. Represent the word “ COMPUTER “ in ASCII code assuming odd parity is
being followed for transmission of strings from one device to another .
A
To Convert the string into ASCII refer to the table provided for ASCII codes.
mapping the various characters with the ASCII code the following
representation is given below:
According to that
Character
C
O
M
P
U
T
E
R
39.
Parity Bit
0
0
1
1
1
0
0
0
ASCII code
1000011
1001111
1001101
1010000
1010101
1010100
1000101
1010010
. Add the following unsigned binary numbers
a) 1110 + 111 b) 11011 + 11011
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
A:
a)
1110
0111
10101
b)
11011
11011
110110
40. Fill in the blanks :
a.) Convert 110111.1101 binary
b.) 10010101.111 binary
decimal _________________
c.)
Convert 11000011.01 binary
decimal _________________
e)
Convert 38.4 decimal
binary _________________
A:
a) Convert 110111.1101 binary
decimal 55.8125
|29/8/2010
decimal __________________
d.)
11001010.001 binary
decimal __________________
f)
252.33 decimal
binary ___________________
b)
10010101.111 binary
decimal 149.875
Page No
25
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
c)
Convert 11000011.01 binary
d)
decimal 195.25
e)
|29/8/2010
Page No
26
11001010.001 binary
decimal 202.125
Convert 38.4 decimal
binary 100110.0110011
f) 252.33 decimal
binary 11111100.010101
41. Equate the following octal numbers to base 10
a. (5467)8
=____________
b.(6345)8
=___________
c. (76534)8
=___________
A:
a) 2871
b) 3301
c) 32092
42. . Using an 8 bit word length, store the following decimal values as Sign Magnitude
and 2's Complement:
Sign Magnitude
1) -94
2) +110
2's Complement
________________
________________
________________
________________
3) -23
________________
________________
4) +49
________________
________________
Using a 10 bit word length store following decimal values as Sign Magnitude and 2's
Complement:
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
Sign Magnitude
________________
________________
6) -190
________________
________________
8) +87
________________
________________
Page No
2's Complement
5) +278
7) -2
|29/8/2010
________________
________________
Convert following binary values to decimal assuming they are stored as Sign
Magnitude & then as 2's Complement:
9) 1011 1011
Sign Magnitude
2's Complement
________________
________________
10) 0011 1101
________________
________________
11) 1110 1101
________________
________________
12) 0101 1000
________________
________________
13) 0110 1101 0111
________________
________________
14) 1011 0110 1101
________________
________________
15) 0001 0110 1010
________________
________________
16) 1111 1101 1011
________________
________________
A:
Sign Magnitude
2's Complement
27
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
1.
1101 1110
1010 0010
2.
0110 1110
0110 1110
3.
1001 0111
1110 1001
4.
0011 0001
0011 0001
5.
01000 10110
01000 10110
6.
10101 11110
11010 00010
7.
10000 00010
11111 11110
8.
00010 10111
00010 10111
9.
-59
-69
10.
+61
+61
11.
-109
-19
12.
+88
+88
13.
+1751
14.
-877
-1171
15.
+362
+362
16.
-2011
-37
+1751
|29/8/2010
Page No
28
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
Page No
43. Convert the following text into binary using ASCII.
Show all your work (for each character).
Base 16
A:
B = 66 = 64 + 2 = 0100 00102
a = 97 = 64 + 32 + 1 = 0110 00012
s = 115 = 64 + 32 + 16 + 2 + 1 = 0111 00112
e = 101 = 64 + 32 + 4 + 1 = 0110 01012
= 32 = 0010 00002
1 = 49 = 32 + 16 + 1 = 0011 00012 (the character ‘1’ = 16)
6 = 54 = 32 + 16 + 4 + 2 = 0011 01102
So
Base 16text =
0100 00102 0110 00012 0111 00112 0110 01012 0010 00002 0011 00012
11 02
44. Convert the following code from decimal to the equivalent character
using ASCII. Show your work / reasoning.
11110
A:
11110
= 64 + 32 + 8 + 4 + 2 + 1
= 96 + 15
96 + 1 is the first letter of the alphabet (i.e. a)… so 96 + 15 is the 15th letter of the
alphabet.
11110 in ASCII is o
Very Short questions:
1. Convert the following decimal
into binary
a.
568.1875 ____________________
b. 6143.3175 _______________________
c. 35________________________
d. 76__________________
29
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
e. 109________________________
f. 111_____________________
2.
a.
b.
c.
d.
e.
f.
Convert the following binary
into decimal
100111011.01 _________________
11001110.1001 __________________
00111111.1111 ___________________
001000100101.1110 __________________
11111000011.01 ___________________
1000110111110.001 __________________
3. Convert the following decimal into hexadecimal.
a. 4096
__________
b. 314 _____________
c. 67 ____________
d. 56 _______________
e. 89______________
f. 12222__________________
4. Convert the following hexadecimal numbers in decimal notation.
a. E2_____________________
b. 987________________________
c. FFF_________________________
d. A4_________________________
e. CDD3_________________________
f. 4E8_________________________
5. Convert the following binary numbers into hexadecimal
a.
b.
(0110 1100 1001 0001)2 = ___________________
(0011 1010 1111 1110)2 = ___________________
c.
(1010 1101 1011 1011)2 = ___________________
d. (0000 0000 1111 1111)2 = ____________________
e. (1010 0101 1110 0011)2 = ___________________
f. (0110 0111 0010 0000)2 = ____________________
g. (0110 1001)2 = _____________________________
h. (1010 0111)2 = _____________________________
Page No
30
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
Page No
6. Convert the following octal numbers to their decimal equivalent:
i.
36
ii.
426
iii.
108
iv.
17
v. 117
7. Find the
i.
ii.
iii.
iv.
v.
octal equivalent of the following binary numbers :
101110
1000100
111111
1000001
110000000100
8. Convert the following octal numbers to their equivalent binary numbers
i.
23
ii.
123
iii.
46
iv.
89
v. 34
9. Convert the following decimal number into their octal and hexadecimal equivalent.
i.
34
ii.
156
iii.
34.78
iv.
23.8999
v. 12.89
10. In the following problems, each bit pattern represents a value stored in
two's complement notation. Perform each addition, and show the result in
two's complement. Check your answers by translating each problem into
decimal notation.
a. 0101
+0010
b.
0011
+0001
c.
0101
+1010
d. 1110
+0011
e. 1010
+1110
31
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
Page No
11. Solve each of the following problems in two's complement notation. Are
any of the results incorrect due to overflow?
a. 0101
+0011
b.
0101
+0110
c.
1010
+1111
d.
0010
+0101
12. Perform the following binary addition exercises:
a. 1 1 0 1 1
1101
b.
100011
101101
c.
11101
11111
13. Find the 1’s and 2’s compliment of the following numbers :
i.
65
ii.
45
iii.
92
iv.
101
v. 34
14. Find 2’s compliment of the following numbers :
i.
-89
ii.
-67
iii.
-45
iv.
-13
v. -19
15. Which of the following are valid hexadecimal numbers?
a. BAD
b. DEAD
c. CABBAGE
d. ABBA
e. 127
e.
0101
+1001
32
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
Short Questions:
1. Convert the following binary numbers to decimal:
a. 1101
b. 1
c. 101
d. 110
e. 10110
f. 0010110
g. 1101111
h. 11101110111
2. Convert the following decimal numbers to binary:
a. 123
b. 242
c. 17
|29/8/2010
Page No
33
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
d. 125
e. 10001
f. 99
g. 214
h. 78
3. Convert the following binary numbers to hexadecimal (base-16):
a. 0111
b. 1101
c. 1011011
d. 11101100
e. 100101101
f. 0101101011110000
g. 00000000000000000001
h. 11001010111001101011010011
4. Convert the following hexadecimal numbers to binary:
a. DEAD
b. AF-05-12-57
Page No
34
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
c. 00-00-0C-9F-F2-A9
d. 00-00-5E-00-00-00
e. 123456789ABCDEF
f. F0E1D2C3B4A59687
g. B0C
h. 1000
5. Convert the following hexadecimal numbers to decimal:
a. AA
b. 123F
c. FEDCBA
d. D0-BE-D0
e. B8C
f. FF-FF-FF-FA
g. 10
6. Convert the following decimal numbers to hexadecimal:
a. 9
Page No
35
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
b. 32
c. 73
d. 255
e. 1,025
f. 4,099
g. 65536
h. 1,048,575
7. Convert the following octal (base-8) numbers to decimal:
a. 4
b. 10
c. 777
d. 05726
e. 183242
8. Convert the following decimal numbers to octal:
a. 5
b. 9
c. 625
Page No
36
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
d. 1,024
e. 32,767
9. Convert the following octal numbers to binary:
a. 107
b. 2746
c. 000000001
d. 66542
e. 76543210
10. Convert the following binary numbers to octal:
a. 110
b. 011101
c. 010101011
d. 1111011101101
e. 111110101100011010001
11. Convert the following octal numbers to hexadecimal:
a. 6
Page No
37
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
b. 12
c. 367
d. 5555
e. 123456
12. Convert the following hexadecimal numbers to octal:
a. 2
b. 8
c. 10
d. FE
e. 2A4F2D
13. Convert the following binary numbers to decimal :
a. 0.1
b. 1.11
c. 101.01101
d. 100101.11101
e. 11101111.10000001
14. Convert the following decimal numbers to binary :
Page No
38
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
Page No
39
a. 0.5
b. 1.0625
c. 7.7500
d. 163.2
e. 3.141592654
Long Questions:
1. Explain the ways of representing negative integers in binary?
2. What do you understand by positional number system.
3. What are the ways of converting decimal number into binary ,octal and
hexadecimal.
4. What do you understand by the term sign and magnitude.
5. What are the three things in representing floating point numbers in binary form. Give
an example.
6. What is the advantage of 2 ‘s compliment over 1’s compliment .
7. How will you determine parity check for ASCII codes.
8. Write the steps for converting hexadecimal number to octal.
9. Write the steps for converting decimal number to binary using direct method.
10. What is repeated division method .Write down the steps for the same.
11. What is the importance of hexadecimal presentation of number in designing chips .
12. What do you understand by computer codes?
13. Write short notes on ASCII ,ISCII ,Unicode .
14. Convert the following decimal numbers to its binary equivalent.
a) 25555.654
b) 45.662
c) 1.567
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
d) 3.4562
e) 2.24
15. Convert the following binary numbers to its decimal equivalent.
a) 100.1000
b) 10101.1000
c) 1111.001
d) 10.101
e) 11.001
16. Convert the following octal numbers to its decimal equivalent.
a) 123.87
b) 34.78
c) 23.56
d) 12.66
e) 10.10
17. Convert the following decimal numbers to its octal equivalent.
a) 100.1001
b) 10101.101
c) 1111.0011
d) 10.1011
e) 11.0011
18. Convert the following decimal numbers to its hexadecimal equivalent
a) 167.100
b) 101012.13
c) 13.17
d) 1617.19
e) 18.13
19. Convert the following hexadecimal numbers to its binary equivalent
a) 2DC.F
b) 3E.D
c) 4AA.B
d) 5C.D
Page No
40
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
|29/8/2010
e) 1A.B
20. Convert the following binary numbers to its hexadecimal equivalent.
a) 100.1001001
b) 10101.101001
c) 1111.001100
d) 10.10110001
e) 11.00110001
JIT
Number Systems Exercise
1.
Convert the following decimal numbers to binary:
f) 14 ______________________
g) 189 ______________________
h) 257 ______________________
i) 472 ______________________
21. Convert the following decimal numbers to hex:
a) 14 ______________________
b) 189 ______________________
c) 257 ______________________
d) 472 ______________________
3.
Convert the following hex numbers to decimal:
a) 0x37 ______________________
b) 0xAB ______________________
c) 0x0147 ______________________
d) 0x2AE1 ______________________
4.
Convert the following hex numbers to binary:
a) 0x37 ______________________
b) 0xAB ______________________
c) 0x0147 ______________________
d) 0x2AE1 ______________________
5.
Convert the following binary numbers to hex:
a) 0010 1101 ______________________
Page No
41
Sofia Goel | ClassXI Chapter 3 |Number System |Computer Sc
b) 1010 1010 ______________________
c) 1110 0011 ______________________
d) 0010 1001 1011 0101 ______________________
6.
Convert the following binary numbers to decimal:
a) 0010 1101 ______________________
b) 1010 1010 ______________________
c) 1110 0011 ______________________
d) 0010 1001 1011 0101 ______________________
|29/8/2010
Page No
42
Download