UCR CS 220
Assigment 2
Prof. Frank Vahid, Fall 2000
Answering block of a simple Answering Machine

(Last update: 10/5/00 2:40p.m.)

Design Specifications

In this assignment, you will design the answering sub-circuit of a simple answering machine. Note that this is not a complete answering machine; there must be another circuit that records messages, allows a user to playback messages, etc. The following image provides a black box view of the answering circuit, defining its inputs and outputs.

Likewise, the following is the corresponding entity declaration for the Answering Circuit that you are required to use.

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;
          ans   : out STD_LOGIC );
end ANS_MACH;

In this assignment, you are to design an answering circuit using an FSM. Note that you are not allowed to use data storage, i.e., signals and/or variables, in this design. You should construct it using only states and transitions between states. The answering machine works as follows.

The anson input indicates that the answering machine should respond to incoming calls, i.e., the machine is "on." Note that when an answering machine has its power turned on, it may or may be configured to answer the line. For example, the power may be on, but the machine may be on or off. Normally, the machine answers after four rings when the machine is on. If the machine is on and 4 rings are detected, then the answering circuit should answer the line by asserting ans for 1 clock cycle. 4 rings are detected as ring being asserted for 4 consecutive clock cycles (which assumes the clock frequency is the same as the ring frequency, a simplifying assumption in this lab). This machine has two additional modes of answering. One is a tollsaver mode. This mode helps the machine owner save money when checking messages remotely. If there are messages and the tollsaver option is on, the machine answers in only two rings, after which the owner can type in a security code and check those messages. However, if the phone rings three times, the owner can hang up and thus avoid any long-distance charges (since the machine in this case won't answer until after four rings). So, if the tollsaver option is enabled (ts = '1') and there messages, then the circuit will answer in 2 rings instead of 4. The input clear indicates whether there are messages waiting: 1 means there are no messages, while 0 means there are messages.

Sometimes the owner may forget to turn on the machine before leaving home. So this machine will always answer after 15 rings, so that the owner can then type in the security code and then remotely turn the machine on. Thus, if the machine is off (anson = '0'), the circuit should still answer the phone after 15 rings.

State declartion

In order to implement the FSM, we will need to define states. This is accomplished by the following line of VHDL code:

type STATE_TYPE is (STATE1, STATE2);

Then we can create a state signal using the following code:

signal state : STATE_TYPE;

Therefore, state assignments are performed with the following VHDL code:

state <= STATE1;

Assignment Requirements