clk_uart:process(clk,rst) constant CntOne : std_logic_vector(CNTR_SIZE-1 downto 0) := CONV_STD_LOGIC_VECTOR(1,CNTR_SIZE); variable Cntr : std_logic_vector(CNTR_SIZE-1 downto 0); begin if Rising_Edge(clk) then if rst = '1' then Cntr := (others => '0'); s_uart_clk <= '0'; else Cntr := Cntr + CntOne;
if Cntr = CONV_STD_LOGIC_VECTOR(BAUD_DIVIDER,CNTR_SIZE) then s_uart_clk <= not s_uart_clk; Cntr := (others => '0'); else s_uart_clk <= s_uart_clk; end if; end if; end if; end process; CONV_STD_LOGIC_VECTOR(1,CNTR_SIZE)是啥意思?是0000000........1还是32个1? 其中BAUD_DIVIDER=1, 这是别人的程序,我的理解是这样:Cntr为 0000.......................1 0000......................10 ..........................11 . . . 这样好像不是二分频了
|