Thursday, December 15, 2011
11:06 PM

VHDL Code For Up-Down Counter


Q. How do I write VHDL code for Up-Down Counter
Ans:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity ud is
Port ( clk,clr,up_down,sload : in STD_LOGIC;
Q : out STD_LOGIC_VECTOR (3 downto 0));
end ud;
architecture Behavioral of ud is
signal tmp: STD_LOGIC_VECTOR(3 downto 0);
begin
process(clk,clr,sload)
begin
if(sload='1')then
if(

0 comments:

Post a Comment