Motion FPGA
Motion FPGA for the MachX02-7000HE Breakout Board
sim Architecture Reference

Architecture sim of entity sim_on_percent. More...

Processes

pr_count  ( clk_in , rst_in )
 Counting process.

Signals

count  integer
 Clock count.
count_on  integer
 On count.

Detailed Description

Architecture sim of entity sim_on_percent.

Definition at line 26 of file sim_on_percent.vhd.

Member Function Documentation

§ pr_count()

pr_count (   clk_in ,
  rst_in  
)
Process

Counting process.

This process counts the clocks and signal on-time to get the percentage

Definition at line 36 of file sim_on_percent.vhd.

pr_count : PROCESS (clk_in, rst_in) IS
36  BEGIN
37 
38  IF (rst_in = '1') THEN
39  -- Reset counts
40  count <= 0;
41  count_on <= 0;
42  percent_out <= 0;
43  ELSIF (rising_edge(clk_in)) THEN
44  -- Update counts
45  count <= count + 1;
46  IF (signal_in = '1') THEN
47  count_on <= count_on + 1;
48  END IF;
49 
50  -- Calculate percentage
51  IF (count > 0) THEN
52  percent_out <= (count_on * 100) / count;
53  END IF;
54  END IF;
55 
56  END PROCESS pr_count;
57 
in signal_instd_logic
Signal input.
in clk_instd_logic
Clock.
integer count
Clock count.
integer count_on
On count.
in rst_instd_logic
Asynchronous reset.
out percent_outinteger
On percentage output.

The documentation for this class was generated from the following file: