Implementation of Chinese input method in B-mode ultrasound system

This paper introduces the implementation of Chinese input method in B-mode ultrasound system.

Font design

The usual display method of Chinese characters is: first extract the required Chinese character dot matrix with font software, and the obtained data can be put into the ASM assembly file, and then compile the assembly file in the integrated development environment of the single chip microcomputer-generate BIN file, and then use The programmer burns the BIN file to the chip. When in use, it reads the Chinese character dot matrix data in the chip and writes it into the character memory.

If there are few words to be displayed, there will be less dot matrix data, just burn the data to the program memory. To realize the Chinese input method, there are many words displayed and the data volume is relatively large. It is necessary to specially generate font data and put it into the extended data storage.

To construct a Chinese character library, there are usually the following methods: use the program space as a small character library; use a large-capacity ROM chip for the Chinese character library, which is generally not used in small portable devices; in order to reduce costs and reduce volume, speed requirements Large-capacity serial data memory, such as AT45DB041B, can be used for occasions that are not very high.

The file HZK16 and the file ASC16 in the UCDOS software are the 16 × 16 GB Chinese character dot matrix file and the 8 × 16 ASCII code dot matrix file, which are stored in a binary format. The most commonly used ASCII code dot matrix is ​​5 × 7 (5 dots horizontally and 7 dots vertically) or 7 × 9. For characters of a given font, the more points of the glyph, the better the quality of the glyph, and the greater the amount of data required, the more storage space is occupied. For different display systems, to display the same graph, the required data arrangement order is different. The existing HZK16 and ASC16 files may not be directly applicable to their own systems. The common method is to use the arrangement method to freely define The font software takes the data and puts it into the program or data storage area.

Through comparison, it is found that the use of 12 × 12 dot matrix to represent Chinese characters and 8 × 12 dot matrix to represent ASCII codes can balance aesthetics and reduce hardware expenses, and some program modules can be shared. The menu operation interface laid the foundation. When the font software fetches data, one direction must be a multiple of 8, so 12 × 12 will be automatically adjusted to 16 × 12 or 12 × 16. The dot matrix characters are shown in Figure 1.



Figure 1 dot matrix characters

It is not difficult to find that a Chinese character requires 24B, and half of 12B is blank. If the data obtained by the font is compressed, 18B is enough to store the dot matrix data of a Chinese character.

Hardware block diagram

As shown in Figure 2, the one-chip computer STC89C516RD + integrates 64KB flash memory and 1280B SRAM, using its internal resources does not need to expand external program memory, decoder, screen address generator, multiple address / data switching, TV signal generator TV signal synthesis is mostly realized by FPGA programming. After signal synthesis, it is sent to the monitor screen display by D / A conversion.



Figure 2 hardware block diagram

Software Implementation

According to a survey, Pinyin input accounts for more than 80% of Chinese character input schemes, and less than 20% of users of shape codes. The essence of the Chinese character input method is to establish a mapping relationship between key combinations and Chinese character encoding. The B-mode ultrasound system using a full keyboard is essentially the same as the PC input method using a standard keyboard. The establishment of the index table can realize the mapping from key combination to Chinese character encoding, as shown in Figure 3.




Figure 3 Schematic diagram of the key combination index table

In the Keil C compilation environment, the "Pinyin input method module" can be downloaded from the Internet. The medical system often uses the hospital name and patient name. Therefore, based on this module, some common place names and names are added. A total of 4120 Chinese characters were collected, the dot matrix was extracted with font software, and compressed to form a dot matrix database of Chinese characters, put into the data storage area, and then a font combination index table was established, and an EEPROM 39VF010 was shared with some parameters and table data. The maximum addressable storage space of the 51 series single-chip microcomputer is 64KB. You can use the P1 port as the page address to access the data space above 64KB.

Compared with the Chinese input method with limited keys (such as mobile phones), the Chinese keyboard input method of the full keyboard is easier to complete the operation of 26 letters and other functions by using keys.

After the font is ready, the key to the next software design is to build the traversal algorithm of the Pinyin combination tree (as shown in Figure 4) and the search algorithm of homophones. Here, some internal RAM resources of the 51 single chip are used to store the pinyin code, the font address ADDR0 of the current pinyin combination map, the font address ADDR1 of the next pinyin combination map, and the current address ADDR of the displayed Chinese characters. According to the pinyin combination, the dot matrix address of the first Chinese character of the pinyin combination is found by using a traversal algorithm, and the page up and down keys are used to realize page turning. The comparison between ADDR and ADDR0 or ADDR1 ensures that the Chinese characters are found in the same pinyin combination.



Figure 4 Example of Pinyin combination tree

in conclusion

This solution has been successfully implemented on a B-mode ultrasound system. At present, Chinese Pinyin input and storage of medical record numbers have been realized, and the Chinese interface display has been realized with the help of the Chinese character library.


- Multiple USB Charger Extension Socket provide quick charging for your mobile electronic devices.

- Smart Charging: 5V 2.4A/3.4A/4.2A/4.8A/6A Usb Ports Extension Cord support smart charging. Protect your devices from over charging damage.

- Multiple Outlets Power Strip With Usb Ports allowing you to plug in various electronics and electrical devices.

- PC/ABS flame retardant housing, phosphor bronze+pure copper high conductivity Power Strip Usb .

-- Qualified Power Cord Receptacle Extension With Usb allowing you extend the outlet 6 feet (2 meters) away from the wall or even further with long power strip.


Power Strip With Usb

Power Strip With Usb,Power Strip With Usb Ports,Usb Ports Extension Cord,Power Strip Usb,Receptacle Extension With Usb,USB Charger Extension Socket

ZhongShan JITONGLONG Plastic Hardware Co. Ltd. , https://www.toukoo-electronics.com