Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Solution
Q2. The following is a string of ASCII characters whose bit patterns have been converted into
hexadecimal for compactness:
(4A EF 6E 20 C4 EF E5)16
Of the 8 bits in each pair of digits, the left most is a parity bit. The remaining bits are ASCII code.
(a) Convert to binary form and decode the ASCII.
Ans. Binary Form:
01001010 11101111 01101110 00100000 11000100 11101111 11100101
Characters:
J o n Space D o e
Case 2: If n = 1
14 + 4 = 3r
18 = 3r
r = 6 (True)
Answer is n = 1, r=6.
Q5. 8 digit hexadecimal number contains 5 integer digits and 3 fractional digits. Find the Maximum
decimal number it can represent and minimum non-zero decimal number it can represent.
Ans.
Maximum decimal number that can be represented = (2 20 – 1) + (1 – 1/2 12)
= 2 20 – 2 -12 (1048576)10
Q6. For the value F870000, if this represents a two’s complement integer, what decimal value is
being represented?
Ans.
F870000 = 1111 1000 0111 1000 0000 0000 0000 0000
= (-231 * 1)+ (230 * 1) + (229 * 1)+ (228 * 1) + (227 *1)+ (222 *1)+ (221 *1) +(220 *1) +(219 *1)
= (-126353408)10
Q7. Express the following irrational numbers in the binary system with enough digits in the
fractional part so that the accuracy is to no less than four decimal places in the decimal equivalent.
(a) pi = (3.1429)10
Ans. (11.0010)2
Q8. What is the largest BCD encoded decimal value that can be represented in three bytes?
Ans. 3 bytes = 24 bits. Since BCD is a 4-bit code, thus 3 bytes code convert to 24/4 = 6 decimal digits.
Range of BCD code is: 0 – 9.
Thus the largest BCD encoded decimal value is 999999.
Q9. Why can’t the parity method detect a double error in the transmitted data?
Ans. Two errors in the data would not change the oddness or evenness of the number of 1s in the data.
Q10. A small process-control computer uses octal codes to represent its 12-bit memory addresses:
(a) How many octal digits are required?
Ans. Since 3 bits convert to a single octal digit, thus 12/3 = 4 octal digits.
E=
1 1 0 0 0 1 0 1
L=
1 1 0 0 1 1 0 0
L=
1 1 0 0 1 1 0 0
O=
1 1 0 0 1 1 1 1
Q13. Determine the single error correcting code for the following BCD numbers using even parity.
(a) 0101
Ans. 4 message bits, 3 parity bits. Total = 7 Bit Code.
Bit Designation P1 P2 M1 P3 M2 M3 M4
Bit Position 1 2 3 4 5 6 7
Binary Position 001 010 011 100 101 110 111
Information Bits 0 1 0 1
Parity Bits 0 1 0
Code = 0100101
(b) 0011
Ans. 4 message bits, 3 parity bits. Total = 7 Bit Code.
Bit Designation P1 P2 M1 P3 M2 M3 M4
Bit Position 1 2 3 4 5 6 7
Binary Position 001 010 011 100 101 110 111
Information Bits 0 0 1 1
Parity Bits 1 0 0
Code = 1000011
Q14. Determine the single error correcting code for the following information code 10101 for odd
parity.
Ans. 5 message bits, 4 parity bits. Total = 9 Bit Code.
Bit Designation P1 P2 M1 P3 M2 M3 M4 P4 M5
Bit Position 1 2 3 4 5 6 7 8 9
Binary Position 0001 0010 0011 0100 0101 0110 0111 1000 1001
Information Bits 1 0 1 0 1
Parity Bits 0 0 1 1
Code = 001101011
Q15. 8-bit character 10101111 is to be encoded using odd parity Hamming code. What is the bit
string that will be transmitted?
Bit Designation P1 P2 M1 P3 M2 M3 M4 P4 M5 M6 M7 M8
Bit Position 1 2 3 4 5 6 7 8 9 10 11 12
Binary Position 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100
Information Bits 1 0 1 0 1 1 1 1
Parity Bits 0 1 1 1
Code = 011101011111
Q16. (a)Obtain a 7 bit Composite Code word for the data word: 0010.
Ans. 4 message bits, 3 parity bits. Total = 7 Bit Code.
Bit Designation P1 P2 M1 P3 M2 M3 M4
Bit Position 1 2 3 4 5 6 7
Binary Position 001 010 011 100 101 110 111
Information Bits 0 0 1 0
Parity Bits 0 1 1
Code = 0101010
C1= XOR(1,3,5,7) = 0 0 0 0 0
C2= XOR(2,3,6,7) = 1 0 1 0 0
C3= XOR(4,5,6,7) = 1 0 1 0 0