【正文】
(1)顯示結果: 17 結果分析:當實驗板上電后,液晶屏幕會顯 示如圖( 1) . 1. 當撥碼開關 2 處于 “off”時,液晶屏幕會整體移動; 2. 當撥碼開關 1 處于“ on”時,液晶屏幕會整體右移,處于“ off” 時,液晶屏幕會整體左移; 3. 當撥碼開關 1 處于“ on”時,液晶屏幕移動速度相對較慢,處于 “ off”時,液晶屏幕移動速度相對較快 六.心得體會: 通過本次課程設計,基本 掌握 了 基于 CPLD/FPGA 的數(shù)字系統(tǒng)開發(fā)工具 ,了解了 開發(fā)流程,自主進行 了 基于 CPLD/FPGA 的數(shù)字系統(tǒng)設計 ,在此過程中,發(fā)現(xiàn)并 獨立解決 在 開發(fā)中常見 的一些 問題。) ,8)。 39。 when 0110101 =data=conv_std_logic_vector(char_to_integer (39。) ,8)。339。 when 0110001 =data=conv_std_logic_vector(char_to_integer (39。) ,8)。839。 when 0101101 =data=conv_std_logic_vector(char_to_integer (39。) ,8)。 39。 when 0101001 =data=conv_std_logic_vector(char_to_integer (39。) ,8)。 39。 when 0100100 =data=conv_std_logic_vector(char_to_integer (39。) ,8)。439。 when 0100000 =data=conv_std_logic_vector(char_to_integer (39。) ,8)。1 39。 when 0011100 =data=conv_std_logic_vector(char_to_integer (39。) ,8)。Q39。 when 0011000 =data=conv_std_logic_vector(char_to_integer (39。) ,8)。039。 when 0010100 =data=conv_std_logic_vector(char_to_integer (39。) ,8)。839。 when 0010000 =data=conv_std_logic_vector(char_to_integer (39。) ,8)。 39。 when 0001100 =data=conv_std_logic_vector(char_to_integer (39。) ,8)。 39。 when 0001000 =data=conv_std_logic_vector(char_to_integer (39。) ,8)。439。 when 0000100 =data=conv_std_logic_vector(char_to_integer (39。) ,8)。139。 begin process (address) begin case address is when 0000000 =data=conv_std_logic_vector(char_to_integer (39。 when others = result :=32。 = result := 125。|39。 when 39。 = result := 121。x39。 when 39。 = result := 117。t39。 when 39。 = result := 113。p39。 when 39。 = result := 109。l39。 when 39。 = result := 105。h39。 when 39。 = result := 101。d39。 when 39。 = result := 97。`39。 when 39。 = result := 93。\39。 when 39。 = result := 89。X39。 when 39。 = result := 85。T39。 when 39。 = result := 81。P39。 when 39。 = result := 77。L39。 when 39。 = result := 73。H39。 when 39。 = result := 69。D39。 when 39。 = result := 65。39。 when 39。 = result := 61。39。 when 39。 = result := 57。839。 when 39。 = result := 53。439。 when 39。 = result := 49。039。 when 39。 = result := 45。,39。 when 39。 = result := 41。(39。39。amp。 when 39。 = result := 35。39。 when 39。 13 architecture fun of char_ram2 is function char_to_integer ( indata :character) return integer is variable result : integer range 0 to 167F。 use 。 end process。 when READRAM = state=IDLE。 when SHIFT = //(7) state=IDLE。 counter=counter+1。 12 when SETMODE =//(5)//0x06//顯示光標移動設置,當讀或寫一個字符后地址指針加 1,且光標加 1 state=WRITERAM。 when SWITCHMODE =//(3)//0x0c//開顯示 。 end if。 else div_counter=0。 //初始地址 div_counter=0。兩行顯示 16*2 。)then //分頻 t=50ms f=20hz case state is when IDLE = //(1) if(flag=39。 div_counter=0。)then state=IDLE。 字體 5*10 01000000 when state =SETCGRAM else //0x40 字符發(fā)生器儲存器地址 ACG 10000000 when state =SETDDRAM and counter =0 else //0x80 顯示數(shù)據(jù)儲存器地址 ADD 11000000 when state =SETDDRAM and counter /=0 else //0xc0 顯示數(shù)據(jù)儲存器地址 ADD 第二行開頭 data_in when state = WRITERAM else //寫入數(shù)據(jù) 11 ZZZZZZZZ。 yi amp。 //=0,寫; =1,讀 data =00000001 when state =CLEAR else //0x01清屏 00000010 when state =RETURNCURSOR else //0x02光標返回 00000110 when state = SETMODE else //0x06//顯示光標移動設置,當讀或寫一個字符后地址指針加 1,且光標加 1 00001100 when state =SWITCHMODE else //0x0c//開顯示 。 //當 lcd_rs=1 時,為數(shù)據(jù); =0 時,為命令 lcd_rw = 39。 lcd_rs = 39。)then lcd_e= not lcd_e。039。 end process。event and clkdiv=39。039。)then