Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Oran Garrity
vlsilab21_garrity_mikschl
Commits
dc3c915f
Commit
dc3c915f
authored
Apr 08, 2021
by
Manuel Mikschl
Browse files
lab5: cntndnmodm_rtl.vhd modified
parent
3356df8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/#cntdnmodm_rtl.vhd#
0 → 100644
View file @
dc3c915f
-------------------------------------------------------------------------------
-- Module : cntdnmodm
-------------------------------------------------------------------------------
-- Author : Johann Faerber
-- Company : University of Applied Sciences Augsburg
-------------------------------------------------------------------------------
-- Description: Modulo-m n-Bit Down-Counter
-- including a low-active asynchronous reset input rst_ni
-- and a high-active enable input en_pi
-- additionally, a high_active output signal tc_o is produced,
-- when the counter reaches it's minimum value
-------------------------------------------------------------------------------
-- Revisions : see end of file
-------------------------------------------------------------------------------
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
USE IEEE.numeric_std.ALL;
ENTITY cntdnmodm IS
GENERIC (
n : natural := 4; -- counter width
m : natural := 10); -- modulo value
PORT (clk_i : IN std_ulogic;
rst_ni : IN std_ulogic;
en_pi : IN std_ulogic;
count_o : OUT std_ulogic_vector(n-1 DOWNTO 0);
tc_o : OUT std_ulogic
);
END cntdnmodm;
ARCHITECTURE rtl OF cntdnmodm IS
SIGNAL next_state, current_state : unsigned(n-1 DOWNTO 0);
BEGIN
-- includes decrementer and modulo logic
next_state_logic : next_state <= to_unsigned(m-1, n) WHEN current_state = 0 ELSE
current_state - 1;
state_register :
counter_output :
terminal_count :
END rtl;
-------------------------------------------------------------------------------
-- Revisions:
-- ----------
-- $Id:$
-------------------------------------------------------------------------------
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment