Exercises 1 (20 pts)

1. (2 pts)  A combinational system has one input x, which represents a decimal digit (0-9). The output z, is the square of x if x is greater than 4; otherwise, the output z is two times x.
a.    Give a high-level description of the system using expressions.
b.    Show a table of the function.
2. (2 pts) A pattern detector has as input a 4x4 matrix whose elements take letters a, b, c, or d. The output is 1 if the matrix contains one b surrounded by eight a's  as in the matrix at left below and 0 otherwise, as in the matrix at right below..
 
Output = 1 
  0 1 2 3
0|a|a|a|c|
1|a|b|a|d|
2|a|a|a|c|
3|d|d|d|d|
Output = 0
  0 1 2 3
0|a|a|a|c|
1|a|a|a|d|
2|a|a|a|c|
3|d|d|d|d|
a.    Give a high-level description of the system in terms of conditional logic expressions.
b.    How many rows would a tabluar description have?
3. (6 pts) What is the minimum number of binary variables required to represent a variable that can take integer values from:
a.    0 to 13?
b.    10 to 25?
c.    Give a table describing a possible coding function for part b.
d.    Give a binary code to represent the month of a year.
e.    How many bits is the minimum needed to represent the date (month, day, year)? Use a vector of three components for the date and represent each component(month, day, year)  in binary. Consider dates from 0 to over year 3000.
f.    Remember the Y2K bug? What is the year problem for your method?


4.  (10 pts)  A 7-segment display is used to display the digits from 0-9 on calculators and many other displays. The 7-segment display appears as:

where each segment is ON or OFF dependent upon the digit to be displayed. For example, to display the digit 0 would require segments a, b, c, d, e, and f to be ON with segment g OFF. To display the digit 2 would require segments a, b, g, e, and d to be ON and f and c segments OFF as in the above.

a.  (2 pts)  List the digits 0-9 and note whether segments g and f should be ON or OFF for each digit 0-9. (Hint: Draw each digit using the 7-segment display).

b. (2 pts)   Give a description of the segments f and g in terms of tabular switching functions f(x3,x2,x1,x0) and  g(x3,x2,x1,x0) using binary encoding for x3,x2,x1,x0 of 0=00002, 1=00012, 2=00102, ..., 9=10012, 10=10102, ..., 15=11112. Note that only 0-9 are used as inputs.

c.  (6 pts)  Give the one-set, the zero-set, and the dc-set for switching functions f(x3,x2,x1,x0) and  g(x3,x2,x1,x0).