You are on page 1of 2

Solution of Digital Circuit and Logic Design 1 Page 1/2

Homework#02 2005/2

Solution of Homework#02

(1) Write your student ID in the following codes: BCD, 2421, Excess-3, biquinary,
and 1-out-of 10
My student ID = 40360430
BCD = 0100 0000 0011 0110 0000 0100 0011 0000
2421 = 0100 0000 0011 1100 0000 0100 0011 0000
Excess-3 = 0111 0011 0110 1001 0011 0111 0110 0011
Biquinary = 0110000 0100001 0101000 1000010 01000001 0110000
0101000 0100001
1-out-of 10 = 0000100000 1000000000 0001000000 0000001000
1000000000 0000100000 0001000000 1000000000

(2) Describe rules for addition and subtraction in BCD numbers


Addition of BCD digits is similar to adding 4-bit unsigned binary
numbers, except that a correction must be made if a result exceeds 1001. The
result is corrected by adding 0110.
For subtraction, suppose we want to find A – B, we can perform A + B′
where B′ is ten’s complement of B.

(3) List all of the “bad” boundaries in the mechanical encoding disk of figure below,
where an incorrect position may be sensed.

001 – 010, 011 – 100, 101 – 110, 111 - 000

(4) List all code words of 4 bits gray code


0000, 0001, 0011, 0010, 0110, 0111, 0101, 0100, 1100, 1101, 1111, 1110,
1010, 1011, 1001, and 1000

(5) Write the self-study report from one of the following topics.
- Thai characters coding
- CRC codes
No solution

(6) Encode your name in ASCII code


My name is Panupong.
Panupong = 80 97 110 117 112 111 110 103 (in ASCII decimal value)
= 01010000 01100001 01101110 01110101 01110000 01101111
01101110 01100111

Panupong Sornkhom Department of Electrical and Faculty of Engineering,


Computer Engineering Naresuan University
Solution of Digital Circuit and Logic Design 1 Page 2/2
Homework#02 2005/2

(7) How many errors can be detected by a code with minimum distance n?
n-1 bit error can be detected

(8) Define parity groups for a distance-3 Hamming code with 11 information bits
11 information bits = 2i – 1 – i bits
2i = 11 + 1 + i
i = 4 bits
Thus, 4 parity bits used
Parity bits = position 1, 2, 4, and 8
Information bits = remaining position

Group A = position 1, 3, 5, 7, 9, 11, 13, 15


Group B = position 2, 3, 6, 7, 10, 11, 14, 15
Group C = position 4, 5, 6, 7, 12, 13, 14, 15
Group D = position 8, 9, 10, 11, 12, 13, 14, 15

(9) List all code words of a distance-3 Hamming code:


(Separate information bits and check bits)
(a) with one information bit
0 00 and 1 11
(b) with two information bits
00 000, 01 011, 10 101, and 11 110
(c) with three information bits
000 000, 001 011, 010 101, 011 110, 100 110, 101 101, 110 011, and
111 000

(10) The rate of code is the ratio of the number of information bits to the total number
of bits in a code word. High rates, approaching 1, are desirable for efficient
transmission of information. Construct a graph comparing the rate of distance-2 parity
codes and distance-3 and -4 Hamming codes using the following numbers of
information bits: 1, 4, 11, 16, 57, 120, 247, 502, and 1013

Comparing rate of code


1.2000
1.0000
rate of code

0.8000
0.6000
0.4000
0.2000
0.0000 1 4 11 16 57 120 247 502 1013
Distance-2 parity codes 0.5000 0.8000 0.9167 0.9412 0.9828 0.9917 0.9960 0.9980 0.9990
Distance-3 Hamming codes 0.3333 0.5714 0.7333 0.7619 0.9048 0.9449 0.9686 0.9824 0.9902
Distance-4 Hamming codes 0.2500 0.5000 0.6875 0.7273 0.8906 0.9375 0.9648 0.9805 0.9893

number of information bits

Panupong Sornkhom Department of Electrical and Faculty of Engineering,


Computer Engineering Naresuan University

You might also like