VLSI Clock TOP
VLSI Clock TOP
PROJECT REPORT
Slot: A2+TA2
VLSI based Alarm Clock top
Kamisetty Sai Sravan Vallam Yaswanth Koilada Bharath Surya
22BEC0273 22BEC0899 22BEC0135
module lcd_driver_4(
alarm_time_ms_hr,
alarm_time_ls_hr,
alarm_time_ms_min,
alarm_time_ls_min, Figure 1: Block Diagram and Schematic of the Alarm Clock
System
current_time_ms_hr,
current_time_ls_hr,
current_time_ms_min,
current_time_ls_min,
key_ms_hr,
key_ls_hr,
key_ms_min,
key_ls_min,
show_a,
show_current_time, Figure 2: Circuit Diagram of the Time Generator Module
Figure 3: Circuit Diagram of the Counter Module
B. State Transitions
The FSM transitions between states based on specific
conditions and user inputs. The transitions are governed by
the following rules:
1. SHOW_TIME to SHOW_ALARM: The system
Figure 6: Circuit Diagram of the FSM Module transitions to the SHOW_ALARM state when
the alarm_button is pressed.
2. SHOW_TIME to KEY_STORED: The system system responds correctly to user inputs and transitions
transitions to the KEY_STORED state when a key smoothly between different operational states. The FSM's
input (other than NOKEY) is detected. functionality includes:
3. KEY_STORED to KEY_WAITED: The system Displaying the Current Time: In the SHOW_TIME
transitions to the KEY_WAITED state after storing state, the FSM ensures that the current time is
the key input. displayed on the LCD.
4. KEY_WAITED to KEY_ENTRY: The system Setting the Time: In the SET_CURRENT_TIME
transitions to the KEY_ENTRY state if no key state, the FSM processes key inputs to set the
input is detected within a specified time. current time.
5. KEY_WAITED to SHOW_TIME: The system Setting the Alarm: In the SET_ALARM_TIME
transitions back to the SHOW_TIME state if the state, the FSM processes key inputs to set the alarm
timeout occurs without a key input. time.
6. KEY_ENTRY to SET_ALARM_TIME: The Triggering the Alarm: When the current time
system transitions to the SET_ALARM_TIME matches the set alarm time, the FSM triggers the
state when the alarm_button is pressed. alarm sound.
7. KEY_ENTRY to SET_CURRENT_TIME: The Handling Timeouts: The FSM manages timeouts to
system transitions to the SET_CURRENT_TIME ensure that the system returns to the default state if
state when the time_button is pressed. no further action is taken within a specified time.
8. KEY_ENTRY to SHOW_TIME: The system In summary, the FSM is a vital component of the alarm
transitions back to the SHOW_TIME state if the clock system, ensuring that the system operates correctly
timeout occurs without further action. and efficiently based on user inputs and system events. The
9. SHOW_ALARM to SHOW_TIME: The system Moore state diagram provides a visual representation of the
transitions back to the SHOW_TIME state when FSM's states and transitions, aiding in the understanding and
the alarm_button is released. verification of the system's functionality.[7]
10. SET_ALARM_TIME to SHOW_TIME: The
system transitions back to the SHOW_TIME state
after setting the alarm time. V. TESTBENCH AND OUTPUTS
11. SET_CURRENT_TIME to SHOW_TIME: The The system was simulated using a Verilog simulator to verify
system transitions back to the SHOW_TIME state the functionality of each module and the overall system.
after setting the current time. Testbenches were created to test various scenarios, including
setting the current time, setting the alarm time, and triggering
C. FSM Implementation the alarm sound. The simulation results confirmed the
The FSM is implemented using Verilog HDL, with the state accuracy and functionality of the alarm clock, demonstrating
transitions and outputs controlled by the fsm module. The its practical applicability.[8]
module takes various inputs, including clock, reset,
one_second, time_button, alarm_button, key, and
reset_count, and produces outputs such as load_new_a, Simulation Results
show_a, show_new_time, load_new_c, and shift.
1.
key is set to 4'b0001, 4'b0010, 4'b0100, and 4'b1000 After 100 ns, reset is released (set to 0).
to set the alarm time. time_button is pulsed twice to enter the time-setting
The system operates normally, toggling time_button, mode.
alarm_button, fastwatch and key to simulate user key is set to 4'b1010 and time_button is pulsed to set
interactions. the hours.
Output Comments: key is set to 4'b0101 to set the minutes.
The provided waveform image shows the behaviour fastwatch is toggled to enable/disable fast time
of the alarm clock system under the specified input adjustment.
conditions.
alarm_button is pulsed to enter the alarm-setting
The system initializes correctly when reset is high. mode.
Alloutputs(ms_hour, ls_hour, ms_minute, ls_minute
, alarm_sound) are set to their default values. key is set to 4'b0001, 4'b0010, 4'b0100, and 4'b1000
to set the alarm time.
The clock signal toggles every 5 ns, providing the
necessary clock pulses for the system. The system operates normally, toggling time_button,
alarm_button, fastwatch and key to simulate user
When time_button is pulsed, the system enters the interactions.
time-setting mode. The values
of ms_hour, ls_hour, ms_minute,
and ls_minute update according to the key inputs. Output Comments:
Toggling fastwatch affects the speed of time The provided waveform image shows the behavior
increment. When fastwatch is high, the time of the alarm clock system under the specified input
increments faster, as observed in the waveform. conditions.
When alarm_button is pulsed, the system enters the The system initializes correctly when reset is high.
alarm-setting mode. The values of the alarm time All outputs (ms_hour, ls_hour, ms_minute,
update according to the key inputs. ls_minute, alarm_sound) are set to their default
When the current time matches the set alarm values.
time, alarm_sound is triggered. The waveform The clock signal toggles every 5 ns, providing the
shows alarm_sound going high at the correct time, necessary clock pulses for the system.
confirming the functionality of the alarm triggering
mechanism. When time_button is pulsed, the system enters the
time-setting mode. The values
The system operates correctly, updating the time and of ms_hour, ls_hour, ms_minute,
alarm values as per the user inputs. The waveform and ls_minute update according to the key inputs.
shows the expected behaviour of the system under
normal operation. Toggling fastwatch affects the speed of time
increment. When fastwatch is high, the time
2. increments faster, as observed in the waveform.
When alarm_button is pulsed, the system enters the
alarm-setting mode. The values of the alarm time
update according to the key inputs.
When the current time matches the set alarm
time, alarm_sound is triggered. The waveform
shows alarm_sound going high at the correct time,
confirming the functionality of the alarm triggering
mechanism.
Figure 10: Testbench Waveform for Alarm Clock System The system operates correctly, updating the time and
without toggling fast watch. alarm values as per the user inputs. The waveform
shows the expected behavior of the system under
normal operation.
3. Toggling fastwatch affects the speed of time
increment. When fastwatch is high, the time
increments faster, as observed in the waveform.
When alarm_button is pulsed, the system enters the
alarm-setting mode. The values of the alarm time
update according to the key inputs.
When the current time matches the set alarm
time, alarm_sound is triggered. The waveform
shows alarm_sound going high at the correct time,
confirming the functionality of the alarm triggering
Figure 11: Testbench Waveform for Alarm Clock mechanism.
System with Extended Testing The system operates correctly, updating the time and
Input Conditions: alarm values as per the user inputs. The waveform
shows the expected behavior of the system under
reset is set to 1 to initialize the system. normal operation.
clock is toggled every 5 ns. In the previous waveform, the system was tested with
time_button, alarm_button and fastwatch are a shorter sequence of operations and fewer
initially set to 0. repetitions.
key is initially set to 4'b0011. The current waveform includes more extensive
testing with multiple cycles of time and alarm
After 100 ns, reset is released (set to 0). setting, demonstrating the system's robustness and
stability over extended periods.
time_button is pulsed twice to enter the time-setting
mode. The repeat loop in the testbench allows for
automated testing of multiple scenarios, ensuring
key is set to 4'b1010 and time_button is pulsed to set comprehensive verification of the system's
the hours. functionality.
key is set to 4'b0101 to set the minutes. The waveform shows consistent behavior across
fastwatch is toggled to enable/disable fast time multiple cycles, confirming the reliability of the
adjustment. alarm clock system under various conditions.