Worksheet 1
Worksheet 1
Page 1 of 3
2019/2020 A. Y
7. The solutions to the quadratic equation x2 - 11x + 22 = 0 are x = 3 and x = 6. What is the
base of the numbers?
8. As you recall from class, the defining property of the gray code encoding is that the
representations of adjacent values are only 1 bit apart from each other. Do keep in mind
that the gray code adjacency behavior wraps around.
a. Give a valid gray code mapping scheme for the blanks in the following table. If you
are confident that it is impossible to assign a mapping to some value, put an X and
briefly explain why this cannot be done.
b. Give a valid gray code mapping scheme for the blanks in the following table. If you
are confident that it is impossible to assign a mapping to some value, put an X and
briefly explain why this cannot be done.
c. Suppose that you wanted to represent all of the digits from 0 to 7 inclusive in some
form of gray code encoding. Would that be possible with some number of bits? If
yes, please give the smallest number of bits that would be needed AND give some
valid gray code encoding for all the digits. If not, please briefly justify why.
d. How about encoding all of the digits from 0 to 8 inclusive? Is this possible using
some number of bits? If yes, please give the smallest number of bits that would be
needed AND give some valid gray code encoding for all the digits. If not, please
briefly justify why.
e. Suppose that instead of having a code where the encodings of all adjacent digits are
exactly one bit apart from each other (as in gray code), they would be exactly 2 bits
apart. Given this condition, would it be possible to come up with some hamming
distance 2 code scheme for the values 0 to 3 inclusive with 3 digits? If yes, please
Page 2 of 3
2019/2020 A. Y
give such an encoding map (i.e. an encoding for each value 0 to 3); if not, briefly
explain the problems that arise.
f. Finally, with the same constraints (3 digits and a hamming distance of 2), can you
find a way to represent all of the digits from 0 to 5 inclusive? If yes, please give
such an encoding map (i.e. an encoding for each value 0 to 5); if not, briefly explain
the problems that arise.
Page 3 of 3
2019/2020 A. Y