Sample Final - Without Solution
Sample Final - Without Solution
Name: ________________
ID: _____________
This is an open book exam with lecture slides only. You may also bring a scientific
calculator.
Page 1 of 6
Part 1. True/False (2pts for each correct answer and 0 point for incorrect answer)
1. In a Huffman code, a source symbol which occurs with a smaller probability will always be
encoded in a code-word of longer or equal length compared to the code-word for a source
symbol that occurs with a greater probability.
3. The foundry business model was invented by TSMC, who continues to own the largest
foundry market share today.
4. Claude Shannon is the first to show how networks of switches can be used to implement
different Boolean logic equations.
5. Ada Lovelace wrote papers on how the ENIAC can be programmed to do different tasks.
10. A binary symmetry channel with bit error probability of 0.1 has the same channel capacity as
a binary symmetry channel with bit error probability of 0.9.
Page 2 of 6
Answer:
1.____ 2.___ 3.____ 4.____ 5.___
Page 3 of 6
Part 2. Short Questions
(ii) (3 pts) Perform the multiplication of the two binary numbers 1101 and 110. Show how your
multiplication is done.
Q2. (i) (3 pts) The following truth table show the value of binary output Z as function for three binary
inputs W, X, Y. Give the logic equation for output Z.
W X Y Z
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
(ii) (3 pts) Draw the circuit diagram for the logic equation Q ( A B) C
Page 4 of 6
Q3. In a (7, 4) Hamming Code, three parity bits p1, p2, p3 are added to four data bits d1, d2, d3, and
d4, and the coverage of each parity bit is as shown in the table below:
Bit position 1 2 3 4 5 6 7
Encoded
p1 p2 d1 p3 d2 d3 d4
data bits
p1 X X X X
Parity
bit p2 X X X X
coverage
p3 X X X X
(i) (3 pts) Assume even parity is used. If a code is received such that d1 =0, d2=1, d3=1, d4=0,
and p2 = 1. Is p2 in parity violation? Briefly explain why.
(ii) (3 pts) Assume another code is received such that p1 and p2 are found to be in parity
violation, while p3 is not. Assume there is only a single-bit error, which bit should be
corrected?
Page 5 of 6
Q4. The Huffman code is a systematic way to assign code-words of variable length to symbols of
different probabilities so that the average length of code-words need to encode a long sequence of
symbols is minimized. A particular code is shown below where there are 7 symbols: A, B, C… F.
0 1
0 1 0 1
A B
0 1 0 1
C D E
0 1
F G
(i) (3 pts) If the sequence of bits 0001111010010 is received, what is corresponding symbol
sequence?
(ii) (3 pts) Is it possible that the Huffman code is as shown above if the probability of the symbol
E is 0.1 and the probability of the symbol F is also 0.1? Briefly explain your answer.
Q5. (i) (3 pts) When authenticating a document by using the RSA algorithm, why do we first hash the
document into a digest and sign the digest instead?
(iii) (3 pts) In the question above, what does it mean to “sign” the digest? What does the signer
do exactly?
Page 6 of 6