BuildChinesecharactersystemonARMsystem_第1页
BuildChinesecharactersystemonARMsystem_第2页
BuildChinesecharactersystemonARMsystem_第3页
BuildChinesecharactersystemonARMsystem_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、An efficient Chinese Character System on Embedded SystemsZhang Haibo, Gao Shenyong, Li Daqing,Yu Feng,Zhejiang Water Conservancy And Hydropower College, Hangzhou 310018ZhanghbABSTRACTThis paper try to establish a Chinese system on a embedded system by discussing dot matrix coding, displaying and inp

2、utting approach of Chinese characters, it elaborates font codes of Chinese characters and their displaying process, and also describes the inner code, GB code and area code of the character system, and then introduces a high efficiency inputting-indexing way and two additional data structure, these

3、make a simple and convenient solution of Chinese character system.Keywords: Embedding system; Chinese characters, input, display;1 INTRODUCTIONEmbedded systems are increasingly widely applied, the functions of various systems are very different, and their configurations of hardware and software are

4、also different from each other, and some use of the operating system, such as LINUX, WxWORK, COS and so on, and some of these operating systems do not provide the Chinese characters function, In particular, some systems function without a operating systems. Chinese character systems can be establish

5、ed by the developers own, they need to address the issues such as dot matrix font coding, characters displaying and index encoding, inputting and indexing, these make a series of problems.Chinese system requires certain resources, characters of 16 × 16 dots as an example, the matrix font needs

6、to occupy 262K of storage space, and inputting codes also need additional space,so totally it needs at least 300k ROM, and other 40k RAM is in needs for inputting and indexing. Embedded system may need to be extended to reach this memory condition.1.1 Resources for Chinese system32 bits embedded con

7、troller, ARM for example, the most popular core for embedded CPU, normally have enough capacity of Chinese system, ARM runs on the frequency of 66MHz and above with an addressing ability of 256M ROM and RAM. General target boards of the current common systems are equipped with rich FLASH and RAM, mo

8、st systems can be reasonable configured to meet the need of Chinese characters process.2. A Chinese character processing systemFigure 1. Obtain a dot matrix of a characterChinese character codingzone bit codesequence codedot matrixzone codebit codeTo realize a Chinese character system we need to dea

9、l with the issues such as storage of the font matrix, display of characters, input method. The following is a introduction of a Chinese character system base on the GB font matrix.2.1 Inner code and font matrixEnglish characters perform a byte in computers, saying ASCII code, generally only 7 bits o

10、f a byte can be used to represents 128 characters, while the highest bit is for the parity bit (or left unused). Chinese national standard (GB) provides inner Code stands for Chinese characters that is compose of two bytes respectively transformed from zone code and bit code, to make the differentia

11、tion with Western characters, the zone code and bit code are both added A0H and constitute inner code.2. 2 Chinese characters displayChinese characters display is the process of retrieving font matrix by an inner code and displaying the character, as the following steps: the given inner Code of an C

12、hinese character is transformed into zone bit code; then the zone bit code is separated to zone code and bit code; the sequence code that show the corresponding position of dot matrix in dot matrix lib are calculated by zone code and bit code; dot matrix of the character is obtained and is displayed

13、. Figure 1 show the process: 1) Get zone bit code from inner codethe difference between inner code and zone bit code is that the 5th and 7th bit of each byte of inner code are 1 while the corresponding bits of zone bit code are 0, so the conversion is relatively simple, just turn the 5th and 7th bit

14、 into 0.2) Obtain sequence codeTo get the dot matrix of order of the matrix library we have to obtain zone code and bit code, the high byte of the zone bit code low is zone code and the low byte is bit code. There are 94 character in every zone, so the sequence code is the zone code time 94 and add

15、bit code.3) Read the dot matrixThere are 32 bytes for each 16-dot Chinese character, so the starting address of the character is the sequence code times 32, and the next 32 bytes is the corresponding dot matrix.4) Display of Chinese charactersAccording the bits of every byte of the dot matrix draw d

16、ots in display buffer, if the byte is 0 then write “white” dot to the buffer and “black” for 1, in display buffer the number of bit of every dot depends on the display mode, the “write” mode can be “copy”, “and”, “or” and “xor”,.16-dot character for example is divided into 16 lines of dot, every lin

17、e there is compose of 16 dots which is represent by 2 bytes of dot matrix, so after draw 16 dots we need to move to next line.5) Show mixed Chinese and EnglishWhen a string composed by mixed English and Chinese characters, it performance an array made up by inner codes and ASCIIs, string display pro

18、gram distinguish them by the 1st bit, 1 for Chinese character and 0 for ASCII.2.3 Input method of Chinese characters Figure 2. Array of corresponding relation“啊”, address: 0“爱”,address:6“鞍”,address:28“霭”,address:27“锕”, address:5 Array 2aai6an029160116026325643675717925160386161616Array 1Chinese char

19、acter input method need to establish a mapping of a string code that is typed by use and is called inputting code and its corresponding Chinese character inner code, it is a process to find a inner code base in a inputting code. It is known that most inputting method can not establish one to one cor

20、respondence of inputting codes and inner code.2.3.1 Correspondence table of input code and inner codeInput method in this case is to locate a inner code by an input code, Correspondence relation has to be established, in order to achieve efficient index there are two corresponding arrays used to hel

21、p find the inner code set, shown as figure 2, the 1st array is a inner code sequence sorted by inputting code, that is it is a inputting order inner code sequence. the 2nd array that store the input code and the starting address and ending address in the 1st array reflect the relation between inputt

22、ing code and a set of inner code stored in the 1st array, these data structure imply a mapping from input code to inner code.A inputting method of PINYIN as an example, array 1 stores all the Chinese character recognized by the system, which are all the two classes character lib of GB in this case,

23、array 2 has 2 columns that the 1st column is used to store all the alphabetic inputting code sorted, in the 2nd column there are corresponding starting address for every PINYIN, the input code from 1st column. In this case inner code is replaced by zone bit code, which simplified the inputting and l

24、ocating process. As Figure 2 shows that when the user entered “ai”, its corresponding address is 6, that is the address in array 1 of the starting zone bit code is 6 and the ending address is the next address minus 1, 29-1=28, we can find the relevant zone bit code from address 6 till 28 from array

25、1, they are all the corresponding Chinese character of the PINYIN of “ai”, the input code, and the next step is show this character lead by a digital(0 to 9) by page at the bottom line of the screen and there are 10 character in every page, the user can select needed character. Obviously, these two

26、array can be changed for any different inputting method, and can be easily adjusted the order of character to fit the using frequency. To change input method we just need to change the contents of the two arrays, while the program does not need to make any change.2.3.2 Inputting processThe input pro

27、cess mainly performs the following tasks:1) Obtain the input from keyboard, if it is a input for Chinese calculates a index number by input which can unique recognize a inputting code, the value of the index code accord the sequence of inputting code, then compare the index code with number calculat

28、ed in the same way with the index code from every element of 1st column of array 2, if found number matches index code the program read element in the same raw of array 2, the starting address, then read the zone bit code from the starting address from array 1, display them by page, every Chinese ch

29、aracter lead by a digital, 0 to 9, there are 10 characters on every page. The order of array 2 that base on the input code makes searching the matching efficient and convenient.2) Accept users selection for the characters, when received page down or page up order the shown content move to succeed pa

30、ge till the ending address or previous page till the starting one.Look to the match would be in line with the matching number of Chinese characters displayed in the choice of Chinese character input area, there is another page, select the operation and so on. Chinese choose to flip the region to deal with in the framework of pre-set match over, after the turn, out of range does not respond to deal with.3) When rece

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论