aboutsummaryrefslogtreecommitdiff
path: root/src/top_count.vhd
diff options
context:
space:
mode:
authorFriedrich Beckmann <friedrich.beckmann@tha.de>2024-05-10 19:08:32 +0200
committerFriedrich Beckmann <friedrich.beckmann@hs-augsburg.de>2024-05-28 12:22:40 +0200
commitc6ee080fc68079392e9e66961bd11ebf52ab852d (patch)
tree533032cda8b117fcbe9ae7f252e27f9a7dbb2239 /src/top_count.vhd
parentcb1ff76e82fa1b77016530d61d16b426a9e1d5e3 (diff)
add top_count solutions
Diffstat (limited to 'src/top_count.vhd')
-rw-r--r--src/top_count.vhd40
1 files changed, 34 insertions, 6 deletions
diff --git a/src/top_count.vhd b/src/top_count.vhd
index 0a84349..ff25d1e 100644
--- a/src/top_count.vhd
+++ b/src/top_count.vhd
@@ -24,10 +24,38 @@ begin
rst_n <= KEY(0);
x <= KEY(1);
- cnt <= "0000";
- en <= '0';
- pwm <= '0';
-
+ cnt1sec_inst: entity work.cnt1sec
+ port map(
+ clk => clk,
+ rst_n => rst_n,
+ en_o => en
+ );
+
+ ringcnt_inst: entity work.ringcnt
+ port map(
+ clk => clk,
+ rst_n => rst_n,
+ en_i => en,
+ y_o => LEDR
+ );
+
+ cntm13_inst: entity work.cntm13
+ port map(
+ clk => clk,
+ rst_n => rst_n,
+ up_i => x,
+ en_i => en,
+ cnt_o => cnt
+ );
+
+ pwm_inst: entity work.pwm
+ port map(
+ clk => clk,
+ rst_n => rst_n,
+ ctrl_i => SW(3 downto 0),
+ pwm_o => pwm
+ );
+
bin2seg_inst: entity work.bin2seg
port map(
bin_i => cnt,
@@ -40,7 +68,7 @@ begin
2 => pwm,
1 => rst_n,
0 => clk);
- LEDR <= SW;
- LEDG <= KEY;
+ LEDG(3) <= pwm;
+ LEDG(2 downto 0) <= KEY(2 downto 0);
end architecture rtl; \ No newline at end of file