Question 1 (total 88 marks, and 8 bonus marks)
A certain door lock system uses a keypad with 12 buttons, 0 to 9, *, and #, and
uses row-column encoding by assigning 2 bits to row number, and 2 bits to
column number, as follows:
Signal
ABCD Button
0000 1
0001 2
0010 3
0100 4
0101 5
0110 6
1000 7
1001 8
1010 9
1100 *
1101 0
1110 #
The keyboard generates a clock signal every time a button is pressed so the
connecting circuitry can sample the values of signals A, B, C, and D. You are going
to design a circuit that recognises the sequence 6174# (as an unrelated note, the
number happens to be the Kaprekar's constant), and have decided to recognise
the four sequences separately, then AND them together to form the final result.
(a) (2 marks) The four recognisers have the same number of states. How many
states are there?
(b) (4 marks) What are the four sequences to be recognised?
(c) (20 marks) Draw a Mealy model state diagram for each recogniser, naming the
states A0, A1,... for the A's sequence recogniser, BO, B1,... for B's, and so on. A
recogniser should reset to its initial state on detection of wrong input.
(d) (8 marks) Suppose the four sequence recognisers for A, B, C and D are
modules named RA, RB, RC and RD respectively, drawn as rectangular boxes
with input D, clock Clk (use a little triangle like that of a flip-flop to represent
it), and output Q. Draw the circuit schematic diagram that makes use of these
modules and logic gate(s) that implement the sequence recognition function.
The circuit takes inputs A, B, C, D, and Clock from the keypad module, and
outputs R whose logic is 1 when the sequence is recognised, and 0 otherwise.
(e) (4 marks) Draw the symbolic state table for module RA. The columns should
be the current symbolic state (A0, A1, etc.), the input A, the next symbolic
state, and the output of the module, QA.