//code verilog always@(posedge iCLK or negedge iRST_N) begin if(!iRST_N) begin LUT_INDEX <= 0; mLCD_ST <= 0; mDLY <= 0; mLCD_Start <= 0; mLCD_DATA <= 0; mLCD_RS <= 0; end else begin if(LUT_INDEX'0'); mLCD_ST <=(others =>'0'); mDLY <=(others =>'0'); mLCD_Start <='0'; mLCD_DATA <=(others =>'0'); mLCD_RS <='0'; else if(LUT_INDEX < "100110") then --LUT_SIZE = LCD_LINE1+32+1 =5+32+1=38; case(mLCD_ST) is when "000000" => mLCD_DATA <= LUT_DATA(7 downto 0); mLCD_RS <= LUT_DATA(8); mLCD_Start <= '1'; mLCD_ST <= "000001"; when "000001" => if(mLCD_Done ='1') then mLCD_Start <= '0'; mLCD_ST <= "000010"; end if; when "000010" => if(mDLY'0'); mLCD_ST <= "000110"; end if; when "000011" => LUT_INDEX <= LUT_INDEX +"000001"; mLCD_ST <= "000001"; when others => mLCD_ST <="111111"; end case; end if; end if; end if; end process;