Saturday, 27 September 2014

Digital Clock program By VHDL

OBJECTIVE:-    Digital Clock By VHDL 

Program :- 


library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity digitalclk2 is
    Port ( clk : in std_logic;
           s,m,h : out integer := 0 );
end digitalclk2;

architecture Behavioral of digitalclk2 is

begin
Process(clk)
variable s1 : integer := -1 ;
Variable  m1,h1 : integer := 0 ;
begin
if(clk = '1') then
s1 := s1 +1 ;
   s <= s1  ;
   end if ;
   if(s1= 60)then
   s1:= 0 ;
   s <= s1;
   m1 := m1+1 ;
m   <= m1;
   end if ;
   if(m1= 60)then
   m1:=0 ;
   m <= m1;
   h1:= h1 + 1;
   h <= h1;
   end if ;
   if(h1= 24)then
   h1:= 0 ;
   m1:= 0 ;
   s1:= 0 ;
   end if ;
   end process;
end Behavioral;
-------------------------------------------------------------------------------------

DESCRIPTION:-

·         A digital clock is a type of clock that displays the time digitally, i.e. in cyphers, as opposed to an analog clock, where the time is displayed by hands.
·         We use behavioral modeling style in this project . In the behavioral modeling we use if else statement .
·         We use integer counter for count the second,minut and hour .
·         Every 60 count we do the change or increment in the minut .

·        Syntax of if else statement :-

if <condition> then
statements
...
[
elsif <condition> then
statements
...
else
statements
...
]
end if;
·         here we takes three variables second , minute  and hour .
·         we  gives the condition that every 60 count variable takes a increment in minute variable and every 60 of minute variable ,hour variable take a increment .
·         when hour variable counter show 24 then every second ,minute and hour variable will be zero  .


COMPONENTS REQUIRED:-
                    i.            Xilinx project navigator (software)
                  ii.            Modelsim 5.4(software)
                iii.            FPGA board (hardware )


Application :-

·         In The Intelligent Digital Clock :- Intelligent Digital Clock with Ability to Communicate with PC has optional battery backup for 72 hours .
·         In Digital Clocks These clocks are designed to be used in industries or common waiting halls like Airports, Railway Stations, Hospitals etc.
·         Today digital clock are used in many electronics circuit where we want a specific task after a particular time .

No comments:

Post a Comment