Question: - - - - - - - - - - - - - - - - - - - - - - - - -
Company:
Engineer:
Create Date: :: AM
Design Name:
Module Name: counterdisplay Behavioral
Project Name:
Target Devices:
Tool Versions:
Description:
Dependencies:
Revision:
Revision File Created
Additional Comments:
library IEEE;
use IEEE.STDLOGICALL;
Uncomment the following library declaration if using
arithmetic functions with Signed or Unsigned values
use IEEE.NUMERICSTDALL;
Uncomment the following library declaration if instantiating
any Xilinx leaf cells in this code.
library UNISIM;
use UNISIM.VComponents.all;
entity counterdisplay is
Port clk : in STDLOGIC;
reset : in STDLOGIC;
seg : out STDLOGICVECTOR downto ;
digit : inout STDLOGICVECTOR downto ;
digit : inout STDLOGICVECTOR downto ;
end counterdisplay;
architecture Behavioral of counterdisplay is
signal count : integer range to :;
signal clkdiv : integer range to :;
signal onesecclk : STDLOGIC :;
begin
Clock Divider for second delay
processclk
begin
if risingedgeclk then
if clkdiv then
clkdiv ;
onesecclk not onesecclk;
else
clkdiv clkdiv ;
end if;
end if;
end process;
Counter process
processonesecclk reset
begin
if reset then
count ;
elsif risingedgeonesecclk then
if count then
count ;
else
count count ;
end if;
end if;
end process;
segment decoder
processcount
begin
case count is
when digit;
when digit;
when digit;
when digit;
when digit;
when digit;
when digit;
when digit;
when digit;
when digit;
when others digit; Default to
end case;
case count mod is
when digit;
when digit;
when digit;
when digit;
when digit;
when digit;
when digit;
when digit;
when digit;
when digit;
when others digit; Default to
end case;
end process;
segment display logic
processdigit digit
begin
case digit is
when seg ;
when seg ;
when seg ;
when seg ;
when seg ;
when seg ;
when seg ;
when seg ;
when seg ;
when seg ;
when others seg ; Error
end case;
Add logic for second digit digit if needed
end process;
end Behavioral;
Course: EEL
a constraint code using this format
## This file is a general xdc for the Zybo Z Rev. B
## It is compatible with the Zybo Z and Zybo Z
## To use it in a project:
## uncomment the lines corresponding to used pins
## rename the used ports in each line, after getports according to the top level signal names in the project
##Clock signal
setproperty dict PACKAGEPIN K IOSTANDARD LVCMOSgetports sysclk ; #IOLPTMRCC Schsysclk
createclock add name sysclkpin period waveform getports sysclk ;
##Switches
#setproperty dict PACKAGEPIN G
