星期四, 9月 20, 2007

EE 2000 Logic Circuit Design, Semester A, 2007/08, Tutorial 2

Level 1
Question 1: Complete the following table by encoding the decimal number 215 in the following format. Please show the bit configuration and count the number of bits used.





Question 2: Gray Code
(a) Convert the binary numbers “1101001” to gray
(b) Convert the gray code “11001100111” to binary


Question 3: Find and correct the error in the following code sequence. Assume odd-parity has been used.


Level 2
Question 4: An interesting application of the 2 of 5 Code is the U.S. Postal Service bar code (ZIP code). The bar code is not the same as what we learnt in lecture.


Decimal
USPS bar code
Decimal
USPS bar code
0
11000
5
1010
1
11
6
1100
2
101
7
10001
3
110
8
10010
4
1001
9
10100



Each digit is represented by 5 bars. 0 is printed as a short bar while 1 is printed as a long tall bar. The ZIP code appears between two tall bars called frame bars which serve to define the beginning and ending of the bar code. A final check sum digit is also included.

(a) Can you guess the ZIP code?
(b) Can you guess the usage of the check sum digit?


Question 5: There are many ways to represent decimal digits on computers. For the weighted code, you have learnt 8421 code, 5421 code and 2421 code. The numbers in the code name indicated the weights of each digit. Can you guess how the (8, 4, -2, -1) code looks like?
(a) Please complete the following table

Question 6: Design a 4-bit unit-distance code for representing the ten decimal digits (i.e. 0, 1, 2, … 9) that has the property that the code words for any two digits only differ by one bit. (Hints: Gray code is not appropriate since decimal 0 (0000) and decimal 9 (1101) differs by 3 bits)

Question 7: The following block of data is received from the transmission system with a vertical parity system. Horizontal parity is to be odd; vertical parity is to be even. An all-1s is EOB.

(a) Find any parity failure
(b) Correct the error, if possible
(c) Is it possible to have three bits in error? If yes, please show several possible locations.