- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how the test bench to run this program on ModelSim Altera?
library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; entity clkdiv is generic ( n : integer :=10); port ( clkin : in std_logic; clkout : out std_logic); end clkdiv; architecture arc of clkdiv is signal clk_tmp : std_logic := '0'; signal cnt : integer := 0 ; begin process (clkin,cnt) begin if (clkin'event and clkin='1') then cnt <= cnt + 1; if ( cnt = n-1 ) then clk_tmp <= not clk_tmp; cnt <= 0; end if; end if; end process; clkout <= clk_tmp ; end arc;Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You just need a process that generates the clock for the clkin port. Any good tutorial or book about VHDL simulation should tell you how to do it.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page