SlideShare a Scribd company logo
E.
(
DR. AM
BEDKAR INSTITUTE
OF TECHNOLOGY
An Autonomous Institute Affiliated to Visveswaraya Technological University,
Belagavi Accredited with ‘A’ grade by NAAC)
Near Jnana Bharathi Campus Bangalore -560056
ENGINEERING
DEPARTMENT OF TELECOMMUNICATION
(Accredited by NBA)
Group Activity
on
”FUNDAM
ENTALS OF HARDW
ARE DESCRIPTIONLANGUAGE
(18ET44)”
TOPIC ON
DESIGNA STOP W
ATCHONFPGA USING VHDL
Submitted in partial fulfillment of the requirement for the Award of the Degree of
Bachelor of Engineering
in
Telecommunication Engineering
For the academic year 2021-22
SUBMITTEDBY:
1DA20ET050 – VEENA R P
1DA20ET051 – VISHWAS HUGAR
1DA20ET052 – VISMITHA S L
1DA21ET401 – CHETHAN S P
FACULTY INCHARGE :
DR.PRAVEEN K B
DEPARTMENT OF ETE
DR.AIT,BENGALURU
Timer's [stopwatch) function is to find out how long it takes in an
activity. Here we have tried to realize a timer of reasonable
accuracy and reliability. This timer project is a software and
hardware co-design. The time will be shown on the FPGA board
and on the seven-segment display.
The system will be modeled in VHDL (Very-high-speed integrated
circuit Hardware Description Language) and implemented on the
Altera DEZ Cyclone FPGA board.
Introduction
• The timer we designed is a time-keeping device that is meant to
measure the time elapsed from the start to end of any event. The
timer has several different functions including both start and stop
reset and is able to clear the hundredth of a second output.
• We used the Altera DEZ Cyclone II FPGA Board. The board was used to
implement our timer, and seven segment display on it was used to
display the elapsed time. The computing language that we used to
write the programs VHDL. For the functions, we used three (start,
stop and reset) switches and a 50GHz clock. The elapsed time will be
displayed on the seven segment display. When the pause switch is
activated, the stopwatch will stop running. When the last function
reset is activated, all digits change to zeros.
Block diagram
To simplify the development of complex designs, the design is broken up
in to a number of smaller, less complex blocks. This approach is called
“Divide-and-Conquer”.
The FPGA will run on a high clock frequency.
Hence, a single button press of the user will lead to an active signal at
the input of our blocks for many thousand or even millions of clock
cycles. Thus, an edge detection circuit is needed to ensure that each
acknowledge of a button translates only to a signal being active for one
clock cycle. To control the different states of the stop watch, an FSM
(Finite-State-Machine) has to be employed in the design and
subsequently this FSM has to trigger a counter counting the time. This
binary value has to be decoded into a representation matching the
inputs of the seven-segment driver.
Clock and reset signals have been omitted for simplicity, however, we
have to highlight that all sequential circuits need to be reseted using
the system reset signal. Throughout, all docked gates should be
sensitive to the rising edge of the clock.
Implementation
• The task has been implementing considering structural modelling
style in HDL The Lab main is the main file while BCDCount, Hex
Decoder, FSM, CLK 100Hz are the component files.
• The HEX decoder file basically contains the binary to HEX conversion
while in FSM file the start stop reset algorithm is implemented,
BCDCount file contains the BCD number count while the clk100HZ
contain the clock input and output and all the sub files are then called
in the main file using structural programming.
LIBRARY ieee :
USE ieee std_logic_1164.all;
USE ieee std_logic_unsigned.all:
ENTITY labmain IS
PORT (start stop,reset,clock_50 :IN STD_LOGIC
HEX3,HEX2,HEX1,HEXO:OUTSTD_LOGIC_VECTOR(6
DOWNTO 0));
5
END labmain;
ARCHITECTURE structure OF labmain IS
COMPONENT BCDCount
PORT(clock.reset,enable
IN STD LOGIC;
carry BCD
END COMPONENT;
:OUT STD LOGIC:
OUT STD_LOGIC_VECTOR(3 DOWNTO 0}};
COMPONENT CLK100Hz
PORT(clk in IN STD_LOGIC
cik_out:OUT STD_LOGIC);
END COMPONENT;
COMPONENT HEXdecoder
PORT(Digin IN STD_LOGIC_VECTOR(3 DOWNTO 0); Segout
:OUT STD_LOGIC_VECTOR(6 DOWNTO 0});
END COMPONENT:
COMPONENT fam
PORT(clock,start, stop,reset IN STD_LOGIC
clear, enable OUT STD_LOGIC);
END COMPONENT;
SIGNAL clear, enable,clk100 STD_LOGIC,
Main File
SIGNAL carry2,carry1, carry0: STD_LOGIC;
SIGNAL BCD3,BCD2,BCD1,BCD0 : STD_LOGIC_VECTOR(3 DOWNTO 0);
BEGIN
fsm1 : fsm PORT MAP(clock 50,start, stop, reset,clear,enable);
clkdvd :dk100Hz PORT MAP(clock_50, clk100);
BCDCO: BCDcount PORT MAP(clk100,clear, enable, carry,BCD0);
BCDC1: BCDcount PORT MAP(carry0,clear,1,carry1,BCD1);
BCDC2: BCDcount PORT MAP(carry1,clear, ‘1’, carry2,BCD2);
BCDC3: BCDcount PORT MAP(carry2,clear,’1’,OPEN, BCD3);
HEXDO:HEXdecoder PORT MAP(BCDO, HEXO);
HEXD1: HEXdecoder PORT MAP(BCD1,HEX1);
HEXD2: HEXdecoder PORT MAP(BCD2, HEX2); HEXD3 HEXdecoder PORT MAP(BCD3, HEX3);
END structure;
Main File
FSM
LIBRARY leee;
USE leee.std_logic_1164.all;
USE ieee std_logic_unsigned.all;
ENTITY fsm IS
PORT(clock,start stop,reset IN STD LOGIC;
clear,enable OUT STD_LOGIC);
END fam;
ARCHITECTURE Behavior OF FSM IS
TYPE state_type IS (nocount,nocountreset.count.countreset);
SIGNAL V: state_type;
BEGIN
PROCESS(clock)
BEGIN
IF(clock’EVENT AND clock=1’) THEN
CASE y IS
WHEN nocount=>
IF reset=‘0” THEN
y<=nocountreset;
ELSIF start=‘0’ THEN
Y< count;
ELSE
ycenocount;
END IF;
WHEN nocountreset->
IF reset=‘1’ THEN
yanocount; ELSE
ycenocountreset;
END IF;
WHEN Count>
IF reset-’O’ THEN
y<=countreset;
ELSIF stop=‘0’ THEN
ELSE
ye count;
END IF: WHEN countreset->
IF reset-’1’ THEN
y<=count;
ELSE
y<=countreset:
END IF;
END CASE;
END IF;
END PROCESS;
WITH Y SELECT
clear ‘0 WHEN nocount,
‘1’ WHEN nocountreset,
‘0’ WHEN count,
‘I’ WHEN countreset,
‘0’ WHEN OTHERS; WITH Y SELECT
enable<=‘0’ WHEN nocount,
‘0’ WHEN nocountreset,
‘1’ WHEN count, ‘1’ WHEN OTHERS:
7
end Behavior;
FSM
HEX DECODER
Library leee:
use ieee.std_logic_1164.all; entity HEXdecoder is
port
Digin in std_logic_vector(3 downto 0);
Segout :out std_logic_vector(6 downto 0));
end HEXdecoder:
architecture behavior of HEXdecoder is
begin with Digin select
Segout <= “1000000” when “0000”,
“1111001” when “0001”,
“0100100” when “0010”,
“0110000” when “0011”,
“0011001” when “0100”,
“0010010” when “0101”,
“0000010” when “0110”,
“1111000” when “0111”,
“0000000” when “1000”,
“0011000 when “2001”,
“0001000” when “1010”,-A
“0000011” when “1011”,-b
“0100111 when “1100”,-C
“0100001” when “1101”,-d
“0000110” when “1110”,-E
“0001110” when “1111”,--F
“0110110” when others;-weird character
end behavior;
CLK
Library IEEE;
use IEEE.STD_LOGIC_1164 ALL;
entity clk100Hz is
Port(
cik in: In STD_LOGIC
clk_out: out STD_LOGIC);
end clk100Hz;
architecture Behavioral of clk100Hz is
signal temporal: STD_LOGIC: signal counter: integer range 0
to 249999 := 0;
begin
frequency divider: process (clk_in) begin
if (clk_in’event and clk_in= ‘1’) then
if (counter = 249999) then
Temporal <= NOT(temporal); counter <= 0;
else
counter < counter + 1;
end if;
end if;
end process:
clk_out <= temporal,
end Behavioral;
BCD Counter enable
LIBRARY leee;
USE ieee.std_logic_1164.all;
USE leee.std_logic_unsigned.all:
ENTITY BCD countenable (S
PORT (clock,reset, enable, E: IN STD_LOGIC
carry:OUT STD_LOGIC: BCDO : BUFFER
STD_LOGIC_VECTOR(3 DOWNTO 0)};
END BCDcountenable;
ARCHITECTURE Behavior Of BCDcountenable IS
BEGIN
PROCESS (clock)
BEGIN IF (clock’EVENT AND clock = “1”) THEN
IF Reset = ‘1’ THEN
BCD00000”;
ELSIF E=“I’ THEN
IF BCDO”1001” THEN
BCDD <= “0000”;
Carry <= ‘1’; ELSE
BCD0BCDO+1;
carry <= ‘0’;
END IF:
END IF;
END IF;
END PROCESS;
END Behavior;
BCD Count
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee std_logic_unsigned.all;
ENTITY BCDcount IS
PORT (Clock
IN Reset
STD_LOGIC:
IN STD_LOGIC
Enable
Carry
IN STD_LOGIC
OUT STD_LOGIC OUT STD_LOGIC_VECTOR(3 DOWNTO 0));
BCD
END BCDCount;
ARCHITECTURE Behavior OF BCDcount IS signal count:
std_logic_vector(3 downto 0);
BEGIN
PROCESS (Reset, Clock)
BEGIN
IF Reset = ‘1’ THEN
count <= “0000”;
Carry <= ‘0’;
ELSIF Clock’EVENT AND Clock = ‘1’ THEN IF Enable = 1 THEN
IF count = “1001” THEN
count <= “0000”;
Carry ‘1’; ELSE
count < count+1;
Carry <= ‘0’;
END IF; END IF:
END IF;
END PROCESS:
BCD<=count;
END Behavior;
Block scheme
Waveform diagram

More Related Content

Similar to Timer ppt

Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDL
Yaser Kalifa
 
Data Flow Modeling
Data Flow ModelingData Flow Modeling
Data Flow Modeling
Padmanaban Kalyanaraman
 
Fpga implementation of power efficient all digital phase locked loop
Fpga implementation of power efficient all digital phase locked loopFpga implementation of power efficient all digital phase locked loop
Fpga implementation of power efficient all digital phase locked loop
IAEME Publication
 
final report updated
final report updatedfinal report updated
final report updated
farheen hussain
 
VLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALUVLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALU
Sachin Kumar Asokan
 
VLSI Lab manual PDF
VLSI Lab manual PDFVLSI Lab manual PDF
VLSI Lab manual PDF
UR11EC098
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project report
Akash Mhankale
 
project report
project reportproject report
project report
Nashath Hussain
 
Session1
Session1Session1
Session1
omarAbdelrhman2
 
Fpga 1
Fpga 1Fpga 1
VLSI lab manual
VLSI lab manualVLSI lab manual
VLSI lab manual
VaniPrasad11
 
The Principle Of Ultrasound Imaging System
The Principle Of Ultrasound Imaging SystemThe Principle Of Ultrasound Imaging System
The Principle Of Ultrasound Imaging System
Melissa Luster
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
Ariel Tonatiuh Espindola
 
Reporte vhdl9
Reporte vhdl9Reporte vhdl9
Reporte vhdl9
Miguel Angel Peña
 
VHDL Part 4
VHDL Part 4VHDL Part 4
VHDL Part 4
Abhilash Nair
 
Snake Game on FPGA in Verilog
Snake Game on FPGA in VerilogSnake Game on FPGA in Verilog
Snake Game on FPGA in Verilog
Krishnajith S S
 
PLL
PLLPLL
Digital system design practical file
Digital system design practical fileDigital system design practical file
Digital system design practical file
Archita Misra
 
VLSI Final Design Project
VLSI Final Design ProjectVLSI Final Design Project
VLSI Final Design Project
Vignesh Ganesan
 
chapter 4
chapter 4chapter 4
chapter 4
GAGANAP12
 

Similar to Timer ppt (20)

Introduction to VHDL
Introduction to VHDLIntroduction to VHDL
Introduction to VHDL
 
Data Flow Modeling
Data Flow ModelingData Flow Modeling
Data Flow Modeling
 
Fpga implementation of power efficient all digital phase locked loop
Fpga implementation of power efficient all digital phase locked loopFpga implementation of power efficient all digital phase locked loop
Fpga implementation of power efficient all digital phase locked loop
 
final report updated
final report updatedfinal report updated
final report updated
 
VLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALUVLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALU
 
VLSI Lab manual PDF
VLSI Lab manual PDFVLSI Lab manual PDF
VLSI Lab manual PDF
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project report
 
project report
project reportproject report
project report
 
Session1
Session1Session1
Session1
 
Fpga 1
Fpga 1Fpga 1
Fpga 1
 
VLSI lab manual
VLSI lab manualVLSI lab manual
VLSI lab manual
 
The Principle Of Ultrasound Imaging System
The Principle Of Ultrasound Imaging SystemThe Principle Of Ultrasound Imaging System
The Principle Of Ultrasound Imaging System
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
 
Reporte vhdl9
Reporte vhdl9Reporte vhdl9
Reporte vhdl9
 
VHDL Part 4
VHDL Part 4VHDL Part 4
VHDL Part 4
 
Snake Game on FPGA in Verilog
Snake Game on FPGA in VerilogSnake Game on FPGA in Verilog
Snake Game on FPGA in Verilog
 
PLL
PLLPLL
PLL
 
Digital system design practical file
Digital system design practical fileDigital system design practical file
Digital system design practical file
 
VLSI Final Design Project
VLSI Final Design ProjectVLSI Final Design Project
VLSI Final Design Project
 
chapter 4
chapter 4chapter 4
chapter 4
 

Recently uploaded

spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
Roger Rozario
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
UReason
 
Introduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptxIntroduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptx
MiscAnnoy1
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
AjmalKhan50578
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
LAXMAREDDY22
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1
PKavitha10
 
AI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptxAI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptx
architagupta876
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 

Recently uploaded (20)

spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
 
Introduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptxIntroduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptx
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1
 
AI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptxAI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptx
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 

Timer ppt

  • 1. E. ( DR. AM BEDKAR INSTITUTE OF TECHNOLOGY An Autonomous Institute Affiliated to Visveswaraya Technological University, Belagavi Accredited with ‘A’ grade by NAAC) Near Jnana Bharathi Campus Bangalore -560056 ENGINEERING DEPARTMENT OF TELECOMMUNICATION (Accredited by NBA) Group Activity on ”FUNDAM ENTALS OF HARDW ARE DESCRIPTIONLANGUAGE (18ET44)” TOPIC ON DESIGNA STOP W ATCHONFPGA USING VHDL Submitted in partial fulfillment of the requirement for the Award of the Degree of Bachelor of Engineering in Telecommunication Engineering For the academic year 2021-22 SUBMITTEDBY: 1DA20ET050 – VEENA R P 1DA20ET051 – VISHWAS HUGAR 1DA20ET052 – VISMITHA S L 1DA21ET401 – CHETHAN S P FACULTY INCHARGE : DR.PRAVEEN K B DEPARTMENT OF ETE DR.AIT,BENGALURU
  • 2. Timer's [stopwatch) function is to find out how long it takes in an activity. Here we have tried to realize a timer of reasonable accuracy and reliability. This timer project is a software and hardware co-design. The time will be shown on the FPGA board and on the seven-segment display. The system will be modeled in VHDL (Very-high-speed integrated circuit Hardware Description Language) and implemented on the Altera DEZ Cyclone FPGA board. Introduction
  • 3. • The timer we designed is a time-keeping device that is meant to measure the time elapsed from the start to end of any event. The timer has several different functions including both start and stop reset and is able to clear the hundredth of a second output. • We used the Altera DEZ Cyclone II FPGA Board. The board was used to implement our timer, and seven segment display on it was used to display the elapsed time. The computing language that we used to write the programs VHDL. For the functions, we used three (start, stop and reset) switches and a 50GHz clock. The elapsed time will be displayed on the seven segment display. When the pause switch is activated, the stopwatch will stop running. When the last function reset is activated, all digits change to zeros.
  • 4. Block diagram To simplify the development of complex designs, the design is broken up in to a number of smaller, less complex blocks. This approach is called “Divide-and-Conquer”. The FPGA will run on a high clock frequency.
  • 5. Hence, a single button press of the user will lead to an active signal at the input of our blocks for many thousand or even millions of clock cycles. Thus, an edge detection circuit is needed to ensure that each acknowledge of a button translates only to a signal being active for one clock cycle. To control the different states of the stop watch, an FSM (Finite-State-Machine) has to be employed in the design and subsequently this FSM has to trigger a counter counting the time. This binary value has to be decoded into a representation matching the inputs of the seven-segment driver. Clock and reset signals have been omitted for simplicity, however, we have to highlight that all sequential circuits need to be reseted using the system reset signal. Throughout, all docked gates should be sensitive to the rising edge of the clock.
  • 6. Implementation • The task has been implementing considering structural modelling style in HDL The Lab main is the main file while BCDCount, Hex Decoder, FSM, CLK 100Hz are the component files. • The HEX decoder file basically contains the binary to HEX conversion while in FSM file the start stop reset algorithm is implemented, BCDCount file contains the BCD number count while the clk100HZ contain the clock input and output and all the sub files are then called in the main file using structural programming.
  • 7. LIBRARY ieee : USE ieee std_logic_1164.all; USE ieee std_logic_unsigned.all: ENTITY labmain IS PORT (start stop,reset,clock_50 :IN STD_LOGIC HEX3,HEX2,HEX1,HEXO:OUTSTD_LOGIC_VECTOR(6 DOWNTO 0)); 5 END labmain; ARCHITECTURE structure OF labmain IS COMPONENT BCDCount PORT(clock.reset,enable IN STD LOGIC; carry BCD END COMPONENT; :OUT STD LOGIC: OUT STD_LOGIC_VECTOR(3 DOWNTO 0}}; COMPONENT CLK100Hz PORT(clk in IN STD_LOGIC cik_out:OUT STD_LOGIC); END COMPONENT; COMPONENT HEXdecoder PORT(Digin IN STD_LOGIC_VECTOR(3 DOWNTO 0); Segout :OUT STD_LOGIC_VECTOR(6 DOWNTO 0}); END COMPONENT: COMPONENT fam PORT(clock,start, stop,reset IN STD_LOGIC clear, enable OUT STD_LOGIC); END COMPONENT; SIGNAL clear, enable,clk100 STD_LOGIC, Main File
  • 8. SIGNAL carry2,carry1, carry0: STD_LOGIC; SIGNAL BCD3,BCD2,BCD1,BCD0 : STD_LOGIC_VECTOR(3 DOWNTO 0); BEGIN fsm1 : fsm PORT MAP(clock 50,start, stop, reset,clear,enable); clkdvd :dk100Hz PORT MAP(clock_50, clk100); BCDCO: BCDcount PORT MAP(clk100,clear, enable, carry,BCD0); BCDC1: BCDcount PORT MAP(carry0,clear,1,carry1,BCD1); BCDC2: BCDcount PORT MAP(carry1,clear, ‘1’, carry2,BCD2); BCDC3: BCDcount PORT MAP(carry2,clear,’1’,OPEN, BCD3); HEXDO:HEXdecoder PORT MAP(BCDO, HEXO); HEXD1: HEXdecoder PORT MAP(BCD1,HEX1); HEXD2: HEXdecoder PORT MAP(BCD2, HEX2); HEXD3 HEXdecoder PORT MAP(BCD3, HEX3); END structure; Main File
  • 9. FSM LIBRARY leee; USE leee.std_logic_1164.all; USE ieee std_logic_unsigned.all; ENTITY fsm IS PORT(clock,start stop,reset IN STD LOGIC; clear,enable OUT STD_LOGIC); END fam; ARCHITECTURE Behavior OF FSM IS TYPE state_type IS (nocount,nocountreset.count.countreset); SIGNAL V: state_type; BEGIN PROCESS(clock) BEGIN IF(clock’EVENT AND clock=1’) THEN CASE y IS WHEN nocount=> IF reset=‘0” THEN y<=nocountreset; ELSIF start=‘0’ THEN Y< count; ELSE ycenocount; END IF; WHEN nocountreset-> IF reset=‘1’ THEN yanocount; ELSE ycenocountreset; END IF; WHEN Count> IF reset-’O’ THEN y<=countreset; ELSIF stop=‘0’ THEN ELSE ye count; END IF: WHEN countreset-> IF reset-’1’ THEN y<=count; ELSE y<=countreset: END IF; END CASE;
  • 10. END IF; END PROCESS; WITH Y SELECT clear ‘0 WHEN nocount, ‘1’ WHEN nocountreset, ‘0’ WHEN count, ‘I’ WHEN countreset, ‘0’ WHEN OTHERS; WITH Y SELECT enable<=‘0’ WHEN nocount, ‘0’ WHEN nocountreset, ‘1’ WHEN count, ‘1’ WHEN OTHERS: 7 end Behavior; FSM
  • 11. HEX DECODER Library leee: use ieee.std_logic_1164.all; entity HEXdecoder is port Digin in std_logic_vector(3 downto 0); Segout :out std_logic_vector(6 downto 0)); end HEXdecoder: architecture behavior of HEXdecoder is begin with Digin select Segout <= “1000000” when “0000”, “1111001” when “0001”, “0100100” when “0010”, “0110000” when “0011”, “0011001” when “0100”, “0010010” when “0101”, “0000010” when “0110”, “1111000” when “0111”, “0000000” when “1000”, “0011000 when “2001”, “0001000” when “1010”,-A “0000011” when “1011”,-b “0100111 when “1100”,-C “0100001” when “1101”,-d “0000110” when “1110”,-E “0001110” when “1111”,--F “0110110” when others;-weird character end behavior;
  • 12. CLK Library IEEE; use IEEE.STD_LOGIC_1164 ALL; entity clk100Hz is Port( cik in: In STD_LOGIC clk_out: out STD_LOGIC); end clk100Hz; architecture Behavioral of clk100Hz is signal temporal: STD_LOGIC: signal counter: integer range 0 to 249999 := 0; begin frequency divider: process (clk_in) begin if (clk_in’event and clk_in= ‘1’) then if (counter = 249999) then Temporal <= NOT(temporal); counter <= 0; else counter < counter + 1; end if; end if; end process: clk_out <= temporal, end Behavioral;
  • 13. BCD Counter enable LIBRARY leee; USE ieee.std_logic_1164.all; USE leee.std_logic_unsigned.all: ENTITY BCD countenable (S PORT (clock,reset, enable, E: IN STD_LOGIC carry:OUT STD_LOGIC: BCDO : BUFFER STD_LOGIC_VECTOR(3 DOWNTO 0)}; END BCDcountenable; ARCHITECTURE Behavior Of BCDcountenable IS BEGIN PROCESS (clock) BEGIN IF (clock’EVENT AND clock = “1”) THEN IF Reset = ‘1’ THEN BCD00000”; ELSIF E=“I’ THEN IF BCDO”1001” THEN BCDD <= “0000”; Carry <= ‘1’; ELSE BCD0BCDO+1; carry <= ‘0’; END IF: END IF; END IF; END PROCESS; END Behavior;
  • 14. BCD Count LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee std_logic_unsigned.all; ENTITY BCDcount IS PORT (Clock IN Reset STD_LOGIC: IN STD_LOGIC Enable Carry IN STD_LOGIC OUT STD_LOGIC OUT STD_LOGIC_VECTOR(3 DOWNTO 0)); BCD END BCDCount; ARCHITECTURE Behavior OF BCDcount IS signal count: std_logic_vector(3 downto 0); BEGIN PROCESS (Reset, Clock) BEGIN IF Reset = ‘1’ THEN count <= “0000”; Carry <= ‘0’; ELSIF Clock’EVENT AND Clock = ‘1’ THEN IF Enable = 1 THEN IF count = “1001” THEN count <= “0000”; Carry ‘1’; ELSE count < count+1; Carry <= ‘0’; END IF; END IF: END IF; END PROCESS: BCD<=count; END Behavior;