In this assignment, you are to design an answering machine circuit using an FSMD. The answering designed in this lab will be similar to that designed in the previous assignment. However, we will be adding the ability to keep track of the number of messages that have not been heard. To do this we must define a new entity for this more advanced answering machine. The following image provides a black box view of the answering machine, defining its inputs and outputs.

entity ANS_MACH is
port( clk : in STD_LOGIC;
rst : in STD_LOGIC;
ring : in STD_LOGIC;
anson : in STD_LOGIC;
clear : in STD_LOGIC;
ts : in STD_LOGIC;
msgread : in STD_LOGIC;
ans : out STD_LOGIC;
messages : out UNSIGNED(3 downto 0) );
end ANS_MACH;
The new advanced answering machine works the same as before, except that the current number of messages that have not been heard are outputted on messages. The msgread input indicates that a single message has been read, while the clear flag indicates that all messages can be cleared. If we have reached the maximum number of messages that we can store, 15, then we will no longer answer the phone until at least one message has been read.