Ex 4 Digital 2
Ex 4 Digital 2
Introduction
In this experiment, we simulated a traffic light system using an Algorithmic State Machine
(ASM) on the ZedBoard. Starting with a countdown timer for the timing for each light,3 LEDS
for the light signals : red ,yellow and green. The timer shows time in seconds displayed on two
seven-segment displays. we used a clock divider to slow down the ZedBoard clock from
100MHz to 1Hz to count in real seconds .we used Other components, like a debouncing circuit
for push buttons and a BCD-to-seven-segment decoder, helped improve the accuracy of the
system.
Tools
1. Xilinx Vivado tool ZedBoard.
2. Power supply
3. Seven-Segment
Sequence R Y G Duration
a) Red 1 0 0 20 seconds
c) Green 0 0 1 20 seconds
d) Yellow 0 1 0 3 seconds
Using 3 processes to represent the system , the first is for the combinational inputs, the second is
for the next state and the third is for the synchronous changes in the registers .
An-Najah National University جامعة النجاح الوطنية
Faculty of Engineering and IT كلية الهندسة
وتكنولوجيا المعلومات
we declared a type (state_type) for the states to implement the ASM easily, and 2 signals for
current and next state.
here’s the code of the top module that contains 2PBDebouncers,ASM module ,countdown
timer ,clock divider, time_mux , and BCD_to_sevenSeg.
An-Najah National University جامعة النجاح الوطنية
Faculty of Engineering and IT كلية الهندسة
وتكنولوجيا المعلومات
An-Najah National University جامعة النجاح الوطنية
Faculty of Engineering and IT كلية الهندسة
وتكنولوجيا المعلومات
Conclusion
In this experiment ,we learned how to implement ASM in VHDL ,with a real life application .
we gained deeper understanding for ASM in our life . we implemented other modules such as
An-Najah National University جامعة النجاح الوطنية
Faculty of Engineering and IT كلية الهندسة
وتكنولوجيا المعلومات
clock divider which helped us to count in seconds, learning how to control the FPGA input clock
by coding, and finally implemented the multiplexing with BCD to seven segment decoder to
display the counting .