??? 06/18/08 15:33 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#156007 - Can I suggest Responding to: ???'s previous message |
Before you go on about what VHDL will and will not do ,that you get yourself a good book on the subject.
If you want to use a decimal constant to define a divider then you can go;- constant DIV1: integer:=112 -- which is pretty decimal variable Clock_Divisor : integer range 0 to 600 ; begin if (Local_Reset = '1') then Clock_Divisor := 0 ; Rate_Clock_X16 <= '0' ; elsif (rising_edge(clock)) then Clock_Divisor := Clock_Divisor + 1 ; Rate_Clock_X16 <= '0' ; -- Inertial assignment if (Rate_Select = '0') then -- Low speed if (Clock_Divisor = DIV2) then Clock_Divisor := 0 ; Rate_Clock_X16 <= '1' ; end if ; else -- High speed if (Clock_Divisor = DIV1) then Clock_Divisor := 0 ; Rate_Clock_X16 <= '1' ; end if ; end if ; end if ; end process ; Sorry if its not formatted but I cannot be bothered and i don't feel like teaching the ins and outs of a language to somebody who comes along with a load of preconceived ideas about what it will and won't do. |