Docsity

Homework Assignment 1 Solution - Computer Networks | CPSC 5157G, Assignments of Computer Systems Networking and Telecommunications

Toggle sidebar
bg1
CPSC 5157 Homework 1 Summer 2006
CPSC 5157 Computer Networks
Homework Assignment 1 Due Saturday, July 1, 2006
The following assignment assumes knowledge of hexadecimal arithmetic. Recall that
each hexadecimal digit can be viewed as shorthand for four binary bits. The equivalents:
0 = 0000 4 = 0100 8 = 1000 C = 1100
1 = 0001 5 = 0101 9 = 1001 D = 1101
2 = 0010 6 = 0110 A = 1010 E = 1110
3 = 0011 7 = 0111 B = 1011 F = 1111
The hexadecimal encoding for the ASCII character set is given on page 683 of the text.
Other tables giving the decimal encoding are less helpful for this assignment.
1. Give the binary encoding (eight binary bit representation of the 7–bit ASCII code)
for the following four characters: “A”, “b”, “7”, and “Z”.
ANSWER: See Appendix 2 on page 683 of the textbook.
‘A’ 0x41 0100 0001
‘b’ 0x62 0110 0010
‘7’ 0x37 0011 0111
‘Z’ 0x5A 0101 1010
2. Give the 8–bit binary encoding of the above characters, using the 8–bit ASCII
encoding with odd parity. Write each of these encodings as two hex digits.
Place the parity bit in the MSB, so that 0100 0111 becomes 1100 0111.
Hint: Some of the codes will change, and some will be identical to those in prob. 1.
ANSWER: Odd parity requires that the count on 1 bits in the code be an odd number.
‘A’ 0100 0001 (Two 1 bits) 1100 0001 0xC1
‘b’ 0110 0010 (Three 1 bits) 0110 0010 0x62
‘7’ 0011 0111 (Five 1 bits) 0011 0111 0x37
‘Z’ 0101 1010 (Four 1 bits) 1101 1010 0xDA
The next few problems assume that you have read the lecture notes for Monday, June 19
as revised on Thursday, June 22. The textbook material is correct, just not helpful here.
3. CRC–10 is the name of one of the older algorithms. It is probably not much in use
today. As a polynomial, it is represented by P(X) = X10 + X9 + X5 + X4 + X2 + 1.
Give the 12–bit binary number associated with this polynomial (its most significant
binary bit will be a 0) and translate this into a 3–digit hexadecimal number.
ANSWER: Fully written out, we have
P(X) = 1X10 + 1X9 + 0X8 + 0X7 + 0X6 + 1X5 + 1X4 + 0X3 + 1X2 + 0X+ 1
This translates to an 11–bit number 11000110101.
As a 12–bit number this is 011000110101 or 0110 0011 0101, which is 0x635.
4. How many bits will be found in the CRC sum produced by this algorithm?
(Technically, this is a remainder from polynomial division).
ANSWER: The remainder will have 10 bits, since the generator has 11 bits.
Page 1 of 3 Answer Key Revised July 2, 2006
pf3

Partial preview of the text

Download Homework Assignment 1 Solution - Computer Networks | CPSC 5157G and more Assignments Computer Systems Networking and Telecommunications in PDF only on Docsity!

CPSC 5157 Computer Networks

Homework Assignment 1 Due Saturday, July 1, 2006

The following assignment assumes knowledge of hexadecimal arithmetic. Recall that each hexadecimal digit can be viewed as shorthand for four binary bits. The equivalents: 0 = 0000 4 = 0100 8 = 1000 C = 1100 1 = 0001 5 = 0101 9 = 1001 D = 1101 2 = 0010 6 = 0110 A = 1010 E = 1110 3 = 0011 7 = 0111 B = 1011 F = 1111 The hexadecimal encoding for the ASCII character set is given on page 683 of the text. Other tables giving the decimal encoding are less helpful for this assignment.

  1. Give the binary encoding (eight binary bit representation of the 7–bit ASCII code) for the following four characters: “A”, “b”, “7”, and “Z”. ANSWER: See Appendix 2 on page 683 of the textbook. ‘A’ 0x41 0100 0001 ‘b’ 0x62 0110 0010 ‘7’ 0x37 0011 0111 ‘Z’ 0x5A 0101 1010
  2. Give the 8–bit binary encoding of the above characters, using the 8–bit ASCII encoding with odd parity. Write each of these encodings as two hex digits. Place the parity bit in the MSB, so that 0100 0111 becomes 1100 0111. Hint: Some of the codes will change, and some will be identical to those in prob. 1. ANSWER: Odd parity requires that the count on 1 bits in the code be an odd number. ‘A’ 0100 0001 (Two 1 bits) 1100 0001 0xC ‘b’ 0110 0010 (Three 1 bits) 0110 0010 0x ‘7’ 0011 0111 (Five 1 bits) 0011 0111 0x ‘Z’ 0101 1010 (Four 1 bits) 1101 1010 0xDA The next few problems assume that you have read the lecture notes for Monday, June 19 as revised on Thursday, June 22. The textbook material is correct, just not helpful here.
  3. CRC–10 is the name of one of the older algorithms. It is probably not much in use today. As a polynomial, it is represented by P(X) = X^10 + X^9 + X^5 + X^4 + X^2 + 1. Give the 12–bit binary number associated with this polynomial (its most significant binary bit will be a 0) and translate this into a 3–digit hexadecimal number. ANSWER: Fully written out, we have P(X) = 1X^10 + 1X^9 + 0X^8 + 0X^7 + 0X^6 + 1X^5 + 1X^4 + 0X^3 + 1X^2 + 0X+ 1 This translates to an 11–bit number 11000110101. As a 12–bit number this is 011000110101 or 0110 0011 0101, which is 0x635.
  4. How many bits will be found in the CRC sum produced by this algorithm? (Technically, this is a remainder from polynomial division). ANSWER: The remainder will have 10 bits , since the generator has 11 bits.
  1. CRC–5–USB is the name of a method used with many USB devices. Its polynomial representation is P(X) = X^5 + X^2 + 1, corresponding to the 6–bit binary string 100101. Use this polynomial to compute the 5–bit CRC remainder for the 1–character message “D” represented as an 8–bit string “1100 0100”. ANSWER: With a 5–bit CRC remainder, we append five 0 bits to the message, getting 1100 0100 00000, or 1100010000000. We now do the “division”.

The CRC remainder is 11101.