SHAPE-ORIENTED TEST SET COMPRESSION METHOD USING IDEAL VECTOR SORTING AND SHAPES

by

James Chien-Chun Huang

B.A.Sc. (Electrical and Computer Engineering), The University of British Columbia, 1999

A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF

THE REQUIREMENTS FOR THE DEGREE OF

MASTER OF APPLIED SCIENCE

in

THE FACULTY OF GRADUATE STUDIES

DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING

We accept this thesis as conforming to the rennired standard

THE UNIVERSITY OF BRITISH COLUMBIA

March 2002

© James Chien-Chun Huang, 2002 UBC Special Collections - Thesis Authorisation Form Page 1 of 1

In presenting this thesis in partial fulfilment of the requirements for an advanced degree at the University of British Columbia, I agree that the Library shall make it freely available for reference and study. I further agree that permission for extensive copying of this thesis for scholarly purposes may be granted by the head of my department or by his or her representatives. It is understood that copying or publication of this thesis for financial gain shall not be allowed without my written permission.

Department of "SUtCTRIChL AAJQ CPM PlATBR FAJ6J /tyEE<yfy

The University of British Columbia Vancouver, Canada

Date HarcL 3-

http://www.library.ubc.ca/spcoll/mesauth.html 27/03/2002 ABSTRACT

This thesis details a novel shape-oriented test set compression method that offers an alternative approach to reduce large test data of a complex circuit under test (CUT) such as the system-on-a-chip (SoC). Rather than the usual one-dimensional compression approach utilized by other contemporary compression techniques, such as the and Lempel-Ziv-Welch (LZW) method, the proposed method compresses a test set in a two-dimensional style. To achieve the compression, the proposed method initially sorts test cubes, which are sent to the combinational CUT to detect the single stuck-at faults of the chip, by employing the ideal vector sorting algorithm; the algorithm rearranges cubes based on the test data that resemble parts of predefined shapes identified in the cubes. After the cubes are sorted, the amalgamated-shapes area-covering algorithm of the proposed method attempts to discover predefined shapes or blocks and stores the corresponding information. In the last stage of the proposed method, the multi-syntax encoding algorithm converts the stored information into encoding bits. The experimental results show that the proposed method has higher compression ratios compared to that of other contemporary compression schemes in most cases. As a result, compared to other schemes, employing the shape-oriented method can lessen the time of transferring and can reduce the memory for storing the compressed data further.

ii TABLE OF CONTENTS

ABSTRACT ii

TABLE OF CONTENTS iii

LIST OF FIGURES vi

LIST OF TABLES viii

LIST OF ABBREVIATIONS x

ACKNOWLEDGEMENTS xi

DEDICATION xii

1 INTRODUCTION 1

2 VARIOUS CONTEMPORARY TEST METHODS.... 7

2.1 Run-Length Coding 7

2.2 Run-Length Coding and Burrows-Wheeler Transformation 8

2.3 Test Vector Decompression via Cyclical Scan Chain Architecture 10

2.4 Serial Scan Test Vector Compression Methodology 13

2.5 Differential Block Coding 14

2.6 Huffman Coding 16

2.7 Statistical Code Selection 17

2.8 Lempel-Ziv 77, Lempel-Ziv 78, and Lempel-Ziv-Welch 19

2.9 Test Width Compression Based on Counter Architecture 21

3 FORMER GEOMETRIC-PRIMITIVES-BASED COMPRESSION 23

3.1 Zero- or One-Distance Sorting Algorithm 25

3.1.1 Weights Assignment 26

3.1.2 Sorting Process 29

iii 3.2 Area-Covering Algorithm 32

3.3 Encoding Algorithm 32

3.4 The Advantage and Disadvantages of the Former Method 34

3.4.1 Advantage 34

3.4.2 Disadvantages 35

SHAPE-ORIENTED TEST SET COMPRESSION METHOD USING IDEAL VECTOR SORTING AND SHAPES 37

4.1 Ideal Vector Sorting Algorithm 39

4.1.1 Primary Window 41

4.1.2 Secondary Window 44

4.1.3 Ideal Vector Library 46

4.1.3.1 Values of Ideal Bits Stored in the Ideal Vector Library 47

4.1.3.2 Weight Assignments 48

4.1.4 Ideal Vector Sorting Process 52

4.2 Amalgamated-Shapes Area-Covering Algorithm 55

4.2.1 All-Zero or All-One Block 58

4.2.2 Primitive Shapes 58

4.2.3 Primitive Shape Extensions 59

4.2.4 Imperfect Triangle 60

4.2.5 Four-Bit by Four-Bit Blocks 64

4.2.6 Shape and Block Recognition Processes 66

4.2.6.1 Shape Recognition Process 66

4.2.6.2 Four-Bit by Four-Bit Block Recognition Process 71

4.2.7 Overall Area-Covering Algorithm 73

4.3 Multi-Syntax Encoding Algorithm 82

4.3.1 Distance Concept and Permanent Lengths of Encoding Sequences 83

iv 4.3.2 Original or Real Data Encoding Syntax 90

4.3.3 Four-Bit by Four-Bit Block Encoding Syntax 92

4.3.4 All-Zero or All-One Block Encoding Syntax 94

4.3.5 Primitive, Extended, and Imperfect Shapes Encoding Syntax 95

4.3.6 Overall Encoding Algorithm 101

4.4 Multi-Syntax Decoding Algorithm 103

4.5 Verification Processes 106

4.5.1 Sorted Test Data Verification 107

4.5.2 Decompressed Test Data Verification 109

4.6 Advantages and Disadvantages of the Shape-Oriented Compression Method. 110

4.6.1 Advantages 110

4.6.2 Disadvantages 112

5 EXPERIMENTAL RESULTS 114

5.1 Experimental Approach and Assumptions 114

5.2 Experimental Equipment 119

5.3 Cost of Test Set Compression 119

5.4 Experimental Results 120

5.4.1 Comparisons Among the Compression Methods 120

5.4.2 Miscellaneous Experimental Information 128

6 PROPOSALS FOR THE COURSES OF THE FUTURE RESEARCH 135

7 CONCLUSION 137

REFERENCES 139

APPENDIX A EXPERIMENTAL-RESULT ADDENDUM 143

v LIST OF FIGURES

Number Page

Figure 2.1 An Example of Modified 3-Bit Run-Length Code 12

Figure 3.1 Examples of Shapes (a) A Shape (b) A Primitive Shape - Triangle 24

Figure 3.2 Comparing Neighbouring Bits in the Distance Sorting Algorithm 27

Figure 3.3 An Example of Weight Calculation in Zero-Distance Sorting 28

Figure 3.4 The Flowchart of the Zero-Distance Sorting Algorithm 30

Figure 3.5 An Overview of the Encoding Algorithm Procedure of the Former

Compression Method 33

Figure 4.1 The Concept of Employing an Ideal Vector 40

Figure 4.2 Primary Window and Its Corresponding Ideal Bit 41

Figure 4.3 Cases for Smaller Primary Window, (a) The Corresponding Ideal Bit is 1; (b) The Corresponding Ideal Bit is 0 42 Figure 4.4 Examples with Same Content in the Primary Window, (a) The Window with Original Dimension (b) The Enlarged Primary Window 43

Figure 4.5 The Secondary Windows With the Matching Primary Window 44

Figure .4.6 Different Configuration of Bits in the Secondary Windows Results a Different Ideal Bit 45

Figure 4.7 Examples of Weight Assignments from the Attribute - Number of Shapes. (a) An Example of Pattern Receives a Weight of 3; (b) A Pattern Receives a Weight of 0 49

Figure 4.8 Flowchart of the Ideal Vector Sorting Process 54

Figure 4.9 Four-Bit by Four-Bit Blocks in an 8-Bit by 8-Bit Partitioned Block 65

Figure 4.10 A Pseudo Code of Shape Recognition Process 69

Figure 4.11 An Example of Recognizing a Vertical Line 70

Figure 4.12 The Four Four-Bit by Four-Bit Blocks in an 8-Bit by 8-bit Partitioned Block 72

vi Figure 4.13 A Suggested Pseudo Code of a Four-Bit by Four-Bit Block Recognition Process 73

Figure 4.14 The Flowchart of the Overall Area Covering Algorithm 75-76

Figure 4.15 (a) The Positions of the Required Points (b) After the Modification, the

Locations of the Required Points 87

Figure 4.16 A Pseudo Code of the Overall Encoding Algorithm 102

Figure 4.17 A Pseudo Code of the Overall Decoding Algorithm 104

Figure 4.18 Relationships Between Verification Procedures and Compression and

Decompression Algorithms 107

Figure 4.19 A Pseudo Code of the Sorted Test Data Verification 108

Figure 4.20 A Pseudo Code of the Decompressed Test Data Verification 109

Figure 5.1 The Relationship Among Pins, Cubes, and Compression Ratio 129

Figure 5.2 Correlation Between Percentages of Zeros and Compression Ratios 130

Figure 5.3 Correlation Between Percentages of Ones and Compression Ratios 131

Figure 5.4 Correlation Between Percentages of Don't Cares and Compression Ratios 131

Figure 5.5 Distributions of Blocks and Shapes of Former and Proposed Methods 133

vn LIST OF TABLES

Number Page

Table 3.1 Table of Zero-Distance Weights 27

Table 3.2 Table of One-Distance Weights 28

Table 4.1 Weight Assignment Table for the Pattern Attribute - Number of Shapes .... 49

Table 4.2 Weight Assignment Table for the Pattern Attribute - Continuity of the Bits in Two Sorted Cubes 50

Table 4.3 Weight Assignment Table for the Pattern Attribute - Degree of Certainty of the Value of an Ideal Bit 51

Table 4.4 Table of Shapes Utilized in the Proposed Area-Covering Process 56

Table 4.5 Legitimate Alternatives of Each Imperfect Triangle Variation 62

Table 4.6 An Intuitive Approach of Storing Information Regarding a Triangle 84

Table 4.7 Relationships Among the Coordinates of Primitive Triangles in Table 4.6.. 86

Table 4.8 Relationships Among the Coordinates of a Primitive Rectangle in Figure 4.15 (a) 87

Table 4.9 Encoding Table (Category Header) of Real or Original Data Block 91

Table 4.10 Encoding Table (Block Information) of Real or Original Data Block 91

Table 4.11 Encoding Table (Category Header) of the Four-Bit by Four-Bit Block 92

Table 4.12 Encoding Table (Block Information) of the Four-Bit by Four-Bit Block 93

Table 4.13 Encoding Table (Category Header) of the All-Zero/All-One Block 94

Table 4.14 Encoding Table (Block Information) of the All-Zero/All-One Block 95

Table 4.15 Encoding Table (Category Header) of the Block Represented by Shapes .... 96

Table 4.16 Encoding Table (Shape Information) of the Block Represented by Shapes.. 97

Table 4.17 Encoding Table (Variation Separator) of the Variations of the Shapes (Line, Line Extension, Triangle, Imperfect Triangle, and Triangle Extension) .99

Table 5.1 Descriptions About the Compression Methods Employed in the Experiment 116

viii Table 5.2 An Example That Shows the Differences between the Original and Modified Run-Length Coding Methods 118

Table 5.3 Highest Compression Ratios of the Compression Methods 121

Table 5.4 Average Compression Ratios of the Compression Methods 122

Table 5.5 Summaries of the Averages of the Compression Ratios and the Differences Between the Proposed and the Rest of Compression Methods' Compression Ratios 124

Table 5.6 Reduction Ratios Based on the Compression Methods 126

Table 5.7 Distributions of Test Sets According to the Established Percentages of Specified Bits and Figure 5.2 and 5.3 132

Table 5.8 Distributions of Test Sets According to the Established Percentages of Don't Cares and Figure 5.4 132

ix LIST OF ABBREVIATIONS

ASIC Application Specific Integrated Circuit

ATE Automatic Test Equipment

BIST Built-in Self-Test

BW Burrows-Wheeler

CSO Coalesced Simple Orders

CUT Circuit Under Test

DF Greedy Depth First Greedy

GZBP GNU not Unix Zip

IC Integrated Circuit

LZ Lempel-Ziv

LZW Lemp el-Ziv-Welch

MDC Maximal D-Compatibility Class

MISR Multi-Input Signature Register

PRPG Pseudo-Random Pattern Generation

SoC System-on-a-Chip

TAM Test Access Mechanism

TTM Time-to-Market

X ACKNOWLEDGEMENTS

There are many people to whom I would like to express my gratitude. First, I would like to thank Dr. Ivanov and Dr. Zahir for their great guidance. Under their instruction, the research progressed at a much smoother pace. Next, I would also like to thank the colleagues and the graduate students in MCLD 332 (the current system-on-a- chip (SoC) laboratory room) who have helped me along the way. Their help has been unquestionably immense and effective, and because of them, the learning environment at the school has been superbly friendly; I have learnt so much from them. In addition, I would like to thank the Electrical and Computer Engineering Department at the

University of British Columbia and the professors in the department for offering a fine learning environment. Lastly, I would like to thank my grandparents and my family - dad, mom, and my kid brothers, Jerry and Leo. Their love and support are always there and there is almost no word for me to begin to describe how I feel about them. I am in debt to them for eternity. Once again, I am grateful for all the people who help me; without their assistance and care, I would not have today's success and the completion of the research. Thank you all.

James Chien-Chun Huang November 23, 2001

xi To my grandparents, father, mother, and two kid brothers, for their

boundless encouragement, wisdom, and love CHAPTER 1 INTRODUCTION

The test data of a complex integrated circuit (IC), such as an application specific integrated circuit (ASIC) or a system-on-a-chip (SoC), is in the range of gigabytes due to the enormous amount of transistors on the IC [1]. Such a large set of test data imposes two problems. First, the transferring time of the data is long, and this can affect the time- to-market (TTM) of the chip. Second, the large amount of test data will be stored on and can become a burden to the automatic test equipment (ATE), because the equipment requires memory to run diagnosis and testing of the IC. As a result, with the intention of

shortening the data transfer time and lessening the burden on ATE, a lossless test set

compression method that reduces the data is needed prior to the data transfer.

Generally, there exist four main forms of compressions for either compressing test

cubes or responses in the overall test architecture: fault-oriented compaction [2, 3, 4, 5, 6,

7], non-fault-oriented [1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,

20, 21, 22, 23], pseudo-random pattern generation (PRPG) and seeds [24, 25, 26, 27, 28,

29, 30, 31], and response compaction [32, 33]. The first two forms reduce the overall

amount of test data while maintaining the same fault coverage. A compaction method requires a netlist or the information about the internal structure of the CUT but does not need a decompression circuitry; on the contrary, a compression method does not need the

CUT's information but does need its counterpart, a decoder, for restoring the test cubes

from the compressed data. Although this third form of the compression only demands a

small circuitry for generating test patterns, the PRPG and seeds require a certain period of time for generating a large amount of test patterns with the purpose of ensuring an

1 Huang 2 acceptable fault coverage. While the last type of compression - test response compaction

- compresses test results for the purpose of minimizing the overhead in the circuitry, this approach might not be considered as a potential candidate for compressing test sets because the response compaction does not need to offer solutions for data restoration.

Therefore, if the internal structure of a CUT is unavailable due to reasons such as the confidentiality of the cores or memory constraint, and the TTM issue is crucial, the deployment of the compression method is considered to be a good choice for compressing test data. Because the proposed method is non-fault-oriented, lossless compression, some of the related compression schemes will be discussed in the following paragraph to portray their distinctive features.

There are several contemporary compression methods. The simplest method, run- length coding, is efficient in compressing a sequence of repetitive characters or bits; the coding approach uses two tuples to represent the repeated bit and the number of times that the bit is repeated in a defined-length sequence [1, 8, 9, 10]. The compression method in [1] integrates the run-length coding with the Burrows-Wheeler (BW) transformation to improve its compression ratio by reducing the activities in the columns of a test set; the variation of the integration that employs the GNU not Unix zip (GZEP) is suggested in [8] for reducing test data in the columns that have high activities. A variation of the run-length coding that focuses on compressing consecutive zeros in a sequence is mentioned in [10]. The second compression method, the serial scan test vector compression, can compress two vectors if the first few bits of the second vector is identical to the last few bits of the first vector [13]; by removing the identical bits of the second vector and concatenating the rest of the vector to the end of the first vector, the Huang 3 serial scan method achieves the compression of the vectors. The approach of identifying the same part of the vectors is also utilized in [14] to a greater extent; after vectors are divided into blocks, the compression method stores the first vector as is and encodes other vectors by storing any blocks that are different than the first vector's blocks at matching positions. As a result, the identical blocks are removed from the vectors and the compression is achieved. Huffman coding offers a different approach to encode identical parts of vectors [15, 16, 17, 18, 19]; after vectors are divided into fixed-length blocks, the coding compresses data by replacing the high-frequency blocks with shorter sequences of encoding bits, while replacing the low-frequency blocks with longer sequences bits [15, 16]. The word "frequency" refers to the number of times that a block appears in test vectors; a high-frequency block is a block that occurs often and a low- frequency block is a block that rarely appears in a test set. Statistical code selection is a variation of the Huffman coding that constructs a Huffman tree based only on the high- frequency blocks and encodes the low-frequency blocks as is [17, 18, 19]. Similar to the

Huffman coding's concept of identifying redundant blocks, the Lempel-Ziv 77 (LZ77),

Lempel-Ziv 78 (LZ78), and Lempel-Ziv-Welch (LZW) compression methods recognize repeated segments with variable lengths by building a table of the encountered segments

[20]; unlike the Huffman coding approach that replaces segments with a set of variable- length codewords according to their frequencies, the LZ77, LZ78, and LZW methods substitute the redundant segments with a fixed-length code value according to dictionaries. Rather than compressing data serially, a test width compression method compresses a group of columns of test data at once by examining the columns' compatibility based on the complementary property of the logic values [21]; the Huang 4 complementary value of zero is one, and vice versa. Therefore, by investigating the mentioned methods, it can be concluded that the task of discovering an efficient compression method can be challenged from various perspectives.

Because all but the last of these compression techniques compress test data one- dimensionally, in the case of a test set containing a large quantity of redundant segments of data, the maximum compression ratios produced by the contemporary methods are limited. A previously designed compression method firstly employs a sorting process to reorganize the order of test cubes that have the attribute of being rearranged in a different order without affecting the fault coverage [22, 23]. An example of such test cubes is the one used for detecting single-stuck-at faults of the transistors of a CUT. It should be noted that if the order of the cubes could not be altered, the cubes are assumed to be processed by the next part of the compression method directly. The second part of the compression method is to find primitive shapes, which are collections of bits defined in two-dimensional formations in a test set. By taking the benefit of Xs, or don't cares, in the test set, this former compression method makes the task of storing information regarding primitive shapes easier. During the last part of the compression, the method employs an encoding algorithm to convert the information about shapes into encoding bits. To restore the original test set from compressed bits, a decompression procedure that is similar to the reverse process of the compression is exercised.

To devise an enhanced shape based compression method, two main objectives are established. The first objective is to increase the performance or the compression ratio of the method. The second objective is to bring innovative concepts into the enhanced compression method not only to increase compression ratio, but also to resolve any Huang 5 difficulty that the former compression method may have encountered. By aiming to achieve these objectives, the enhanced compression method should perform superior to the former compression method that is based on primitive shapes.

Therefore, the principle of this thesis is to present an enhanced compression method that not only inherits the notion of two-dimensional primitive shapes of the former method, but also adapts innovative approaches, such as the ideal vector sorting algorithm and additional shapes identifications, to facilitate or compress a test set. The first part of the compression utilizes two sorting schemes; the ascending sort is exercised first, followed by the proposed sorting scheme, the ideal vector sorting. The ideal vector sorting reorganizes test cubes by endeavouring to complete the identified parts of primitive and additional shapes within previously sorted cubes through the means of creating a model vector, called ideal vector, and by repositioning the best-matched unsorted cube next to the sorted cubes. The second part of the compression is the amalgamated-shapes area-covering algorithm that employs shapes - primitive shapes, extended shapes, imperfect triangles, and four-bit by four-bit blocks - in an attempt to achieve smaller number of shapes. The third part is the multi-syntax encoding algorithm that accommodates the mentioned shapes. The counterpart of the compression method, the decoding algorithm, is straightforward and is similar to the combination of the second and third parts of the compression scheme.

As no descriptions regarding verification process for confirming the sorted test cubes and decompressed test sets are mentioned in compression algorithms, including the former method, the accuracy of a decompressed test set is left unknown. The unidentified accuracy may affect the fault coverage that the original test set attempts to Huang 6 achieve. Therefore, two undemanding verification processes written in software are designed and employed during the research for the purpose of authenticating the sorted and the decompressed data against the original test data. Because the verification processes are not part of the proposed compression method, not only is no encumbrance appended to the method, but also the independence of the processes is ensured.

Two other aspects, the advantages and disadvantages, and the experimental results, of the proposed method are discussed in the thesis as well. Both pros and cons of the proposed method are mentioned to clarify its possible range of applications, while the experimental results are gathered to show the performance of the enhanced and other contemporary methods. By including these two aspects in the thesis, one can have a better understanding of the characteristics of the proposed method.

To elucidate the mechanisms of mentioned concepts and aspects, the corresponding details are provided in the following chapters; as for the notation in the rest of the chapters, the words in italic style are the terms that appear initially in the thesis and are commonly used in algorithms found in either the thesis or other literature.

Several contemporary test set compression approaches will be discussed in Chapter 2.

The former approach of test set compression based on primitive shapes will be presented in Chapter 3. The innovative shape-oriented test set compression concept using ideal vector sorting and shapes are discussed in Chapter 4. To compare the performance of the enhanced test set compression method, several experiments are done and the experimental results are displayed in Chapter 5. Possible future courses of research will be introduced in Chapter 6. Lastly, the thesis is completed with a conclusion in Chapter

7. Huang 7

CHAPTER 2 VARIOUS CONTEMPORARY TEST DATA COMPRESSION METHODS

In general, a test data compression method converts the original bits of the test set into a smaller amount of bits. The compressed data is either decompressed by the automatic test equipment (ATE) or the on-board processor core or dedicated hardware.

For the purpose of testing, the decompressed data, or the original test data, is then applied to the circuit under test (CUT) through the control of the test access mechanism (TAM) or the built-in self-test (BIST). The details of a general BIST are mentioned in [34, 35,

36, 37, 38]. When the improvement of a compression method is desired, the method is usually augmented to include the facilitating procedure that is performed prior to the converting process to assist in efficient encoding; for example, in [1, 8], the Burrows-

Wheeler Transformation plays the facilitating role of reducing the number of transitions in the test data so that the run-length coding can perform better than it performs without the facilitation. Several test set compressions and some of the corresponding decompressions are described in particular in this chapter: run-length coding and its variations, serial scan test vectors compression, differential block coding, Huffman coding and its variations, Lempel-Ziv (LZ) and Lempel-Ziv-Welch (LZW) methods, and test width compression.

2.1 Run-Length Coding

The run-length coding compresses a sequence of repeated bits by acquiring the information of the bit's value called symbol and the length of the sequence called run. Huang 8

Two suggested notations of the coding representation are mentioned in [1, 9]; the simpler version of the two notations is displayed as follows:

(s,L) where s is the repeated symbol and L is the length of the run.

In a more general sense, a symbol can be any proper logic value or character. Therefore, according to the notation, if a test vector comprises fifteen consecutive zeros, the coding representation, in decimal, will be (0, 15); the corresponding representation in binary would be 0 llll, where the zero represents the bits' value in the vector and the following

four ones are the binary representation of 15. Because in the example the original fifteen bits can be represented by the 5-bit binary representation, the run-length coding has

achieved the goal of compression.

2.2 Run-Length Coding and Burrows-Wheeler Transformation

The test set compression scheme proposed in [1] consists of two parts: transformation and encoding. The concept of the scheme is to concentrate on reducing the transitions, or activities, of the data in a sequence by using the Burrows-Wheeler

(BW) transformation, and to encode the either transformed or original data by using the modified coding method. The scheme is further improved by incorporating GNU not

Unix zip (GZIP) to compress data if such an incorporation is better than transforming the data.

In order to effectively minimize the activities of a column's data, a threshold of the number of activities is determined prior to the exercise of the BW transformation [11, Huang 9

12]. To determine a threshold, an equation that relates the threshold and parameters

(length of sequence and the number of symbols presented in a sequence) is employed; the following equation is the simplified version:

[log2M + l]

where at is the threshold value and M is the length of the sequence that will be transformed. Once the threshold is established, the BW transform is employed to each column of the test set. To attempt to discover a lower activity of an w-bit sequence, the mechanism of the BW transformation acquires the knowledge of n-l rotated copies of the sequence. According to the transformation, the rotated copies plus the original sequence will form an n by n matrix and will be sorted in the ascending order. The transformed data will be in the right most column of the matrix and the associated index of the transformation is the row index of the original sequence in the sorted matrix. It is noticed that the activities of the transformed data are not always lower than that of the original data. Therefore, if the activity of the transformed sequence is less than the threshold, the compression scheme will keep the transformed data, the associated index, and sets a flag that indicates a transformation has taken place to 1; else, the scheme keeps the original test data as is and sets the flag to 0.

By converting data that is either original or transformed by the BW transformation, the second part of the compression utilizes the modified run-length coding to perform the actual compression. In the original run-length coding, each run of the same binary value is represented by two numbers or tuples: bit value and run length of the run. In the modified run-length coding method, instead of always using two Huang 10 numbers to correspond to each run, only one augmented number is utilized to contain two pieces of information. Based on the values that the run changes from and to, and the length of the run, the only number or tuple is determined according to a predefined table.

Hence, the required number of bits for representing the test data is reduced due to the decrease in the amount of tuples.

Because sometimes the columns' activities cannot be lowered due to the unpredictable behaviour of the BW transformation, high compression ratio is difficult to achieve. As a result, an enhanced method [8] of the proposed approach in [1] utilizes

GZIP to compress the test data with high activities.

2.3 Test Vector Decompression via Cyclical Scan Chain Architecture

Another compression method that has a facilitation approach and the variant of run length coding is presented [10]; in addition, the related decompression hardware

architecture consisting of cyclical and test scan chains is mentioned to clarify the decompression process. The facilitation approach consists of vector sorting and XORing the sorted vectors and the purpose of including the approach is to modify the test data to allow the modified run-length coding to perform well. The received vectors are sorted to minimize the differences between two adjacent vectors. After the sorting procedure, the process of XORing test vectors, or finding the difference vectors, takes place. The

XORing process is shown as follows:

(1) temporarily stores the first test vector Huang 11

(2) temporarily stores the XORed product (or the difference vector) of the first and second test vectors

(3) temporarily stores the XORed product (or the difference vector) of the second and third test vectors

(4) repeats the steps of acquiring XORed products for the rest of the test vectors

According to the author, the XORing process can create a bias in the number of zeros and ones because test vectors are similar to each other if the corresponding faults are structurally related. The XORed product of two test vectors is expected to have more zeros than ones and can be encoded efficiently later on. For example, if the

first vector = 1000 1101 1111 0011,

second vector = 1000 1011 1111 1010, the XORed product, or

difference vector = 0000 0110 0000 1001,

which has more zeros than the second vector has. The proposed coding method, which is similar to the run-length coding, is applied to the XORed products; the coding method takes the advantage of the large amount of zeros presented in the products by replacing consecutive zeros with a small sequence of bits. Two examples of the encoding approaches are presented in the paper but the encoding concepts in both cases are the same: a fixed number of bits, called a codeword, is used for representing variable-length segments that are mostly made of repeated zeros. One of the examples shown in the paper looks like this: Huang 12

Codeword A Segment of a Difference Vector

000 1 001 01 010 001 Oil 0001 100 00001 101 000001 110 0000001 111 0000000

Figure 2.1 An Example of Modified 3-Bit Run-Length Code

According to the above example, whenever the segment "000001" is seen in an XORed product, the segment is replaced by the codeword "101". As a result, the encoded sequence of the difference vector, 0000 0110 0000 1001, is 101 000 101 010. hi this case, because the encoding representation uses 12 bits to represent the original 16-bit long vector, the compression is achieved.

The decompression process is divided into two main parts: the decoding and the

XORing. In the decoding part of the process, two hardware units are involved. The first unit, the decoder, can be implemented as an n-bit counter, where n is the length of the codeword. The decoder decodes the codeword from the channel of a tester; when the codeword is decoded, the corresponding segment of the XORed product or vector is shifted serially to the second unit, the cyclical scan chain, where the XORing process of the previous vector and the current vector takes place. The result of the process is that the original test vector is serially shifted into the internal scan chain of the CUT. After the whole test vector is in the scan chain, the CUT is then tested. Receiving the codeword, decoding the codeword, and XORing the vectors can be done concurrently to the test time. Huang 13

2.4 Serial Scan Test Vector Compression Methodology

The serial scan test vector compression concept [13] involves identifying identical segments of test vectors. In addition, the concept employs a directed graph model to assist in finding the maximum reduction of bits that the compression method can achieve by assigning weights and edges in the graph. Although using the model to search for the optimum solution for reducing the number of encoding bits is difficult, the compression concept is straightforward.

The compression method can compresses two, at most three, test vectors at a time.

The method is undemanding; if the last few bits of the first vector are identical to the first few bits of the second vector, the compression approach concatenates the two vectors by overlapping the identical segments of both vectors. For example, if the second half of the first test vector and the first half of the second test vector matches, the result of the compression will be the concatenation of the first vector and the second half of the second vector. To restore the original vectors, it is assumed that there exists extra information regarding the concatenated vectors, such as the number of vectors that are concatenated in the compressed sequence. In the case of two vectors, because the number of pins, p, is known ahead of time, the first vector is the first p bits of the concatenated sequence and the second vector is the last p bits of the sequence.

So that the compression ratio can be increased, finding the best ordering of the test vectors for maximizing the lengths of identical segments is part of the goal of this compression method. Because to find the best ordering requires the utilization of the directed graph and it is NP-hard to find the best ordering, the paper proposes two Huang 14 approaches - depth first greedy algorithm (DF Greedy) and coalesced simple orders algorithm (CSO) - to traverse through the directed graph. The DF Greedy approach begins at the vector that has the most overlapped bits then traverses through the graph by finding the next vector with the second most overlapped bits, and so on. This approach is considered to have reasonably good results and the tactic can be used in many complex problems. The CSO approach combines all the partial ordering of vectors for the purpose of completing the ordering for the whole test set.

2.5 Differential Block Coding

The idea of identifying the identical segments within vectors is also utilized but to a greater extent in the compression approach presented [14]; unlike the mentioned methodology, which is limited to the first or last few identical bits of the vectors, in the section 2.4, the presented coding method employs the approach of identifying any identical, partitioned segments of vectors. Brief overviews regarding the ordering process of test vectors, the encoding process, and the decompression hardware using an embedded processor are presented to help clarify the whole proposed concept.

By ordering the test vectors in a best possible style, the amount of data for representing the differences between two vectors can be minimized, and this produces a high compression ratio. A suggested approach is to construct a graph involving vertices

and edges; while each vertex v corresponds to a test vector tv, and each edge in the graph is assigned a weight representing the number of required bits to encode the information

for producing the test vector tx from ty or vice versa. To find the path that traverses Huang 15 through all the vertices with the least total sum of weights is considered to be an NP- complete problem.

After test vectors are sorted, the vectors are divided into segments or blocks with a fixed, predefined length. The focus of the encoding process is on the blocks with different contents at matching positions which are represented by replacement words.

Each word is associated with three pieces of information: the new block pattern, the block number, and the last flag. The new block patterns, which are blocks of differences between two consecutive vectors, are identified first during the encoding process. The block number is the rank or address of the block among the blocks of a vector. The embedded processor for vector decompression can use the block number for relocating the appropriate new block pattern and building the next vector from the current vector.

The number of bits representing the block number is equivalent to \0g2N, where N is the number of blocks. The last flag is set to zero if the block pattern is not the last one for the next vector; otherwise the flag value is set to one.

To decompress the encoded data, a recommended test architecture involves an embedded processor, memory I/O controller, memory, and serializers. When the on• board memory I/O controller receives the encoded data from the tester, it transfers the data to the memory. The processor then retrieves the stored encoded data from the memory and reinstates the original vectors according to the defined replacement words.

The restored vectors are applied to the appropriate serializers, which are right before the scan chains of the CUT. Finally, the scan chains apply the test vectors to the CUT to performing the testing. Once the multi-input signature register (MISR) collects the test responses from the CUT, the responses are ready for the evaluation. Huang 16

2.6 Huffman Coding

Replacing the frequently repeated sequences or blocks with shorter strings of bits and substituting the rarely appeared blocks with longer strings of bits are the concepts of the Huffman coding [15, 16, 17]; the coding method is considered to be the optimal statistical coding for generating the shortest average codeword, or a new representation of the original block. A general overview of the Huffman coding is shown below:

(1) Establish the length of the blocks

(2) Scan through the data one block at a time and accumulate the knowledge regarding the frequencies of the encountered blocks

(3) Construct a binary Huffman tree to provide the solution of the shortest codewards for the blocks. The construction of the Huffman tree is explained in [15].

(4) Scan through the data one block at a time and replace the block with the corresponding codeword

Therefore, at the end of the coding, the compressed data are the codewords. Depending on the designs of the Huffman compression and decompression programs, the structure and the content of the Huffman tree may or may not be considered as a part of the compressed data along with the codewords. If the programs accept any form of the

Huffman tree, the Huffman tree is required to be a part of the compressed data so that the decompression program can decompress the compressed data according to the tree. On the other hand, if the programs only accept one form of the tree, the information about the

Huffman tree would not be necessary as long as both compression and decompression programs have stored the information regarding the tree prior to the transfer of the encoded data. Huang 17

The performance of the Huffman coding depends considerably on the content of the data and the size of the block. If all combinations of the bits in the blocks have a similar probability, the coding method will not be able to compress the data. As a result, it is believed that only through experiments can one find the appropriate size of the block for a single set of data for achieving the optimal compression ratio, because different sets of data generally demand different sizes of blocks due to their dissimilar contents.

2.7 Statistical Code Selection

To lessen the amount of hardware required to decompress the Huffman-coded

data, a statistical code selection method, which is a variation of the Huffman coding, is proposed [17, 18, 19]. The initial method and the associated decompression architecture

are included [17] to show that although the compression ratios may decrease due to the proposed method, the hardware requirement is reduced noticeably compared to the

original implementation of the Huffman coding. Two similar approaches that are based

on the selection method and the test set compaction for reducing test data are proposed by

two groups of researchers [18, 19]. The general descriptions on the selection method are

given in the following paragraph to clarify the operations of the method.

The theory of the statistical code selection method is to conserve the rare blocks

as is whilst only the recurrent blocks are utilized in constructing the Huffman tree.

Therefore, as with the Huffman coding, the selection method initially requires the

establishment of the block's size and the search of the frequencies of the blocks. As the

method has acquired the frequencies, the commonly appearing blocks are used to Huang 18 construct the Huffman tree so that the corresponding codewards can be discovered; each revealed codeward has a zero appended in front of it. As for the infrequent blocks, each block is encoded as is and has a one appended in front of it. By separating the infrequent blocks from the common blocks, the decoding hardware is reduced because it can send the uncommon blocks directly to the CUT without performing complex operations on them. Unfortunately, the parameter for selecting the common or uncommon blocks is unknown. In addition, the criteria of selecting the two important parameters - block size and the number of coded blocks - are not specified or else the optimal performance of the proposed method would be recognized.

Because the fixed-length block is usually bigger than the corresponding codeword, two proposed decompression architectures are presented to discuss the issue of the differences in receiving and decoding speeds; the architecture includes operations of scan chains, serializers, and decoders [17]. The first proposed architecture utilizes a scan chain clocked at a faster rate than the tester's clock. By shifting the fixed-length block at a faster rate, the architecture restores the original block using the decoder and shifts the restored block into the scan chain before the decoder receives the next codeword. If the scan chain cannot be clocked at a high speed, the second approach involving multiple scan chains is suggested. A single tester channel feeds the chains in the rotation fashion in order to allow the decoder and serializer of each chain to have the time to decode codewords and to shift the blocks. Huang 19

2.8 Lempel-Ziv 77, Lempel-Ziv 78, and Lempel-Ziv-Welch

To compress data, three closely related compression schemes - Lempel-Ziv 77

(LZ77), Lempel-Ziv 78 (LZ78), and Lempel-Ziv-Welch (LZW) - utilize variable-length sequences or patterns rather than the fixed-length codewards [15, 20]. The LZ77 does not need to build a list, or dictionary, of encountered patterns and assumes implicitly that the recurring patterns position in proximity. However, the LZ78 and its successor, the

LZW, create a dictionary of encountered patterns in both the encoder and the decoder, and allow the repeated patterns to appear at different locations in the overall data. The

LZ77 appears to be the most popular method among the three as it is seen in some contemporary compression packages, such as PKZEP and ARJ [15].

The operation of the LZ77 method involves the establishment of a window; the first part of the window is called the search buffer and the second part of the window is called the look-ahead buffer. Prior to the compression, the lengths of both buffers are determined; in addition, the buffers together have the first m-bit of the streamed data, where m is the length of the window. To initiate the compression operation, the LZ77 stores the bits in the search buffer as is. Then, the method tries to match the pattern starts at the left edge of the look-ahead buffer, with any equivalent pattern that it can find in the search buffer. By storing the information about the location of the found equivalent pattern in the search buffer, the LZ77 repositions the window down the stream of data and performs the same operation of locating equivalent pattern repeatedly until all the information regarding the locations of all the data are gathered; the compression is then considered to be complete. Instead of employing the two buffers, the LZ78 and LZW Huang 20 search for equivalent patterns or patterns through a dictionary, which has the history of all encountered patterns in variable lengths and compositions. An overview of the LZW is modified to accommodate the bit stream and is shown as follows (initially, two bits - zero and one - are stored as two separate patterns in the dictionary):

(1) establish the current position to be the first bit of the bit stream

(2) establish the temporary pattern to be the single bit at the current position

(3) search for a match for the temporary pattern through the dictionary

(4) if there is a match, extend the temporary pattern by one bit along the bit stream, and go to step (2); else go to step (4)

(5) store the final extended temporary pattern in the dictionary because the dictionary does not have the pattern

(6) output the dictionary index of the most recently matched pattern in the dictionary

(7) move the current position down the bit stream by the length of the most recently matched pattern

(8) if one or more bits are left uncompressed, go to step (2); else the end of the compression

The differences between LZ78 and LZW are the approach of storing the pattern and the output strategy. Rather than producing a single index to represent the pattern, for each encoded pattern, the LZ78 produces both an index and the last bit of the pattern just stored in the dictionary. Huang 21

2.9 Test Width Compression Based on Counter Architecture

The test cube width compression is developed based on counters and additional combinational logic; the advantages of performing this compression scheme are reduced test time and small area overhead [21]. The two types of compatibilities that the compression method is based on are compatibility and inverse compatibility. When two or more columns of a test set have or can have the exact same values for each of their row, the columns are compatible, because during the testing phase, the corresponding pins of the CUT can connect to the same counter's output in order to receive the same test values. On the contrary, a pair of columns is considered to be inversely compatible in which every row of one column has the inverted value of the same row of the other column. Such columns of data can also be generated by the same output of a sequence

generator or a counter; by providing direct connections between the counter's output and the two pins, and inserting an inverter in the middle of one of the connections, the pair of columns can be generated without difficulties. Based on observation of the two simple compatibilities, the two proposed compatibilities - d-compatibility class and maximal d- compatibility class (MDC) - offer alternatives in grouping the columns. By definition, two columns are d-compatible if none or only one of their rows has a bit with a value of one; such a definition also applies to more than two columns. Therefore, a d- compatibility class is a set of columns with d-compatibility characteristics. Another concept is the MDC, which is a set of d-compatible columns that cannot have more columns joining in their group or else the columns become non-d-compatible. To compress the d-compatible columns, the compression method replaces the rows that have Huang 22 the same index with a binary number, which contains the index of the column that has the bit's value equivalent to one. The number of columns has to be more than two or else no

compression is made. By going through the repetitive process of finding the minimal sets

of d-compatibility and MDC classes and representing the locations of the ones with binary numbers, the compression of the test set is accomplished. Huang 23

CHAPTER 3 FORMER GEOMETRIC-PRIMITIVES- BASED COMPRESSION

Test cubes for a complex chip can be similar to each other [1, 14], because only some pins that are corresponding to one or a few parts of a circuit under test (CUT) will have activities in the provided test data for a period of time, while other pins receive constant test data values. As a result, a former test set compression method [22] based on primitive shapes is designed to take advantage of the large amount of constant test data.

It should be noted that the compression method is most effective for compressing test sets

such as the ones employed to detect single-stuck-at faults, as the test cubes can be rearranged in any order without affecting test results.

The former method first sorts test cubes to obtain a more suitable test set for

compressing. There are two similar sorting algorithms - zero-distance and one-distance

- that rearrange cubes using the weight assignment concept. The advantage of using one

of the sorting schemes over the employment of both sorting schemes is left unknown, but

in the paper the method has employed both sorting schemes. After the cubes are sorted in the preferable order, the sorted test set is partitioned into fixed-size blocks. Within each partitioned block, the function of the second part of the compression method, called area-

covering algorithm, is to extract information regarding recognized primitive shapes - points, lines, triangles, and rectangles. A shape is a collection of bits of identical value in

a formation in a test set or a block; a primitive shape is a shape in predefined formation.

For example, if there are five cubes, cl, c2, c3, c4, and c5, in the test set and each is 7-bit

long, in figure 3.1 (a), the bits with a value of zero or X (the don't care) inside and on the Huang 24 lines resemble a shape - the trapezoid; in figure 3.1 (b), the zero-value or X, the don't care, bits constitute a triangle, which is one of the defined primitive shapes.

A cl 1 u 1 1 1 c2 1 () 0 0 1 X

c3 1 c 0 0 0 1

c4 1 () 0 0 0 () 1 A A A 1 c5 1 \) u U l )

(a)

cl 1 1 1 1 1 1

c2 1 1 1 1 X

c3 1 :c 1 1 1

c4 1 () 0 1 1

1 A c5 1 (J u o !\ 1

(b)

Figure 3.1 Examples of Shapes (a) A Shape (b) A Primitive Shape - Triangle

The cube numbers, grid lines, and the enclosed lines of the shapes do not exist in a test set but appear in the figures for the purposes of aligning the cubes and clarifying the shape concept. The defined primitive shapes and the shapes' variations will be presented in the section 3.2. Converting the information about the shapes into encoding bits is the task of the encoding algorithm, which is the last part of the compression method and presented in section 3.3. This is the only algorithm in the compression method that actually does the transformation from the original test data into a set of encoding bits. Huang 25

Although there can be some minute variations in the overall former compression, the concept shown presents the important aspects of the compression method.

Such a compression method suggests a complete compression approach, which does sorting, area-covering, then encoding, for compressing a test set two-dimensionally; in addition, its counter part - decoding process - is mentioned to be similar to the reverse process of the encoding procedure. Although such an approach intends to produce a good compression ratio, which is the advantage of the compression method, a few disadvantages are present in this former method; both the advantage and disadvantages will be discussed near the end of the chapter.

3.1 Zero- or One-Distance Sorting Algorithm

In the first part of the compression, because the test set, such as the one for detecting single-stuck-at faults, can have different ordering of cubes, the zero- or one- distance sorting algorithm is employed to rearrange the order of cubes according to proposed weight schemes; the sorted cubes permit the rest of compression method to perform efficiently. The intention of the sorting algorithms is to assemble large groups of zeros or ones; to do so, the algorithms assign a weight, which is a cubes' scoring scheme, to an unsorted test cube for establishing a preference measure. Such a weighting concept requires the designation of a reference test cube for calculating the weights of unsorted cubes. The sorting algorithm rearranges all the cubes in the test set by repeating the procedure - determining a new reference cube, assigning weights, and repositioning the Huang 26 heaviest cube - until all the cubes in the test set are sorted. As a result, a new ordering of the cubes is generated after the sorting process.

3.1.1 Weights Assignment

A weight is employed as a measure to represent the relationship between the reference cube, and one of the unsorted test cubes. As the intention of the sorting algorithms is to gather groups of zeros or ones, more weights will be given if such a large group of zeros or ones can occur. In order to provide the measure, every bit of the reference cube is compared with two or three bits of an unsorted cube for calculating subtotal weights; after all the bits of the reference cube are compared, the sum of all subtotal weights becomes the overall weight of the unsorted cube. The approaches of comparing the bits are the same because both sorting algorithms and the weighting schemes of the two algorithms are similar to each other to some extent.

Usually, three comparisons are made to each bit in the reference cube. One of the comparisons involves the evaluation of one bit of the reference cube, or the reference bit, and the unsorted cube's bit at the position which corresponds to the location of the reference bit in the reference cube; two additional bits located adjacent to the corresponding position in the unsorted cube are also compared with the reference bit to improvise the weight measurement. An example that depicts the positions of the compared bits from two five-bit cubes is shown in figure 3.2. Huang 27

Reference Cube 1 X

Unsorted Cube 1

Comparison between the Two additional comparisons reference bit and the bit at between the reference bit and bits corresponding position in located adjacent to the unsorted cube corresponding positions in unsorted cube

Figure 3.2 Comparing Neighbouring Bits in the Distance Sorting Algorithm

For each comparison between the reference cube's bit and the unsorted cube's bit, a subtotal weight, which can be 0, 0.25, or 1, is determined depending on the values of the bits compared. In the zero-distance sorting, heavier weight is produced if more groups of zero-value bits are found; in one-distance sorting, however, heavier weight is generated if more groups of ones are found. As a result, the zero-distance sorting focuses on groups of zeros while the one-distance sorting emphasizes groups of ones. Two tables, the first one employed in zero-distance and the second one employed in one-distance sorting, regarding different bits compared to obtain subtotal weights are shown below:

Table 3.1 Table of Zero-Distance Weights

\. Reference ^\ Bit 0 1 X UnsortecP\ Cube's Bit\

0 1 0 0.25

1 0 0 0

X 0.25 0 0.25 Huang 28

Table 3.2 Table of One-Distance Weights

\. Reference Bit 0 • 1 X Unsortecf^v Cube's Bit\

0 0 0 0

1 0 1 0.25

X 0 0.25 0.25

In general, the subtotal weights regarding all three compared bits from the unsorted cube are included in the total weight. When calculating subtotal weights for the two reference bits, one at the beginning and one at the end of the reference cube, one of the three bits is not available for weight calculation; as a result, the weight regarding the unavailable bit is simply ignored. An example of calculating the overall weight utilized in the zero- distance sorting of two five-bit cubes is illustrated below.

First Reference Bit Fifth Reference Bit

T T

Reference Cube 0 0 1 0 X

Unsorted Cube 1X001 Figure 3.3 An Example of Weight Calculation in Zero-Distance Sorting Huang 29

Overall weight determined for the unsorted cube

= (subtotal weights of first reference bit) + (subtotal weights of second reference bit) + (subtotal weights of third reference bit) + (subtotal weights of fourth reference bit) + (subtotal weights of fifth reference bit)

= (0 + 0.25) + (0 + 0.25 + 1) + (0 + 0 + 0) + (1 + 1 + 0) + (0.25 + 0)

= 3.75

3.1.2 Sorting Process

The sorting process, either zero-distance or one-distance, is a controlled repetitive process, which involves selecting a new reference cube, assigning weights to unsorted cubes, and repositioning the cube with heaviest weight; the sorting process stops when there is one test cube left unsorted, because there is no other alternative ordering for the last unsorted cube. The complete procedure of the zero-distance sorting is detailed below; the one-distance sorting is similar to the zero-distance sorting with two of differences, which will be mentioned after the detailed procedure. There is no simple way to decide whether to employ one or both sorting algorithms in the compression process, as either approach has its own advantage.

At the beginning of the zero-distance sorting process, in order to determine the weights of test cubes, the cube with the most zeros is chosen as a reference and moved to the top of the test set. After all cubes but the reference cube are assigned with overall weights, the test cube with the heaviest weight will be repositioned from its original position to the new position, which is below the reference cube in the test set. Huang 30

Subsequently, the moved test cube is designated as the new reference for determining the new weights for the rest of the unsorted cubes in the test set. The procedure that consists of determining the new reference cube, assigning weights, and repositioning the heaviest cube is repeated until there is only one test cube left unsorted. The following flowchart demonstrates the overall procedure of the algorithm.

Use the cube with most number of zeros as a reference to determine the weights of the rest of the test cubes in the original test set

Determine the overall weight of each unsorted or unmoved test cube by referring to the bits in the reference cube

Reposition the test cube with the heaviest weight below the referring test cube in the test set

Utilize the test cube with the heaviest weight as the new reference

Figure 3.4 The Flowchart of the Zero-Distance Sorting Algorithm Huang 31

There are two differences between the zero-distance and one-distance sorting algorithms. The first difference is that in zero-distance sorting, the cube with the highest number of zeros is chosen as the first reference; however, in one-distance sorting, the cube with the highest number of ones is employed as the first reference. The weighing scheme is the second difference between zero-distance and one-distance, and the differences in weight assignments are mentioned in the previous section. Despite the two minute differences, the other aspects of both sorting schemes are identical.

There are two possible approaches in deciding how to employ the sorting algorithms. The first approach requires the whole test set to be scanned to calculate the total number of zeros and ones before the sorting process can begin. If the total number of zeros is greater than the number of ones, the zero-distance sorting algorithm is employed; else the one-distance sorting algorithm is employed. The second approach is to allow the whole compression process to be performed twice: one compression process using the zero-distance sorting and one compression process using one-distance sorting.

A better compression ratio is obtained after the comparison of the two performed compressions. In terms of compression time, the first approach uses nearly half of the time of the second approach, because the first approach only compresses the sorted test set once while the second approach needs to sort and compress the test set twice for zero- and one-distance. However, the second approach attempts to obtain a better compression ratio while the first approach does not. The second approach is exercised in the paper. Huang 32

3.2 Area-Covering Algorithm

After the test cubes are rearranged according to the instructed sorting algorithms, the sorted test set is partitioned into blocks. For each partitioned block, the area-covering algorithm is deployed to extract information regarding the primitive shapes; the details of the primitive shapes will be discussed in the next chapter. As mentioned in the paper, the algorithm attempts to find the best group of shapes covering all the bits in the block by creating different shapes at the different locations is the partitioned block. Because the amount of details about the algorithm in the paper is very small, the actual, full operation of the algorithm is uncertain.

3.3 Encoding Algorithm

The third part of the compression method, the encoding algorithm, converts shape-related information into equivalent encoding bits. There are three main categories that will be encoded: real data, blocks made of only zeros and/or Xs or only ones and/or

Xs, and primitive shapes. The overall procedure of the encoding algorithm is illustrated in figure 3.5. Huang 33

Each shape • 0 0 (x,y) 0 1(xl,yl)(x2,y2) 1 0 0/l;i(xl,yl)(x2,y2) • 1 I(xl,yl)(x2,y2)

0 when all bits in the block are either Os or Xs;l otherwise 1 0 when shapes are made of Os, or Os and Xs; 1 when shapes are made of Is, or Is and Xs ' Direction (Dir) bit representation in the primitive shape table

Figure 3.5 An Overview of the Encoding Algorithm Procedure of the Former Compression Method

A partitioned block made of zeros and/or Xs solely, or ones and/or Xs solely, will be

encoded differently than the blocks made of primitive shapes, because the former can be

encoded with a few bits while the latter requires more than several encoding bits. If the partitioned block is uncompressible, meaning that the number of required encoding bits is

greater than the bits in the block, two zeros and the content of the block will be encoded

as is. Huang 34

3.4 The Advantage and Disadvantages of the Former Method

An advantage and a few disadvantages are discovered to be associated with the former compression method. The concept of compressing test sets two-dimensionally provides the possibility of increasing the compression ratio, which is the main advantage of the method; however, there are four disadvantages - the limitation of the sorting algorithm's application, the non-shape-related sorting approach, the restricted performance of compressing fully specified test sets, and the excess of encoding bits for representing small shapes or original blocks - associated with this former method and such drawbacks can deteriorate the performance of the compression.

3.4.1 Advantage

The main advantage of the compression method, the fact that test sets can be compressed two-dimensionally, allows for the possibility of achieving a higher compression ratio compared to other existing compression methods. Instead of the technique of other contemporary methods - encoding one segment of a test cube at a time, the primitive shape based approach compresses several similar segments of cubes by relating them as a single shape to increase the compression ratio. In addition, such an advantage proves its significance when a partitioned block is made of Os and/or Xs, which requires three bits to encode the whole block, regardless of the number of bits inside of the block. As a result, the approach of compressing test data two- dimensionally, especially when the data is homogeneous, is fairly efficient. Huang 35

3.4.2 Disadvantages

Although the advantage of the compression approach is noticeable, the disadvantages of the approach should not be ignored, as these negative aspects may decrease the compression ratio, especially when compressing test cubes for sequential circuits. The first disadvantage, which is the restriction on the application of the sorting algorithm, may depreciate the performance of the compression. If the original ordering of the test cubes, such as the ones for detecting faults within a memory module or for sequential circuitry, cannot be altered, the sorting process for assisting the compression method in producing better-formed shapes will be disabled. Subsequently, these test sets, which may or may not have well-formed shapes, will be transformed directly through the area-covering and encoding processes; therefore, the performance of the compression is not guaranteed. Therefore, such a limitation on the selection of test cubes is considered to be a possible disadvantage because in the case that the sorting algorithm is disabled, the performance of the compression method may be compromised.

The second disadvantage is also related to sorting - the non-shape-related sorting approach. Because it does not consider the primitive shapes during the sorting process, the sorting procedure is suspected to have a rather unpredictable performance and to be less efficient. As it will be seen in the proposed method presented in the next chapter, a superior sorting algorithm that is shape-oriented is proposed to attempt to create better- formed shapes for better compression results.

When compressing a fully specified test set, the performance of the compression method is constrained, and this is the third disadvantage. Because of the absence of the Huang 36 don't cares in the test set, compressing the fully specified test data may render the shape- based compression method, including both former and proposed compressions, vulnerable because there would be less alternatives available for acquiring the best possible combination of shapes to represent the test set.

Encoding primitive shapes and the original data is expensive, and this is the last disadvantage of the compression method. For example, in an 8-bit by 8-bit partitioned block, one bit that is not a part of any shape is recognized as a point shape. If the shape is required to be encoded, the representation of such a bit requires eight encoding bits, two for indicating the shape type, and the other six bits for representing the x coordination and y coordination. Another example is that if a part of a partitioned block consists of random formation of bits, the number of encoding bits is always greater than the number of original bits; as a result, the compression ratio can decrease easily. Huang 37

CHAPTER 4 SHAPE-ORIENTED TEST SET COMPRESSION METHOD USING IDEAL VECTOR SORTING AND SHAPES

Although the former test set compression method has an advantage over other

existing compression methods, in order to achieve a higher compression ratio, its sorting

and area-covering algorithms require improvements and clarifications and its

disadvantages should be minimized as much as possible. In the proposed method, the

shape-oriented test set compression, not only the sorting and the area-covering processes

advance distinctly by adapting the concept of ideal vector sorting and the additional

shapes, but also two disadvantages of the former method are challenged and solved either partially or completely.

The sorting scheme in [22] does not sort cubes according to primitive shapes and hence the approach produces less well-formed shapes. In order to seek shape-related relationships among test cubes for obtaining the opportunity of achieving better

compression ratios, two vector or cube sorting algorithms are employed. The first is to

sort the test pattern in ascending order, then the ideal vector sorting is employed.

Because of the well-known status of the ascending sort algorithm, which solely rearranges cubes in the order of their binary values, from smallest to largest, the details of

such an algorithm are not discussed; however, the second algorithm, the ideal vector

sorting algorithm, will be discussed fully. The ideal vector sorting recursively creates a best vector, called ideal vector, that helps complete the shapes identified in the two most recently sorted cubes, and repositions the best-matched cube beneath the two cubes to achieve the purpose of shape-oriented sorting. After the sorting procedure is completed, Huang 38 the sorted cubes can contain more well formed primitive shapes, resulting in a smaller number of shapes to identify in the next part of compression and a better compression ratio.

Once a test set is sorted, the test data is partitioned into fixed-size blocks. By sharing the same aim of producing less required shapes for encoding, the second part of the compression method - amalgamated-shapes area-covering algorithm - identifies primitive and additional types of shapes within the blocks. The algorithm encapsulates the locations of the bits inside each partitioned block by employing the predefined shapes. Introducing the additional shapes, which are augmented primitive shapes appearing among several adjacent blocks, enhances the area-covering algorithm and prevents the occurrence of situations in which one shape is divided up and encoded in separate blocks due to the boundaries of the blocks. Therefore, because a smaller number of shapes is identified, this will eliminate the need for a high number of encoding bits to represent shapes.

In the last part of the compression method, the multi-syntax encoding algorithm translates the shapes recognized by the amalgamated-shapes area-covering algorithm into encoding bits according to various encoding syntaxes. The result of the encoding process is the compressed data that can be sent to the circuit under test (CUT).

To decompress the encoded test data, the multi-syntax decoding algorithm is exercised either in the automatic test equipment (ATE) or on board the CUT. By repeatedly identifying the syntax category in the compressed data and creating necessary shapes or blocks, the process restores the test data into its original form. Because the Huang 39 process does not need to find the optimal solution but merely decodes the data according to matching syntax architectures, the process is simpler than the compression procedure.

To certify the accuracy of the compressed and decompressed data, two

straightforward verification processes are designed and utilized. The processes play an important role in the research and possibly in the overall testing procedure because the verification procedures can ensure the exact test set is restored. By knowing the original test data is recovered, not only the intended fault coverage of the test set is reserved, but

also no possible faulty or nonexistent circuit operations, which are caused by the

inaccurate decoded test data, can take place in the CUT.

Therefore, by exercising its three algorithms, the proposed compression method

can compress test cubes two-dimensionally more efficiently and have less disadvantages

compared to [22].

4.1 Ideal Vector Sorting Algorithm

The ideal vector sorting rearranges test cubes by attempting to complete the recognized parts of primitive shapes, such as lines, triangles, and rectangles, in the

corresponding pair of most recently sorted cubes through the means of ideal vectors; producing an ideal vector, rather than a cube, as a model provides a consistent measure

during the sorting process. Figure 4.1 shows the purpose of utilizing an ideal vector for

attempting to complete the triangle made of zeros; in the figure, the previous cube is the

second most recently sorted cube while the current cube is the most recently sorted cube; the rest of this section will continue employing the terms - previous and current cubes - Huang 40 as the two most recently sorted cubes for the purposes of simplicity and consistent notation.

Previous Cube X 1 6\ l 1 1 0 Current Cube X 1 0 °\ 1 X 1

Ideal Vector 1 1 0 0 0 ...1 1 \ The next sorted or relocated cube, which comes below current cube, should be similar to this ideal vector to extend or to complete the recognized shape or shapes. Here, the identified shape is a triangle made of zeros (encompassed by dotted lines)

Figure 4.1 The Concept of Employing an Ideal Vector

Creating an ideal vector requires sections of the two most recently sorted cubes to determine the appropriate composition of the model; the perimeter of a section is called a window, which can be either primary or secondary. The bits in the primary window are always employed in determining each bit of the ideal vector, or an ideal bit; on the other hand, the bits in secondary windows are employed only when the information of the primary window's bits is insufficient in establishing the value of the ideal bit. Although one ideal bit is usually established by monitoring the bits in the window, two ideal bits will be determined if the primary window is employed at the left or right end of the two recently sorted cubes. By utilizing the information from the windows, an ideal vector library can arbitrate the value and the importance, through the means of weights, of each ideal bit. To clarify the process of creating an ideal vector, primary and secondary windows are discussed in section 4.1.1 and section 4.1.2, respectively; the ideal vector Huang 41 library is discussed in section 4.1.3. In addition, the in-depth description of the sorting procedure is presented in the section 4.1.4.

4.1.1 Primary Window

The task of the primary window is to provide information for generating a confident value for the corresponding ideal bit. As a result, the dimension of a primary window is established at three-bit long along a test cube, by two-bit wide across the two most recently sorted cubes; a total of six bits are encompassed in the window and employed in arbitrating the ideal bit. Within the window, the centre locations of the bits correspond to the location of the ideal bit; the bits in the window provide the surrounding information not only from the centre position, but also from the left and right positions with respect to the centre of the window. An example is illustrated in figure 4.2.

Previous Primary,, Current Primary Window Window

Previous Cube 1 0 0 1 X

Current Cube X 0 1 1 X

Ideal Vector 1111 Corresponding Ideal Bit

Figure 4.2 Primary Window and Its Corresponding Ideal Bit

The size of the primary window is large enough to provide adequate information in determining the ideal bit while small enough to efficiently obtain the value of the Huang 42 required ideal bit. If the dimension is smaller than three bits by two bits, the data offered by the window is insufficient and the value of the ideal bit becomes arbitrary. For

instance, if the window is three-bit by one-bit, which is the dark dotted rectangle in figure

4.3, the corresponding ideal bit is preferred to be one in order to complete a triangle made

of ones as in figure 4.3 (a) while the ideal bit is preferred to be zero in figure 4.3 (b) to

complete the straight line shape made of zeros; the bits either under or enclosed by dotted

lines represent the shapes that are wished to be completed.

Primary Window

Previous Cube 0 0 0 0 0 X

Current Cube X o ; o 0 X _ — - tI : J Ideal Vector 0 Q.- 1 Corresponding Ideal Bit

(a)

Primary Window

Previous Cube 1 ""0 1 1 1/1 X 'T Current Cube X 1 j\p 1 1 i 1 X t Ideal Vector 1 1 0-. Corresponding Ideal Bit

(b)

Figure 4.3 Cases for Smaller Primary Window, (a) The Corresponding Ideal Bit is 1; (b) The Corresponding Ideal Bit is 0

If the length of the window is greater than three bits, or the width is greater than two bits,

the extra information acquired increases the amount of time needed to determine the ideal Huang 43 bit and sometimes has less influence on selecting the bit. The simplest example is illustrated in figure 4.4; all the bits inside the original dimension of the primary window are zeros and the corresponding ideal bit is zero in figure 4.4 (a). The same ideal bit is also preferred if the window is enlarged to five-bit by three-bit, and this is shown in figure 4.4 (b).

Primary Window

Former Sorted Cube 0 0 0 0 1 1

Previous Cube 0 0 0 0 0 1 X

Current Cube X 0 0 0 0 0 X 1" I Ideal Vector 0 0 0 0 Corresponding Ideal Bit

(a)

Enlarged Primary Window

Former Sorted Cube 0 0 0 0 1 1 1 1

Previous Cube 0 0 0 0 0 ] 1 X

Current Cube X 0 0 0 0 1 0 X l Ideal Vector 0 0 0 0 Corresponding Ideal Bit

(b)

Figure 4.4 Examples with Same Content in the Primary Window, (a) The Window with Original Dimension (b) The Enlarged Primary Window Huang 44

4.1.2 Secondary Window

In most situations, the information provided by the primary window is sufficient for producing a deterministic ideal bit; however, in cases when such information becomes insufficient, additional information from the bits outside of the window is required. In such cases, utilizing secondary windows for providing the additional information is introduced; while one secondary window is located adjacent to the left of the primary window, the other one is located to the right of the same primary window. Each secondary window is one-bit long along the test cube by two-bit wide across the two most recently sorted cubes. As a result, a total of two bits from the cubes are encompassed in each secondary window and a total of four bits from both secondary windows are employed to provide the additional surrounding information. An example of the combination of the pair of windows and their relative positions to the primary window is illustrated in figure 4.5.

Secondary Windows Primary Window

Previous Cube 1 1 jl 1 1 I j! I [ x

Current Cube X 0 '] 0 1 1 i] 1 1 X -h

Ideal Vector 0 0 0 l Corresponding Ideal Bit

Figure 4.5 The Secondary Windows With the Matching Primary Window Huang 45

In figure 4.5, the corresponding ideal bit is one for attempting to complete the identified rectangle, which is made of zeros, on the left of the cubes. If the ideal bit is zero instead, more than one shape made of zeros is required to cover all the zeros. Utilizing only the combination, or pattern, of the zero and ones inside the primary window alone does not guarantee a confident value for the associated ideal bit under any circumstances. In figure 4.6, the same content inside the primary window is obtained from figure 4.5 is shown; however, the bits outside of the primary window are changed to show the difference in the preferred ideal bit.

Secondary Windows

\ / Primary Window

Previous Cube 1 0\ 1 1 1 X

Current Cube X 0 ; fx I I X --\- Ideal Vector 1 0 0 0 Corresponding Ideal Bit

Figure 4.6 Different Configuration of Bits in the Secondary Windows Results a Different Ideal Bit

The corresponding ideal bit is preferred to be zero in this scenario because the zero helps complete the recognized triangle (the dotted triangle in figure 4.6). Because of the importance of the information provided by the pair of windows, the dimensions of the secondary windows are properly defined to provide the adequate supplementary data outside of the primary window. If the windows are smaller, the encompassed bits will be insufficient; if the windows are larger than one bit by two bits, the additional encompassed bits will be too far away from the ideal bit under consideration and hence Huang 46 will exercise no influence on the value of the bit. Although both secondary windows should be employed whenever the content in the matching primary window is insufficient, when the primary window is utilized at the left end or right end of the two most recently sorted cubes, only the right or left secondary window is activated because the other secondary window is inapplicable or contains no bits.

There are several advantages to deploy the secondary windows. First, it provides the supplementary information only when necessary. Second, it minimizes the

disadvantage of spending time for acquiring the additional information from the windows. Furthermore, because each pattern of zeros and/or ones discovered in the

secondary windows requires a separate ideal bit, the burden of storing all the ideal bits in

the ideal vector library is lessened, and this will be seen in the next section.

4.1.3 Ideal Vector Library

Each pattern of zeros and ones encountered in either the primary window only, or

the collaboration between the primary and secondary windows, is associated with a

distinctive ideal bit and weight. An ideal vector library is created with the intention of providing the ideal bit and weight of the bit; while the ideal bit is determined by trying to

complete the identified shapes in the windows, the weight of each individual bit is

defined according to a proposed weighting scheme, which is based on the attributes of the pattern of the windows. The weight of each ideal bit is part of a weight list that will be

used for determining the best-matched cube to the ideal vector. As a result, with the

assistance of the determined ideal bits and the related weights from the ideal vector Huang 47 library, the characteristics of the next appropriate ideal vector, that will be relocated to the most recently sorted cube, can be confidently constructed.

4.1.3.1 Values of Ideal Bits Stored in the Ideal Vector Library

Because the outcome of determining an ideal bit is permanent, the ideal bits stored in the ideal vector library are reusable. In the library, there are three sets of ideal bits deposited: left most, centre, and right most. Each set is fairly different from each other because they are generated according to the different position that the primary window resides in the two most recently sorted cubes. Due to the fact that the number of encompassed bits in a primary window is six, there will be 26, or 64, different patterns that can occur in the window. Because the inverse of a zero is one, the number of ideal bits that should be stored becomes 32, which is half of the total possible patterns, for easing the task of determining and the burden of storing the ideal bits. Therefore, when a counterpart of a pattern is discovered, the corresponding ideal bit is retrieved from the library and is inversed to have the proper value. As the utilization of the pair of secondary windows is required in arbitrating an ideal bit, instead of one ideal bit, a total of sixteen ideal bits are stored to associate with the pattern in the primary window because the total number of encompassed bits in the secondary windows is four and a total of 24, or 16, patterns is considered. Huang 48

4.1.3.2 Weight Assignments

In order to provide a coherent measurement for and to show a certain degree of discrepancy among the patterns and the ideal bits, the proposed weighting scheme is designed to represent the effects of the patterns' attributes on their associated bits. There are three attributes of patterns explored: the number of shapes or segments of shapes appear in the windows, the continuity of shapes from one cube to another, and the degree of certainty of the value of the ideal bit. While the first two attributes involve the content in the primary window only, the third attribute will be based on the content in the primary window, and if applicable, the content in the secondary windows as well. Each attribute contributes a different weight and the sum of the three weights is the overall weight assigned to the pattern's ideal bit. A heavy weight means a high certainty in the determined value of the ideal bit; as a result, the bit is highly preferred and most likely to be matched compared to other light-weighted ideal bits.

The first attribute, the number of shapes, assigns a subtotal weight of three, and is in the reverse relationship with the weights; in other words, the large number of shapes or segments of shapes identified in the primary window corresponds to a low weight. It is because the high quantity of recognized segments means a high degree of randomness of the bits in the window, resulting in the fact that the associated ideal bit is less deterministic. Table 4.1 below shows the appropriate weight assignment for each quantity of shapes: Huang 49

Table 4.1 Weight Assignment Table for the Pattern Attribute - Number of Shapes

Number of Shapes 1 2 3 >3

Assigned Weight 3 2 1 0

For example, in figure 4.7 (a), the subtotal weight acquired will be three, because the rectangle made of six zeros is the only shape to appear in the primary window. However, in figure 4.7 (b), the subtotal weight obtained will be zero because more than three primitive shapes - two points made of ones (the circles), and either a triangle and a point made of zeros, or two horizontal lines made of zeros - appear in the window; the figure shows two points, a triangle, and a point in the window; the mentioned shapes in both figures are depicted by dotted lines. Primary Window

ij Previous Cube X ]{ 0 0 0 1

Current Cube 0 0 0 0 X I ii

(a) Primary Window _ s

Previous Cube 1 . 0 ( 0 0 .' ).. • • Current Cube 0 1 0 0 ( 1 X

(b)

Figure 4.7 Examples of Weight Assignments from the Attribute - Number of Shapes, (a) An Example of Pattern Receives a Weight of 3; (b) A Pattern Receives a Weight of 0 Huang 50

The second attribute, the continuity of shapes from one cube to another in the primary window, acquires an utmost weight of two. This characteristic of the pattern focuses on both the shapes made of zeros and the shapes made of ones that appear in both segments of the cubes in the primary window. An exception situation occurs when the bits in the window are zeros only or ones only; in such a scenario, the subtotal will be two for the reason of the complete continuation of the rectangle shape identified in the window. Table 4.2 shows the proper weight assignment for the second attribute:

Table 4.2 Weight Assignment Table for the Pattern Attribute - Continuity of the Bits in Two Sorted Cubes

One More than One Degree of All the Shapes Discontinued Discontinued Continuity Continued Shape Shape

Assigned 2 1 0 Weight

The last attribute is the degree of certainty of the ideal bit's value; the associated weight of this attribute has a maximum value of five. This feature depends on the probability of the value of the ideal bit. As the pattern in the primary window is kept constant, if the ideal bit's value is identical in all possible patterns in the secondary windows, a weight of five will be granted for the ensured value of the ideal bit.

However, if the value of the ideal bit can be different if dissimilar contents in the associated secondary windows are encountered, the maximum possible weight will be on the scale of three, instead of five, for the purpose of differentiating the patterns with well- Huang 51 ensured values from the patterns with possibly ambiguous values. The breakdown of the weights is displayed in table 4.3.

Table 4.3 Weight Assignment Table for the Pattern Attribute - Degree of Certainty of the Value of an Ideal Bit

Identical Ideal Different Ideal Bits When Dissimilar Secondary Bits When Windows Encountered Degree of Dissimilar Certainty Secondary Identical Bits in Identical Bits in Identical Bits in Windows 3A of Secondary V% of SecondaryV* of Secondary Encountered Windows Windows Windows

Assigned 5 3 2 1 Weight

Unlike the previous two attributes, the minimum weight acquired under this attribute is one, not zero. It is because if a pattern receives zeros from all three attributes, the overall weight of the corresponding ideal bit will be zero, meaning the effect of the bit's weight doest not contribute to the overall weight. Therefore, by defining the minimum weight to be one, the corresponding bit can influence the overall weight in the minimal rather than nil fashion. As a result, an ideal bit can acquire the overall weight, by adding up the appropriate subtotal weights from the three attributes, in the range between the minimum, which is one, and the maximum, which is ten. For example, if the pattern in the primary window consists of zeros only, the weight of the ideal bit will be calculated as follows:

Weight of the ideal bit (pattern = all zeros)

= (weight from number of shapes) + (weight from continuity of shapes) + (weight from degree of certainty) Huang 52

= (3) + (2) + (5)

= 10

The pattern that consists of all ones also has the same weight as above, which is ten, due to the previously mentioned complementary logic rule.

The values of the weights are preliminary suggestions. Therefore, through experiments, the weights can be adjusted properly to obtain an optimal ordering of test cubes for a test set.

4.1.4 Ideal Vector Sorting Process

To be shape-oriented, the sorting algorithm or process reorganizes test cubes according to the identified shapes in the cubes. To do so, the sorting process consists of several steps: assign the second most recently and the most recently sorted cubes as previous and current cubes, produce the ideal vector according to the two cubes by employing the ideal vector library, discover the best matched cube among the unsorted cubes, and relocate the best matched cube below the current cube in the test set.

At the beginning of the process, because two cubes are required for constructing an ideal vector, the sorting algorithm assigns the cube at the top of the test set as the previous cube. To retrieve the current cube from the rest of the test set, the process selects the cube that is most similar to the first cube; once a suitable cube is selected, the algorithm relocates the cube from the cube's original position to the position underneath the previous cube. In order to discover the appropriate cube that comes below the current cube to help complete the recognized shapes in the two cubes, the algorithm constructs an Huang 53 ideal vector by utilizing the information from the previous and current cubes. By shifting the location of the primary window, from the left end to the right end of the two cubes, and activating the secondary window or windows when the primary window offers inadequate information in determining the ideal bit, the algorithm determines each corresponding ideal bit of the ideal vector according to the patterns in the windows and the retrieved corresponding value from the ideal vector library. At the end of the window shifting, not only the required ideal vector is formed, but also a weight list, which comprises the weights associated with the ideal bits, is created along with the vector.

With the assistances of the constructed ideal vector and the weight list, for each unsorted cube, the sorting algorithm compares each ideal bit with the bit at the corresponding position in the unsorted cube. If the cube's bit is matched, the algorithm includes the associated weight of the ideal bit in the total weight assigned to the cube; otherwise, nothing happens. The unsorted cube with the heaviest total weight is relocated below the current cube, because the cube is considered to be the best match to the ideal vector; as a result, the sorting or relocating of a cube is then finished. To continue the sorting for the next cube, the algorithm renames the current cube as the new previous cube and the most recently relocated cube as the new current cube. Based on the two lately assigned cubes, the algorithm constructs a new ideal vector and the related new weight list. After the unsorted cube with the heaviest weight is determined, the algorithm relocates the cube beneath the new current cube. Therefore, the steps of assigning cubes, constructing vectors, creating related weight list, and relocating cubes with heaviest weights are repeated for sorting the rest of the unsorted cubes; the repetitive process ends when all the cubes are sorted. The overall sorting process is depicted in figure 4.8. Huang 54

Assign the first cube of the test set as the previous cube; assigns another cube that is the closest match to the previous cube as the current cube

l'_ Construct the ideal vector and the related

ir Allocate the proper total weight to each unsorted or not yet relocated cube by matching the bits of the ideal vector with the bits of the unsorted cube, and granting weights to the matched bits

Relocate the unsorted cube with the heaviest allocated weight below the current cube

v Assign the current cube as the previous cube; assigns the lately relocated cube as the current cube

^-^^ Finished sorting all No the cubes?

Yes~|

End of Sorting Process

Figure 4.8 Flowchart of the Ideal Vector Sorting Process

The ideal vector sorting steps, together with the ascending sort at the beginning, complete

the overall sorting procedure. By reorganizing the cubes in relation to shapes, the second part of the compression method, the area-covering process, can take the advantage of better-formed shapes in the sorted cubes to obtain less information about shapes and hence can achieve a higher compression ratio. Huang 55

4.2 Amalgamated-Shapes Area-Covering Algorithm

After the test set is partitioned into blocks, finding and storing the characteristics, such as quantity, location, type, and dimension, of the predefined shapes recognized in the blocks is performed by the amalgamated-shapes area-covering algorithm, which is the second part of the compression method. The concept of discovering the characteristics is to encapsulate the shape-related relationships within a test set with the intention that after the algorithm has collected all the information, the relationships then can be represented by a small number of bits in the next algorithm. Before the area-covering process begins, the test set will be partitioned into blocks and each partitioned block will be processed separately. The minimum dimension of a partitioned block is currently established at 8- bit by 8-bit. This is because if the size of a partitioned block decreases below this number, the compression ratio will decrease because of the encoding scheme.

After the test set is divided into blocks, to obtain characteristics of identified shapes, the process attempts to assemble bits into groups, or to cover the areas of bits according to predefined formations or shapes within each block. The enhanced area- covering process can identify the all-zero or all-one block, and the primitive shapes and their variations: point, line, triangle (isosceles right angle triangle), and rectangle. In addition, the process can recognize three additional types of shapes: extended shapes, imperfect shapes, and the four-bit by four-bit blocks; while the first two evolve from some primitive shapes, the third type of shape consists of fixed-size miniature blocks.

The extended shapes, or shape extensions, are the shapes expanded beyond the current partitioned block. The second proposed type of shape, called the imperfect shape, applies Huang 56 only to triangles and has the defined triangle configuration but is missing one or two of its less-then-90-degree angles. Furthermore, similar to the all-zero, all-one blocks, the process employs the miniature blocks, or the four-bit by four-bit blocks, to identify blocks of zeros or ones for the purpose of increasing the compression ratio. Table 4.4 illustrates all the shapes and blocks employed in the proposed area-covering process.

Table 4.4 Table of Shapes Utilized in the Proposed Area-Covering Process

Variation #1 Variation #2 Variation #3 Variation #4 Shape Classification Primitive Shapes

Point None None None (x,v)

(x,y) D Line D D D (x,y) (x,y) (x,y)

(x,y) Triangle (x,y) 45° 45° Dl (x , y) t-> h Rectangle None None None D2

Additional Shapes or Blocks

CPB CPB CPB CPB

Line Extension !(x,y) D D (x,y) (xTy) D/ (x,y) Huang 57

CPB 45°- 45°- CPB D (x,y) (x, y) Imperfect (x,y) Triangle D : (x,y) 45°- CPB CPB 45°-

CPB CPB CPB CPB :(x, y) Tri angle (x,y) (x, y): Extension

CPB

Rectangle (x, y)L None None None Extension

0X00 0 100 xooo 10 10 Four-Bit By 00X0 00 11 None None Four-Bit Block xooo 1100 Homogeneous Heterogeneous

CPB = Current Partitioned Block (dash-lined square in the figure) D = Distance DI = Distance 1 D2 = Distance 2

The distance D, the coordinates of the starting points, shown by the black dots in the figures, and other details about the shapes will be discussed further in later sections. It should be noted that the coordinates are determined according to the modified Cartesian coordinate system for the ease of shape recognition; an example of the system is shown in section 4.2.6.1. Huang 58

The descriptions about the special case, which is the all-zero or all-one block, and the shapes - primitive shapes, primitive shape extensions, imperfect triangle, and four-bit by four-bit blocks - will be given from section 4.2.1 to 4.2.5. Following the presented details regarding the shapes and blocks, the proposed shape and block recognition procedures that are part of the overall algorithm are presented for clarification in section

4.2.6. The flow of the overall area-covering algorithm is discussed in section 4.2.7.

4.2.1 All-Zero or All-One Block

An all-zero or all-one block is a partitioned block made of zeros only or ones only; of course, either the all-zero or all-one block can contain one or more Xs because an X, or don't care, can be either a zero or one. This is the simplest content that a partitioned block can have and will be recognized first by the area-covering process before the identification process on other shapes can begin.

4.2.2 Primitive Shapes

The primitive shapes employed by the proposed area-covering algorithm are the same as the ones employed in the former compression method; however, several assumptions are made and described below as the former compression method lacks some details regarding the shapes. All the primitive shapes, except the rectangle, can be less than or equal to the size of the block. A primitive triangle is an isosceles right angle triangle, which contains two forty-five-degree angles and one ninety-degree angle; in Huang 59

other words, both non-diagonal sides of the triangle have an identical number of bits.

Although a primitive rectangle does not have such restrictions on its sides, this four-sided

shape can only be any size less than the size of a partitioned block; this is because if the

rectangle is as large as the partitioned block, the block will be considered as the all-zero

or all-one block, rather than a rectangle. This consideration is made due to the encoding

efficiency; the amount of required encoding bits for a rectangle is greater than that of an

all-zero or all-one block. The small amount of required encoding bits means a high

compression ratio.

Once a shape is verified to be a primitive shape, depending on the type of the

shape, the related information - the shape type, the shape variation (if applicable), the x-

coordinate and y-coordinate of the shape's starting point, the size or the distance of the

shape (if applicable) - will be stored and converted into encoding bits later on in the

compression method. The information helps the decoding process restore the shapes into

their exact original forms.

4.2.3 Primitive Shape Extensions

Primitive shape extensions are the primitive shapes - line, triangle, or rectangle -

/ that prolong beyond the boundaries of their corresponding partitioned blocks; the terms,

primitive shape extension and extended shape, are used interchangeably throughout the

rest of the thesis. According to the former area-covering algorithm, an extended shape is

recognized and parsed as several primitive shapes located in separate blocks, because a

shape is recognized only within one partitioned block and any bit of the shape located in Huang 60 other blocks will be dealt with afterwards when those blocks are processed. Such an arrangement on the extended shape causes a low compression ratio because instead of just the information regarding one extended shape, additional information regarding the several primitive shapes is also stored. Therefore, it would be more efficient if the entire extended shape were identified if it were a normal size shape. In order to accomplish such a goal, instead of simply identifying shapes within the current partitioned block only, the proposed area-covering algorithm performs shape recognition starting from inside to outside of the block.

Although the requirement of the extended shapes' information is the same as that of the corresponding primitive shapes, because the extended shapes can be larger than the dimension of a partitioned block, the difference between the shapes' necessary encoding bits is revealed in the encoding process. In spite of the discrepancy, the design of shape extensions provides not only the option of identifying the oversized shapes, but also has minimal impact on the decoding efficiency due to the fact that only a small amount of extra program is required to accommodate the difference in the shapes' sizes.

4.2.4 Imperfect Triangle

An imperfect triangle can be seen as a normal primitive triangle with its one or two less-than-90-degree angles imaginatively existing outside of the current partitioned block; only the part of the triangle within the current block is encoded. In other words, an imperfect triangle is a primitive triangle with its one or two angles missing, and the triangle's sides that are supposed to attach to the missing angle or angles are always Huang 61 attached to the boundaries of the corresponding block. The purpose and also the advantage of including imperfect shapes is to obtain information about the multi-sided shapes that are adjacent to the borders of the block with the least possible amount of effort; by representing the various forms of shapes with the least effort, a high compression ratio can be expected. Intuitively, in order to encode a polygon, the information about some or all coordinates of the vertices of a multi-sided shape is required to be stored; the stored information is large and the associated encoding bits increase unavoidably when the dimension of the partitioned block increases. As a result, the encoding algorithm in the last stage of the compression method becomes inefficient when encoding polygons. However, a special case of the polygon - the imperfect triangle - does not require vast information to be stored. Only three pieces of information shall be saved for the purpose of describing the triangle: the coordinates of the starting point, the distance between the starting point and one of the triangle's vertices at the less-than-90-degree angles, and the corresponding shape variation. Although the associated encoding bits of the first two pieces of information increase when the size of the partitioned block is augmented, the encoding bits of the third piece of information are kept constant. Therefore, using the imperfect-triangle approach to identify a polygon is efficient as long as the multi-sided shape belongs to one of the qualified imperfect triangles that will be described next. There are three possible alternatives designed for each imperfect triangle variation to allow the triangles to be more versatile; all alternatives require the same type of information and the processes of restoring the alternatives are operative. All valid alternatives are illustrated in table 4.5. Huang 62

Table 4.5 Legitimate Alternatives of Each Imperfect Triangle Variation

Alternative

Alternative #1 Alternative #2 Alternative #3 Variation

Imperfect Triangles

CPB CPB CPB —i i D J D: Variation #1 (x,y) (x,y) a—1-> i (x,y) -45° i V 45° — 45° —

CPB c 45 45c + 45° Variation #2 (x,y) (x,y) (x,y) D i D : D CPB CPB

45°-V CPB 45c 45c Variation #3 Z3 (x,y) D (x,y) (x,y) ! D D l CPB CPB

CPB D CPB_ «- L! D (x,y) D i Variation #4 (x,y) (x,y) 45°- TI CPB 45c 45°-

CPB = Current Partitioned Block (dash-lined square in the figure)

In table 4.5, the first two alternatives of an imperfect triangle can be considered as a primitive triangle missing one of its less-than-90-degree angles. On the other hand, the

alternative #3 is considered as a primitive triangle missing both of its less-fhan-90-degree

angles. The different presences of the angles of the three alternatives are identified Huang 63 according to the relationship between the block's boundaries and the location of the related triangle. Because the details of recognizing an imperfect triangle - noticing the boundaries of the partitioned block, considering only the bits within the block, and storing the starting coordinates of the shape - are the same as in the approach of identifying primitive shapes, the discrepancies of the alternatives are managed automatically by the existing area-covering method. Therefore, no additional information is required to be stored for the purpose of differentiating the alternatives.

Because an imperfect triangle is another variation of the primitive triangle, the encoded information regarding the shape is similar to that of a matching primitive triangle. However, there are two main differences between the two. The first difference is that an imperfect triangle can have a distance, D, larger than the partitioned block, while a primitive triangle can not have a distance larger than the block. This is because the imperfect triangle can be considered as an extended triangle, which can be larger than a partitioned block, but without one or two of its less-than-90-degree angles. The second difference is the position of the starting point of the imperfect triangle. The starting point of any shape has to be inside the block, because a shape is covered and decoded starting from its starting point. Therefore, the starting point of an imperfect triangle cannot be any one of its angles since at least one of its less-than-90-degree angles does not exist.

As a result, the only starting point that an imperfect triangle can have is at its 90-degree angle that always exists inside the block. Huang 64

4.2.5 Four-Bit by Four-Bit Blocks

Although encoding shapes inside the partitioned block with a dimension below 8- bit by 8-bit is inefficient, encoding a small block that is made of either Os only or Is only is still effective in increasing the compression ratio. Therefore, the four-bit by four-bit blocks are proposed to take the advantage of encoding homogeneous or heterogeneous bits in small, square shapes. Encoding four-bit by four-bit, or miniature, blocks is efficient because only the information regarding the variation of the type of the miniature block is required; this is because, unlike shapes, the dimension and the location of such a block is permanent and implicitly employed during either the encoding or decoding phases. As a result, no encoding bits are required to store the dimension and the location of the miniature block. In order to encode the small block effectively, the block's dimension is currently defined at 4-bit by 4-bit and the block's allowed variation can be

either homogeneous or heterogeneous. If its dimension is 8-bit by 8-bit, the partitioned block is divided evenly into four miniature or four-bit by four-bit blocks; the procedure of performing the area-covering approach utilizing the miniature blocks is discussed in the

later section. The relative locations of the miniature blocks inside an 8-bit by 8-bit partitioned block are shown in figure 4.9. Huang 65

unit: bit

Figure 4.9 Four-Bit by Four-Bit Blocks in an 8-Bit by 8-Bit Partitioned Block

Allowing only two types of miniature blocks - homogeneous and heterogeneous blocks - can ensure the encoding efficiency. A four-bit by four-bit block is considered to be homogeneous if the bits within the block are the same or Xs, the don't cares. As a result, there are two variations of homogeneous blocks because of the complementary logic; one variation consists of zeros and another consists of ones. Due to its uncomplicated content, the homogeneous block can be encoded effortlessly using a few encoding bits, similar to the encoding technique for the all-zero or all-one block.

However, if a miniature block does not have straightforward content, or is made of a mixture of Os and Is, the block is identified as heterogeneous. Because it would be inefficient to encode such a block using shapes, the information of the block that will be acquired is the same as the block's content. Huang 66

4.2.6 Shape and Block Recognition Processes

A shape or block recognition process takes place whenever the area-covering algorithm attempts to find one of the mentioned shapes or miniature blocks. Because of its two main characteristics, the implicit location and the permanent size, the four-bit by four-bit block's recognition process is fairly different from the recognition process for the shapes. Therefore, two processes - one recognizing the shapes and one recognizing the four-bit by four-bit blocks - are discussed in the following sections.

4.2.6.1 Shape Recognition Process

A shape recognition process recursively performs the identification of the bits' value at predetermined locations according to the provided shape's type; if all the bits at the locations are identified to have the same required value, which can be zero or one, the shape is considered to be recognized. Once the information - the type, the initial coordinates, and the required value of bits - of the shape that will be searched for is given, the process identifies the required bits horizontally and vertically, starting from the acquired coordinates within the partitioned block. When applicable, the type of the shape could include both the type and the variation of the shape. As a result, it is noticed that the deployment of the recognition process can recognize only one of the four variations of the shape - line extension - at a time. To recognize all four variations, the area- covering algorithm must perform the shape recognition four times. The initial coordinates provide the location of the shape that has been identified, while the required Huang 67 bits' value helps the recognition process find the correct composition of the shape.

Therefore, with the information - type, coordinates, and bits' value, the recognition process can make the attempt of identifying the required shape with the required composition at the appropriate location.

Three pieces of recognition information are obtained and stored temporarily to establish the initial state of the recognition process: the size of the recognized shape, the total number of covered or certified bits, and the update of the current position of the bit just being identified. The information is updated whenever necessary in the reiteration of the procedure for the purpose of performing shape recognition. Because the size of the identified shape is unknown initially, the procedure commences the recognition with a small, required shape formation. Therefore, the size of the shape is initialized to be zero and the bits in the smallest possible formation are verified to have the same required value; the number of verified bits becomes the initial value of the total number of covered bits. The third piece of information, the location of the bit, has the initial coordinates given from the area-covering algorithm.

In order to generate the coordination and verify the value of every bit within the shape being recognized, the procedure updates the current position of the bit that is currently identified based on the original current position and the type of the shape. To establish the location of a bit, both an x-coordinate and a y-coordinate are required. After the early recognition at the provided initial location, if applicable, the process continues the recognition of bits from left to right on the same row, or the same segment of a test cube, as the initial location; the procedure stops at the furthest allowable location on the managed row and tries to identify the bits on the row below. By continuing the Huang 68 recognition of the bits at the required locations from one row to the next, the process achieves the recognition of the requested shape. When traversing from row to row, the size of the shape and the number of specified bits being identified are updated accordingly; while the former is useful for recovering the shape being recognized during the decoding process, the later is used as a measure of the shape's worthiness. It is worth mentioning that due to the involvement of the don't cares or Xs, the number of specified bits can be equal to or less than the maximum bits that can be covered by a shape; therefore, an update on the number of specified bits is necessary. The process is aware of the acquired shape's type, the size of the recognized shape, and the appropriate perimeter of the partitioned block. If the shape's type is a primitive shape or imperfect triangle, only the bits within the block will be identified; however, if the type is a shape extension, the proper bits within and outside of the perimeter will be recognized.

The repetitive recognition procedure is terminated when one of the two following conditions is met:

(1) the bit being recognized is not the same as the required bit's value

(2) the bit's location is not appropriate

It is noticed that the largest shape of the required type is identified at the end of the procedure due to the recursive update on the shape's size. A pseudo code of the shape recognition process is shown in figure 4.10. Huang 69

set current position to be the same as acquired initial coordinates set the size of the recognized shape to zero set the total of specified bits identified to zero while ((current position at allowed location) && (required bit's value = bit at current position)) { if (all bits in the shape that has the size+1 have the required bit's value) size = size + 1 if (not don't cares = bit at current position) increase the total of specified bits identified by 1 adjust current position according to the type and size of the shape }

Figure 4.10 A Pseudo Code of Shape Recognition Process

The process of recognizing a vertical line is explained as an example for elucidating the overall shape recognition process. An 8-bit by 8-bit partitioned block is given in figure 4.11. The decimal numbers along the top and left side of the block are the corresponding x-coordinate and y-coordinate of the bits in the block; such a coordinate system is also utilized in other parts of the compression and decompression methods. In the example, the shape being recognized is required to be made of ones, and the provided initial location is (1,3). Huang 70

X •

0 1 2 3 4 5 6 7

0 0 0 0 X X 0 0 0

1 0 0 0 X X 0 X 0

2 0 0 0 0 X X X 0

3 0 1 0 0 X X X X

4 0 1 1 0 0 X X 0

5 0 1 0 0 1 1 X 0

6 0 1 0 0 1 1 X X

7 0 1 0 0 1 1 X X

Figure 4.11 An Example of Recognizing a Vertical Line

Therefore, initially, the process establishes the current position to be the same as the obtained initial coordinates (1,3). When the process executes the while loop, it confirms that the current position is within the boundaries of the block and the bit at (1,3) has the required value of one. As a result, the process changes the size of the recognized shape from zero to one; in addition, the total of specified bits is incremented by one. Because a vertical line is being recognized, the current position is modified from (1,3) to (1,4) for the recognition of the next bit; in other words, the zero at (2,3) will not be examined during the process at this moment. After the current location, (1,4), is confirmed to be within the parameter and the bit at (1,4) is verified to be the required value, both the size and the total of specified bits are increased by one; the current location is modified to be

(1,5) at the end of the while loop. The whole process of updates and verifications is repeated until the current location becomes (1,8) because the required shape's type is a primitive vertical line that exists only within the block; in the case that a vertical line Huang 71 extension is sought, the boundaries of the block will be disregarded and the shape recognition will continue as if the current position were within the block.

A noticeable discrepancy between the recognitions of the primitive and imperfect shapes, and the recognitions of shape extensions, is the alteration of the bits outside of the partitioned block. No modification to the bits outside is required if the information related to a primitive or imperfect triangle is stored. However, in the case that a shape extension is required to be recorded, the recognized bits that are outside of the block will be replaced by Xs instead of their original value; by doing so, during the turns to store the recognized shapes in the blocks with replaced Xs, less specified bits will be considered which sometimes yields a better compression ratio.

4.2.6.2 Four-Bit by Four-Bit Block Recognition Process

The four-bit by four-bit block recognition process is also recursive but is simpler than the previous process because the size and the position of the miniature block are permanent and determined ahead of time; as a result, no given information other than the content of the partitioned block is required prior to the beginning of the process for determining the type of a miniature block. For clarifying their determined positions in a partitioned block and the process of identifying miniature blocks, the boundaries of four miniature blocks, represented by dashed-lined boxes, are illustrated once more along with

an 8-bit by 8-bit partitioned block in figure 4.12; the dashed-line boxes can also be

established in a larger partitioned block in a similar fashion. Huang 72

X •

0 1 2 3 4 5 6 7

0 0 0 0 xj i o 0 0 o i 1 0 0 0 xi 1 0 0 X 0 | 2 . 0 0 0 0 Ix 0 X 0 3 0 0 0 o i x X X x 1 4 ! 0 1 1 0 1 o X X 0 i 5 0 1 0 0 1 1 X o i

6 0 1 0 o 1 1 X X 7 o 1 0 o i [ i 1 X x

Figure 4.12 The Four Four-Bit by Four-Bit Blocks in an 8-Bit by 8-bit Partitioned Block

The recognition process is designed to determine the type of one miniature block at a time. Such a determination requires the recording of the value of the bit at upper left corner as a reference value at the beginning of the process; if the referenced value is a don't care or an X, the process will record the next available, specified bit. Such a reference value is employed to compare with the rest of the bits in the miniature block. If the remaining bits have or can be the same as the reference value, the block is considered to be homogeneous; otherwise, the block is regarded as heterogeneous. Therefore, in figure 4.12, the top two miniature blocks are homogeneous because they consist of only one type of bit, which is zero. The bottom two miniature blocks, however, are heterogeneous blocks due to their mixed-bit content. For performing the mentioned tasks, a corresponding pseudo code is suggested and illustrated in figure 4.13. Huang 73

record the appropriate reference value set the current position to be the bit adjacent to the right of the referenced bit set total of bits to be zero While ((total of bits < 16) && (reference value = the bit at current position)) { increment the total of bits compared by 1 update the current position } if (total of bits =16) block is homogeneous and is made of reference value else block is heterogeneous

Figure 4.13 A Suggested Pseudo Code of a Four-Bit by Four-Bit Block Recognition Process

As a result, rather than receiving requested information as in the shape recognition process, the four-bit by four-bit block recognition process provides the determined type of the miniature blocks according to the contents of the blocks.

Therefore, the block recognition process is more content-oriented than the shape process.

In addition, because the miniature blocks have predetermined locations and simple variations, the miniature block recognition process requires less time than that of the shape recognition process; this implies that the decoding procedure for the blocks is simple as well. Both miniature block and the mentioned shape recognition processes are employed extensively in the overall area-covering process, which will be discussed next.

4.2.7 Overall Area-Covering Algorithm

Once the test set is partitioned into blocks, the area-covering algorithm is employed to conclude and to save the attributes of the partitioned blocks in a determined order; to discover the attributes of a block, the algorithm chooses the category that can Huang 74 encapsulate the content of the block in the least number of encoding bits. To clarify the overall area-covering algorithm, a preparation stage and four information-gathering stages are designed to regulate different operations. The preparation stage sets up the appropriate partitioned block for processing. Following the preparation stage, the first stage scans through the current block and determines whether the block is an all-zero or all-one block or not. If the block is made of only one type of bit, the area-covering algorithm moves to the preparation stage; else the algorithm performs the shape recognition and four-bit by four-bit block recognition in its second and third stages. In the last stage of the algorithm, the shape or block information that requires the least number of encoding bits is stored. The identification of the type of the current block and the acquisition of the corresponding information are considered done. The overall algorithm is depicted in the flowchart presented in figure 4.14, which is on the next three pages; while the recognition-related operations are displayed in boxes or other shapes with white backgrounds, the perimeters of the associated stages have grey backgrounds. Huang

anient partitioned block - ('l-nd DI pioccss^ first partitioned block

••11 \ ail\ IIK cutcuoiv DI the anient anient partitioned paititioncd block •••If block_ next block

mm Save the category 60 and associated ill C3 data of the current partitioned block

Define the number of pusses to be zeio

L)etine the required bit's value to be zeio (look for shapes made of zeros)

I )efine the initial location to be (0,0)

Employ shape recognition processes for different shapes (primitive, extension, imperfect) with the same initial location

Record the attributes, such as type, starting point, and size of the shape that encompasses or covers the most specified bits, into buffer #1

o-o5 I 'pdate the initial location with a new coordination that is not part of any recognized shape

Define the requned bn s \ Jlue to tte one (look for shapes made] of ones) -Yes* Figure 4.14 The Flowchart of the Overall Area-Covering Algorithm Huang

Define the number of processed four-bit by four-bit. or minuuuc blocks lo zero

Define the maximum lumibet of four-hii by four-bit blocks required to be identified in the petitioned block

Choose the fiist foui-hit In four-bit block to be the current immature block

, ,. \ + ''' Employ the four-bit by four-bit block || £ recognition process to the current •ii miniature block up m SP

Record the identified miniature block's type and if required, the corresponding •111 Ii Thir c 1111111 data into buffer #2 1111 IB

Increment the number of processed miniature blocks by one

The next four-bit j^-^^ processed miniature \'o by four-bit block ^"^CT blocks > maximum becomes the ilil ill requirement? ^^y^ current miniature block

t. xes.x '4-' ( C lioose the one with the least number of Ijll encoding bits required to represent the mi anient partitioned block among the four options — shapes made of zeros, shapes made of ones, four-bit by four-bit block, and real data.

Save the chosen block's type and perform one of the following procedures: (1) If the option is shapes, save the associated data from buffer #1 Back lo Preparation Stage (2) If the option is the four-bit by four- Fourt h Stag e hit block, save the corresponding data from buffer #2. (3) If the option is real data, save all the bits in the current partitioned block.

Figure 4.14 The Flowchart of the Overall Area-Covering Algorithm (Continued) Huang 77

Before any recognition of a block can begin, during the preparation stage, the

algorithm is required to select a partitioned block, also called a current partitioned block;

such a block is utilized throughout the algorithm in determining the type of the block. As the test set is divided up into blocks, the order of choosing the block in the test set begins

from the block at the leftmost to the one at the rightmost of the same row on the top of the test set. When the algorithm finishes performing area-covering operations on the row

of blocks, the algorithm will move on to the next row of blocks and start the recognition procedure in the same order as it performs on the previous row. Such an order is also

employed in encoding and decoding algorithms for the purpose of ensuring the consistent

operations and restoring the proper order of the original test data.

Because representing shapes or miniature blocks requires more encoding bits than

what the special case requires, the first stage of the algorithm determines whether the block is an all-zero or all-one block, or not. If the block is the special case, the algorithm

saves the category information, which is an indication of the special case, and a value,

which is either zero or one, indicating that the block is made of solely zeros or ones; the

algorithm then bypasses the rest of the algorithm and performs the area-covering

procedure on the next available block. However, if the current partitioned block contains

a mixture of zeros and ones, the second part of the algorithm will employ the shape

recognition process.

Because a test set compression has to be lossless, in order to capture the exact

values of the bits and their locations, the second stage of the algorithm identifies shapes,

through the shape recognition process, to encompass or cover all the bits with the same

values in the block. As mentioned before, a shape is made of bits that can have the same Huang 78 value and does not overlap other identified shapes. With the intention of storing the attributes of the recognized shapes in an efficient fashion, due to the nature of the complementary logic, the algorithm can focus on covering all the bits with values of zero only, while considering the rest of the block to be made of ones, to encapsulate the overall content of the block; the reverse in the bits' values is also true. As a result, during the second stage, two passes are performed - one looks for shapes made of zeros while the other looks for shapes made of ones - upon the current block; in other words, the required value of the shape being identified in the recognition process is established to be zero in the first pass and one in second pass. In each pass, although the required value of the bits is constant prior to the deployment of the recognition process, the two pieces of information, the location to begin with and the type of the shape that will be identified, vary from time to time. The algorithm begins the recognition process with the bit with the required value at the initial location, which is the left upper corner of the block with the coordinates of (0,0); the notations of the x-coordinate and y-coordinate of the bits are the same as the ones in figure 4.11 and figure 4.12. A small number of identified shapes is preferred to cover the same amount of overall bits, because the number of shapes has a non-inverse relationship with the number of encoding bits required. Therefore, each recognized shape is wished to encompass as many specified bits as possible to reduce the total of identified shapes. In order to find the shape with the most number of specified bits encompassed at the given initial location, the algorithm specifies the shape that will be identified in the shape recognition process by going through shapes one by one. As a result, according to table 4.4, with the same initial location, the algorithm reinitiates the shape recognition process for each variation of each type of shape. It is worth Huang 79 mentioning that the bit at the initial location must have the required value and be covered by the recognized shape or else the recognition process is not commenced on the current shape and moves on to the next available type or variation of shape.

Once the recognized shape with the most number of specified bits covered is found, the associated attributes, including the type, the starting point, and the size of the shape, will be stored into an empty memory space in the buffer #1; the buffer #1 is a generic term for storing any shape-related information temporarily. While the type of the shape is utilized to identify the stored shape, the shape's starting point helps locate the position of the shape in the partitioned block. The stored starting point of the shape is usually the same as the initial location, except for the imperfect triangles. The size of the shape is represented by the distance D in table 4.4; a further discussion on the distance concept is presented in the next section because the creation of such a notion is based on the intention of reducing the encoding bits involved. Following the storage of the attributes, the algorithm will search for the next uncovered bit with the required value in the same row and update the initial location accordingly; further details are shown in figure 4.10. The same operations are performed repeatedly for the rows in the rest of the block until recognized shapes cover all the bits with the required value.

Because the result of the second stage of the algorithm does not always yield the minimum number of encoding bits to encapsulate the content of the current partitioned block, the third stage, involving the operation of determining the type of four-bit by four- bit blocks, provides an alternative in representing the block in a minimal number of bits.

The total miniature blocks that will be examined in the recognition process is calculated before the start of the recursive operations, involving both the exercise of the miniature Huang 80 block recognition process and the storage of the recognized block's type. No further discussion on the details of identifying miniature blocks is shown because the descriptions are straightforward and already displayed in figure 4.13. When all the corresponding types of the blocks are stored into another buffer, the third stage is completed. Based on the results generated by both second and third stages, the algorithm now has enough alternatives to decide the minimal number of bits that can represent the current block and will make the decision in the next stage.

To conclude the efforts of shape and block recognitions, the fourth or last stage of the algorithm selects and saves the one with the least amount of required encoding bits among the four options - the shapes made of zeros, the shapes made of ones, the four-bit by four-bit blocks, and the original or real data; in addition, the stage also dictates the course of the algorithm's operations. After comparing among the options, if the algorithm has chosen one of the three options - shapes made of zeros, shapes made of ones, and four-bit by four-bit blocks, both the type and the corresponding attributes of the recognition results, such as the shapes' sizes or miniature blocks' types, are retrieved from the corresponding buffer and saved. However, if the results of all the recognition processes require more bits than the total number of bits in the partitioned block, the algorithm will choose the last category, which is saving the whole content of the block and an indicator; the indicator suggests that the saved data is original or real data. When the block-related information is saved, the algorithm continues the reiteration of the mentioned operations, including the block-type determination and recognition, on the next partitioned block by moving into its preparation stage; the algorithm terminates all operations once all the partitioned blocks in the test set are processed. Huang 81

It is believed that the mentioned algorithm is not the only method of extracting the

shape-related information from partitioned blocks. A potential direction of the further research can focus on the reduction in the number of shapes required to represent the

same bits in blocks. However, the effort of finding the number of shapes may have an

inverse relationship with the number of shapes required; in other words, the more

advanced form of the algorithm will require a longer time to find a smaller number of

shapes, compared to the time required by the proposed algorithm. This is because the

further enhanced version of the algorithm may need additional time and memory to

analyze the positions of the bits with extensive care and to perform extra trial and error.

When the amalgamated-shapes area-covering algorithm finishes with saving

information about the shapes and blocks, all the saved data will be converted into

encoding bits in the next part of the compression method, the multi-syntax encoding

algorithm. Because the encoding approach is straightforward, it requires less time to be

executed compared to that of the area-covering algorithm. Huang 82

4.3 Multi-Syntax Encoding Algorithm

Replacing the original data with smaller yet meaningful data, or encoding bits, is the goal that a compression method attempts to achieve. As a result, the decision to select the encoding structure of the encoding algorithm for the encoding bits is as important as other parts of the compression, because of the close relationship between the encoding syntax and the compression ratio. For the purpose of searching for a better encoding constitution, in the third part of the compression method, the encoding concept evolves around both the representation of the attributes of a shape or miniature block, and the overall structure that includes all the encoding syntax representing different saved information from the second part of the compression method; the result of such an evolvement becomes the multi-syntax encoding algorithm and the associated syntax structures.

The multi-syntax encoding algorithm not only helps the compression method translate the saved shape- or block-related information into encoding bits in an efficient style, but also employs the distance and the devised encoded block separation approaches to let the overall encoding method become more efficient. Four syntax categories - original or real data, all-zero or all-one block, four-bit by four-bit blocks, and shapes - are designed to accommodate the variations of the saved information; the category of shapes is the largest among the four as the category includes primitive shapes, extended shapes, and imperfect triangles. Each category has a category header and the associated information such as shapes' attributes. Because of the evident impact of the encoding structure on the compression method, to understand the concept that influences the design Huang 83 of the encoding syntax for representing shapes' attributes, two main aspects of the concept - the distance notion and the permanent, predefined lengths of encoding sequences - are discussed in the section 4.3.1. The details of the encoding syntax of each category are explained through the section 4.3.2 to 4.3.5 in order to clarify the encoding composition of each category. To complete the description of the overall compression method, the procedure of the encoding algorithm is discussed in section 4.3.6.

4.3.1 Distance Concept and Permanent Lengths of Encoding Sequences

Both aspects - the distance concept and the permanent lengths of encoding sequences - dictate the appearance of the encoding syntax. Based on an intuitive approach, with proper modification, the distance concept is derived to represent the dimension of a shape, which is one of the shape's attributes that are saved, in an efficient fashion; such a concept applies to all shapes except the point, which has no dimension.

In order to store a shape, the intuitive approach is devised to acquire all the locations of the angles of the shape. For example, to encapsulate a primitive triangle, which is an isosceles right-angle triangle, the three locations of the angles should be stored; the variations of the shape are shown in table 4.6. Huang 84

Table 4.6 An Intuitive Approach of Storing Information Regarding a Triangle

Variation #1 Variation #2 Variation #3 Variation #4 Shape Classification^ Primitive Shapes

(xl.yl) (x2,y2) (xi, yl) (xl.yl) (xl.yl) (x2,y2)

Triangle 45°

(x3 , y3) (x2,y2) (x3,y3) (x2,y2) (x3,y3) (x3 , y3)

By storing the coordinates of all three points of a triangle, the shape is transformed from a figure into encoding bits. In the case that a triangle is identified in an 8-bit by 8-bit partitioned block and the triangle's attributes are wished to be stored, each x- or y- coordinate of the triangle is translated into three bits, and the total bits is calculated as follows:

Total required bits of a primitive triangle

= (bits represent xl) + (bits represent yl) + (bits represent x2) + (bits represent y2) + (bits represent x3) + (bits represent y3)

= (3) + (3) + (3) + (3) + (3) + (3)

= 6 * (3)

or

6 * (log2 (size of partitioned block)) (4.1)

where the size of the partitioned block is the length of the side of the block in the number of bits; as mentioned before, the partitioned block usually is in the form of square. Huang 85

Similarly, to store a line identified in the block, the coordinates of the points at both ends of the line are required; the total number of bits is obtained as follows:

Total required bits of a primitive line

= (bits represent xl) + (bits represent yl) + (bits represent x2) + (bits represent y2)

= (3)+ (3)+ (3)+ (3)

= 4 * (3)

or

= 4 * ( log2 (size of partitioned block) ) (4.2)

Because a total of four points is required to be stored, the total number of bits involved in storing a primitive rectangle is twice as much as that required by a primitive line; the number of bits is calculated as follows:

Total required bits of a primitive rectangle

= (bits represent xl) + (bits represent yl) + (bits represent x2) + (bits represent y2) + (bits represent x3) + (bits represent y3) + (bits represent x4) + (bits represent y4)

= (3) + (3) + (3) + (3) + (3) +(3) +(3) +(3)

- 8 * (3)

or

= 8 * (log2 (size of partitioned block)) (4.3)

Although only the required number of bits of the primitive shapes are demonstrated as examples, similar formulae are also found in that of the imperfect and the extended shapes. By performing substitutions to the coordinates of the figures in table 4.6, the Huang 86

modification of the intuitive approach needs two, rather than three, points of a triangle,

plus an additional bit, to encapsulate the information of a triangle. According to the

shapes in table 4.6, equivalent relationships among the coordinates are observed.

Table 4.7 Relationships Among the Coordinates of Primitive Triangles in Table 4.6

\. Triangle

Variation #1 Variation #2 Variation #3 Variation #4

Relationships^^

Equivalent Relationships xl = x3 xl = x2 xl = x3 x2 = x3 Among the yl=y2 y2 = y3 y2 = y3 yl=y2 Coordinates

In theory, based on the observed relationships, a triangle can be represented by the

coordinates of the two points at both ends of the diagonal side of the shape. However, if

only the two points are saved, the encoding sequences for the variation #1 and #3 are

identical, causing uncertainty about the exact shape stored; a similar situation also arises

for the variation #2 and #4. As a result, one additional bit is required to distinguish the

difference between the two variations. The total number of bits required in the second

approach is calculated as follows:

After improvement, the total required bits of a primitive triangle

= (bits represent xl) + (bits represent yl) + (bits represent x2) + (bits represent y2) + (1 bit for differentiating variations)

= (3) + (3) + (3) + (3) + (1)

= 4 * (3) + 1 Huang 87

or

; 4 * (log2 (size of partitioned block) ) + C (4-4)

The C, or constant, in the equation (4.4), is one in this case. Through comparison, the equation (4.4) yields less number of bits compared to that yielded by the equation (4.1).

Although the equation of the line does not benefit from the modification and is kept the same, the equation of the rectangle can be improved dramatically. According to figure

4.15 (a), some of the information regarding the four points is redundant or equivalent in the initial approach and all the redundant information is listed in table 4.8.

(xl , yl) (x2 , y2) (xl,yl) TJ- tr

(x3 , y3) (x4 , y4) (x2 , y2)

(a) (b)

Figure 4.15 (a) The Positions of the Required Points (b) After the Modification, the Locations of the Required Points

Table 4.8 Relationships Among the Coordinates of a Primitive Rectangle in Figure 4.15 (a)

Equivalent Relationships Among the Coordinates of a Rectangle

xl = x3 yl=y2 x4 = x2 y4 = y3 Huang 88

As a result, instead of four points, the two points with (xl,yl) and (x4,y4), are required to represent the rectangle; both required points, renamed with (xl,yl) and (x2,y2), and the associated rectangle are shown in figure 4.15 (b). To be consistent with the redundant relationships found in table 4.8, the equation (4.3) can be simplified to the following:

After improvement, the total required bits of a primitive rectangle

= (bits represent xl) + (bits represent yl) + (bits represent x2) + (bits represent y2)

= (3)+ (3)+ (3)+ (3)

= 4 * (3)

or

= 4 * ( log2 (size of partitioned block) ) (4.5)

Two interesting details are found in the equation (4.5). The first detail is that due to the simplification of the procedure, the equation (4.5) requires only one half of the required number of bits of the equation (4.3) because the number of points stored is reduced from four to two. The second detail is the similarity between equation (4.5) and (4.4); the only difference between the two equations is the constant factor. Such a similarity is explainable because both shapes require information regarding two of their points.

Although significant improvements are made to the methods of storing the shapes, the performance of the equations (4.2) and (4.4) can be further enhanced through the distance concept.

By storing the distance between the two points of a shape, the distance concept can further decrement the required number of encoding bits of the previous equations.

Rather than considering two points of a shape, one point and one distance between the Huang 89 points are employed; the primitive shapes with the matching distances are shown in table

4.4 in the previous section. The required number of bits of a triangle identified in an 8- bit by 8-bit block is determined as follows:

After the distance concept, the total required bits of a primitive triangle

= (bits represent xl) + (bits represent yl) + (bits represent distance) + (bits represent variation)

= (3)+ (3)+(3)+(2)

= 3 * (3) + (2)

or

= 3 * ( log2 (size of partitioned block)) + C (4.6)

Compared with the equation (4.1) and (4.4), the equation (4.6) yields the least number of

encoding bits because the minimum size of the partitioned block is determined at 8-bit by

8-bit. In addition, the final equation for calculating the number of bits for a line becomes

exactly the same as the equation (4.6) for a primitive triangle, which is

After the distance concept, the total required bits of a primitive line

= (bits represent xl) + (bits represent yl) + (bits represent distance) + (bits represent variation)

= 3 * (log2 (size of partitioned block)) + C (4.7)

where C in this equation has a value of two. Therefore, when the size of the partitioned

block increases, the advantage of the distance concept is more noticeable because all the

equations are in a direct relationship with the size of the block. Huang 90

The second aspect that every part of the encoding syntax possesses is the predetermined and constant number of bits for representing the category header and the associated information in each category. For example, to represent an x-coordinate, which is one of the required shape-related attributes that will be translated into encoding bits, a total of three bits is required if the dimension of the partitioned block is established at 8-bit by 8-bit. Although the number of bits for corresponding an x-coordinate can be less than three bits because the value of an x can be in the range between 0 and 7, the required number of bits is kept constant and matches the highest number of bits required to represent the longest distance allowed in the block. It is because if the number of corresponding bits varies according to the value of the attribute, the decoding process cannot decode the compressed bits properly as the process does not realize which part of the compressed bits corresponds to the x-coordinate, unless the process is informed by

additional bits that are appended to the corresponding bits. Therefore, to avoid the decrement in the compression ratio caused by the additional bits, the attributes are transformed into a permanent number of bits, which are known in both compression and decompression methods.

4.3.2 Original or Real Data Encoding Syntax

During the second part of the compression, if employing shapes or blocks to encapsulate the content of a partitioned block always requires more encoding bits than the total number of bits in the block, the block is considered to be uncompressible. If Huang 91 such a situation arises, the corresponding category header will be saved according to the formats displayed in tables 4.9 and 4.10 and the content of the block will be saved as is.

Table 4.9 Encoding Table (Category Header) of Real or Original Data Block

Encoding

Category Type Category Separator Category Classification

Original or Real 00 0 Data Block

Table 4.10 Encoding Table (Block Information) of Real or Original Data Block

Encoding

Data Stored Block Classification ^\

Original or Real All bits in current Data Block partitioned block

To ensure the consistency of the encoding format, the category header will be saved first in the encoding sequence, following by the content of the block. The category header consists of two parts: the category type and the category separator. The category type always appears in the category header of any category and is employed to distinguish the category itself from the other categories. The category separator is a special bit that is only utilized under this category type, 00, to separate the two categories

- real data and four-bit by four-bit blocks - because both categories employ the same code of the category type. Here, after the category header is saved as part of the Huang 92 encoding sequence, all the bits in the partitioned block will be saved as is and appended after the category header to complete the overall encoding sequence; therefore, if a 16-bit by 16-bit partitioned block belongs to the original or real data category, a total of 16x16, or 256, bits will be appended to the end of the category header, 000.

The approach of encoding the content of the block is similar to that of the former compression method. Although the proposed syntax requires one extra bit over the former syntax, the effect of the additional bit is insignificant due to the rare appearance of this situation in most test sets; such a claim is supported by the observation in the experimental results shown in Chapter 5 and listed in appendix A.

4.3.3 Four-Bit by Four-Bit Block Encoding Syntax

To accommodate the two variations of the miniature block, the homogeneous and the heterogeneous blocks, the four-bit by four-bit or miniature block encoding syntax employs a block variation bit to differentiate the two blocks; as a result, the syntax is slightly more complicated than the previous one. To elucidate the structure of the corresponding syntaxes, the encoding formats are shown in tables 4.11 and 4.12.

Table 4.11 Encoding Table (Category Header) of the Four-Bit by Four-Bit Block

Encoding

Category Type Category Separator Category Classification

Four-Bit by 00 1 Four-Bit Block Huang 93

Table 4.12 Encoding Table (Block Information) of the Four-Bit by Four-Bit Block

Encoding

Block Variation Data Stored Block Classification

Four-Bit by Four-Bit Block - 0 0/11 Homogeneous

Four-Bit by All bits in four-bit Four-Bit Block - 1 by four-bit block Heterogeneous

1 Choose 0 if the encoded four-bit by four-bit block is made of Os and/or Xs; choose 1 otherwise.

Like the one utilized by the original block, the category header of the miniature block syntax consists of the category type and the category separator. Although the value of the category type is same as the preceding one, the value of the category separator is one in this syntax; the difference in the value of the separator helps create the distinctive encoding sequence for representing the type of the category. While the header sequence will be saved once at the beginning of the encoding sequence, the information regarding the miniature blocks will be saved repeatedly as there are more than one four-bit by four- bit block is identified in a partitioned block. As there are two types of the blocks, homogeneous and heterogeneous, a special bit called block variation is employed to distinguish the block's type. When a miniature block is identified to be made of bits that can have same value, the block is categorized as homogeneous and is represented by the encoding sequence involving a zero-value bit, which is the block variation, and another bit, which is called data stored and has the value of any specified bit found in the Huang 94 miniature block. On the other hand, when the miniature block is made of a mixture of zeros and ones, or is heterogeneous, the corresponding encoding syntax includes the block variation bit with a value of one first, followed by all the original data from the miniature block. Such an approach for storing the data is similar to the one mentioned in the original block syntax.

4.3.4 All-Zero or All-One Block Encoding Syntax

Among the various encoding structures, the encoding syntax of all-zero or all-one block is the simplest and yields the least number of encoding bits, due to the unified content of the partitioned block; the syntaxes are shown in tables 4.13 and 4.14.

Table 4.13 Encoding Table (Category Header) of the All-Zero/All-One Block

Encoding

Category Type Category Classification

All-Zero/All-One 0 1 Block Huang 95

Table 4.14 Encoding Table (Block Information) of the All-Zero/All-One Block

Encoding

Data Stored Block Classification

All-Zero/All-One 0/11 Block

Choose 0 if the encoded block is made of Os and/or Xs; choose 1 otherwise.

Because there is no other category utilizing the same category type, which is 01, no category separator is required in the category header. In the body of the block information, only one bit, which depends on the value of any specified bit found in the partitioned block, is needed to distinguish the all-zero block from the all-one block. By combining the bits in both the category header and the block information, a total of three bits is generated to replace all the bits in the block; it should be mentioned that the total number of encoding bits stay constant regardless of the dimension of the partitioned block. As this category generates the least number of encoding bits, the performance of the compression method depends considerably on the frequency of this type of block; a high compression ratio is achieved if all-zero or all-one blocks occur frequently.

4.3.5 Primitive, Extended, and Imperfect Shapes Encoding Syntax

On the contrary, the encoding syntax of the shapes - primitive, extended, and imperfect shapes - has a more sophisticated structure because of the affluent information regarding the types, positions, and dimensions of shapes that are required to be stored. Huang 96

The structure involves two parts: the category header and shape information. Because a partitioned block can have a mixture of primitive shapes, shape extensions, and imperfect triangles, a common category header is devised and consists of two parts: category type and the number of shapes recognized. Table 4.15 shows the details about the header.

Table 4.15 Encoding Table (Category Header) of the Block Represented by Shapes

Encoding

Category Type Number of Shapes Category Classification

Primitive Shapes, Bits represent Shape Extensions, 1 0/11 maximum number Imperfect Triangles of shapes allowed

1 Choose 0 if encoded shape(s) are made of Os or Os and Xs; choose 1 otherwise. 2 Require smallest number of bits to represent the maximum number of allowable shapes in one partitioned block.

The information about the number of shapes recognized in a partitioned block is important because it plays a vital role in the encoding sequence by communicating to decompression algorithm, or the decoder, where the shape-related data that follows after the header ends in the encoding sequence. Without such information included in the header, the decoder does not know when to stop decoding shapes, since there are no empty spaces or special characters in between encoding bits in the bitstream format for indicating the end of decoding process for the partitioned block. Therefore, by including the number of shapes in the header, the proper decoding operations can be ensured because the decoder knows the exact length of the encoding sequence of the individual shape and the header; the decoding algorithm can stop decoding shapes by counting the Huang 97

number of shapes that have been decompressed for the partitioned block. After the

decompressing of the current block halts, the decoder can continue the decompression on

the next available partitioned block.

Although the shapes share similar attributes, such as the starting point or one or

two distances for representing the dimension of a shape, they still require distinctive

encoding sequences to represent their uniqueness. In the multi-syntax encoding scheme,

the shape extensions and the imperfect shapes are included in addition to the primitive

shapes; to accommodate all the shapes, an encoding structure that can categorize the

shared attributes and provide the differentiable values to the distinctive signature is

needed. The proposed encoding architecture in table 4.16. which lists the encoding

syntax of each shape, is employed by the encoding algorithm; in the table, the number

"0" or "1" means a bit with the value of 0 or the value of 1.

Table 4.16 Encoding Table (Shape Information) of the Block Represented by Shapes

^vEncoding Shape Shape Variation Distance Distance Separator Separator X-Coord. Y-Coord. Shape ^s. Separator 1 2 1 2 Classification^^

1 1 • 00 None None Required Required None None Point

2 1 1 1 \ 0 1 None Required Required Required Required None Line

CEB„ 2 1 1 3 4 L\ 0 1 None Required Required Required Required Required Line Extension Huang 98

1 0 None Required2 Required1 Required1 Required1 None Triangle

1 1 00 None Required1 Required1 Required1 Required1 Rectangle

CEB-,

1 1 0 1 None Required1 Required1 Required4 Required4 Rectangle Extension

£PB , 1 1

1 1 1 0 Required2 Required1 Required1 Required1 None Imperfect Triangle

CPB, 1 1 1 1 Required2 Required1 Required1 Required4 None Triangle Extension

Coord. = Coordinate CPB = Current Partitioned Block

1 To encode a coordinate or a distance requires the smallest number of bits to represent the block's size. 2 The number of required encoding bits is two to correspond to the four variations of the shape 3 The line extension's distance 1 is 0 to differentiate the encoding of a line extension from the encoding of a normal line exists only within the current partitioned block. 4 To encode distance requires one extra bit in addition to the smallest number of bits to represent the block's size.

Seven different pieces of information or attributes regarding the shapes are categorized in table 4.16. The first and second attributes, the shape separator 1 and 2, are employed to separate shapes' types. For example, while the combination of both separators of a point has the encoding sequence of 00, the combination's encoding sequence of the rectangle has a value of 1100 for differentiating itself from the point. The third attribute, the Huang 99 variation separator, is utilized when there is more than one variation of the shape employed by the area-covering algorithm. For example, because a line can be in one of the four forms, which are vertical, horizontal, and two slanted lines, the encoding structure of the shape requires that a variation separator be included to help identify which form of variation the shape is in; a similar reason applies to the line extension, triangle, imperfect triangle, and triangle extension. Table 4.17 lists all corresponding values of the variation separators that are required to represent different shapes' variations; therefore, to encode a vertical line, which is variation #1 of a line according to table 4.4, the corresponding variation separator of the encoding sequence will be 00.

Table 4.17 Encoding Table (Variation Separator) of the Variations of the Shapes (Line, Line Extension, Triangle, Imperfect Triangle, and Triangle Extension)

Variations Shapes ^^---^^^ Variation #1 Variation #2 Variation #3 Variation #4

Line, Line Extension, Triangle, Imperfect 00 01 1 0 1 1 Triangle, Triangle Extension

The fourth and fifth attributes, the x-coordinate and y-coordinate of a shape's starting point are employed to locate the corresponding shape's position; because the starting point is required in every shape to locate its position, the two attributes appear in the encoding sequence of every shape. The x- or y-coordinate requires a number of bits that is the same as the number of bits for representing the size of the current partitioned block; the size or the dimension of the block means the length of the side of the block. For example, if the partitioned block is 8-bit by 8-bit, the required number of bits to represent Huang 100 the size of the block will be three, and this means a coordinate will also require three bits to represent its value. The sixth and seventh attributes, the distance 1 and 2, represent the dimension of a shape. While a rectangle or rectangle extension requires both distances to record its width and length, other shapes require only the distance 1, except the point that requires neither.

An example is established to clarify the employment of the encoding syntaxes.

All attributes, except the shape separator 2 and the distance 2, are needed to encapsulate a line; the number of encoding bits required to represent the attributes of a line in an 8-bit by 8-bit block can be determined as follows:

Required number of encoding bits of a line

= (shape separator) + (variation separator) + (x-coordinate) + (y-coordinate) + (distance 1)

= (2)+ (2)+ (3)+ (3)+ (3)

= 13 (bits)

Therefore, if a five-bit long vertical line with its starting point at (0,1) in an 8-bit by 8-bit block is required to be stored, according to tables 4.4 and 4.16, the corresponding encoding sequence is:

(shape separator) (variation separator) (x-coordinate) (y-coordinate) (distance 1)

= 01 00 000 001 101 Huang 101

4.3.6 Overall Encoding Algorithm

Because the only main operation of the algorithm involves the translation of the information gathered in the area-covering algorithm, the encoding algorithm has the simplest structure compared to the previous two algorithms, the ideal vector sorting and amalgamated-shapes area-covering. After identifying the proper syntax category that the block belongs to, the algorithm refers to the corresponding syntax table and saves the proper encoding bits into a file. The matching category header is always saved once, followed by the encoding bits of the block or shape information; because each miniature block or shape requires its own encoding sequence, the repeating number of the transforming process of the block or shape is the same as the number of miniature blocks or shapes identified. The procedure, involving the category identification and the transformation of the corresponding encoding bits, is performed repeatedly until all the information regarding the partitioned blocks of the test set is translated and saved. A pseudo code of the overall algorithm is shown in figure 4.16. Huang 102

while (not finished with transforming encoding bits for all partitioned blocks) { if (the block is an all-zero or all-one block)

save corresponding category header according to table 4.13 save corresponding bits of block information according to table 4.14

else if (the block is parsed into four-bit by four-bit blocks).

save corresponding category header according to table 4.11 save corresponding bits of block information according to table 4.12

else if (the block is made of shapes)

save corresponding category header according to table 4.15 save corresponding bits of shape information according to tables 4.16 and 4.17

else

save corresponding category header according to table 4.9 save corresponding bits of block information according to table 4.10

move on to the next partitioned block

Figure 4.16 A Pseudo Code of the Overall Encoding Algorithm

Instead of being a standalone process, the encoding algorithm can also be a part of

the area-covering algorithm. In figure 4.14, the encoding procedure can be positioned

after the appropriate attributes are determined and before the attributes are saved. If the

encoding algorithm becomes a part of the area-covering process, because the determined

attributes are transformed directly into encoding bits and saved, the operation of saving

the attributes is waived which results in the decrement of the overall compression time.

Due to such an advantage, the hybrid algorithm that combines both the amalgamated-

shapes area-covering and the multi-syntax encoding algorithms is written and employed to generate the experimental results. Huang 103

4.4 Multi-Syntax Decoding Algorithm

Restoring shapes and blocks into their original forms according to the encoded sequence and the corresponding multiple syntax architectures is the frame of the multi- syntax decoding algorithm; because it is developed based on the area-covering and encoding algorithms, the algorithm's overall structure and distinctive features are discussed for the purpose of revealing the impacts of the compression structure on the decompression algorithm. Based on the assumption that the decoding algorithm is executed by a processor core or similar circuitry on board the chip, and the incoming encoded sequence is in the bitstream format, the decoding process analyzes the first few bits of the incoming encoded sequence for identifying the category type that the current partitioned block belongs to. After it identifies the category type, the algorithm restores the original test data according to the matching syntax architecture and the finite encoded sequence. Once it finishes with generating the original data for the current block, the algorithm will advance to the next available segment of the encoding sequence and repeat the processes of recognizing the related block's syntax category and restoring the corresponding data. Because the decompression algorithm knows the total number of blocks that need to be decompressed by deriving the quantity from the number of pins and cubes, the algorithm stops the recurring operations when the whole test set is decompressed. The pseudo code with a more detailed description about the decoding algorithm is displayed in figure 4.17. Huang 104

calculate parameters; set processedblock to zero; while (processed_block < totaljpartitioned_block) { read category_type; if (categorytype = original or real data block) { fill current block with the next pxp encoded bits } else if (categorytype = fourbit by fourbit block) { for (i=0; i

Figure 4.17 A Pseudo Code of the Overall Decoding Algorithm Huang 105

In the figure, the parameters include the number of partitioned blocks, the number of four-bit by four-bit blocks, and the dimensions of the partial partitioned blocks.

There are four observations or considerations regarding the decoding algorithm.

The first observation is that because each syntax architecture has its own encoding scheme, decoding operations involved can range from constantly receiving encoding bits to not receiving any additional incoming bits; as a result, the dependence on transferring encoding bits from the test equipment to the chip and the related off-chip transfer time can vary from block to block. For example, the original or real data syntax is reading- intensive because it requires the decoding algorithm to read the next pxp encoded bits, where p is the dimension of the partitioned block; on the other hand, the shapes, four-bit by four-bit blocks, and the all-zero or -one blocks require a lessened degree of depending upon the incoming compressed bits. In fact, once the block's category type is identified to be the all-zero or -one block, the decoding algorithm does not rely further on the information offered by the next available incoming bits.

The variant effort of decompressing the encoded bits in syntax categories is the second observation. While the original or real data and all-zero or -one block only require the block dimensions, the other categories will need to calculate specific coordination for relocating the original data. Such an observation is also applied to the former decoding method.

The third observation about the decoding algorithm is that its code is simpler than the area-covering and the encoding algorithms combined. Therefore, the decoding time is certain to be shorter than the compression time. This observation is important because Huang 106 the decoding time, which is part of the overall testing time, can affect the time-to-market

(TTM)oftheCUT.

The last observation or consideration is made based on the possible hardware associated with the amount of decoded test data; because the algorithm decodes a set of p vectors at a time, some kind of memory storage is required to temporally keep the decompressed test data. It is suggested that any unused scan chains or memory can be employed to store the data so that the no overhead in the hardware is required. To decompress and manage data in an efficient manner, pipeline- and parallelism-like operations, which have been performed in constructing the microprocessor architecture, are recommended for achieving a fine decoding speed.

4.5 Verification Processes

Two verification processes, the sorted test data verification and the decompressed test data verification, are required and designed to ensure the precision of the test data at different stages of the compression and decompression algorithms. By combining the efforts of both processes, the decompressed test set is compared with the original test set; by certifying the accuracy of the decompressed data, the percentage of the fault coverage of the test set is preserved. The relationships among the verification processes, the algorithms, and the decompression method are illustrated in figure 4.18; the slanted shapes in the figure are the test data in different formats before and after the algorithms. Huang 107

Ideal Vector Original Test Sorting Sorted Test Data Algorithm Cubes

Area-Covering • A- Algorithm Sorted Test Data Decompressed Test Verification Data Verification Encoding Algorithm

x2 Decompressed Decompression Compressed Test Data Algorithm Test Data

Figure 4.18 Relationships Between Verification Procedures and Compression and Decompression Algorithms

In order to achieve the data validations, both verification processes involve the operation of comparing the target data, which can be the sorted test cubes or the decompressed test data, against the original test set and the sorted test data.

4.5.1 Sorted Test Data Verification

With the intention of validating the sorted test cubes, the sorted test data verification process receives the original test set and the sorted test set, and performs two main operations, the ascending sort and the comparison between the two sets of data.

After the acquisitions of the two sets, the process sorts both sets by employing the ascending sort algorithm, which repositions test cubes in the lexicographic order. For Huang 108 example, the test cube, 101x11, is placed before the cube, xOOxl 1, because the bit with 1 at the beginning of the first cube precedes the bit with x at the matching position, disregarding the rest of the bits that follow; in other words, the bits to the left are more significant than the ones to the right of the cube. The purpose of performing the ascending sort on both sets is to have the corresponding cubes at the same positions in both sorted sets; such a rearrangement allows the following operation, comparing cubes, to perform properly. Comparing cubes involves the repetitions of the character-wise or bit-wise comparison of the matching positions in the cubes of both sets. If a bit from the resorted test set does not match the bit at the corresponding position in the sorted original test set, the process will halt and produce an error message on the screen of the computer; if the contents of both sets are exactly matched, the process will stop and notify the user about the completion of the process. The pseudo code of the process is illustrated in figure 4.19.

perform the ascending sort on the original test set perform the ascending sort on the sorted test set while (not finished matching all the bits from both test sets) { if (the bit of resorted set does not match the bit of original set) { print error message on the screen break } move on to the next pair of bits from the test sets } print the completion message on the screen

Figure 4.19 A Pseudo Code of the Sorted Test Data Verification Huang 109

4.5.2 Decompressed Test Data Verification

The second verification process, the decompressed test data verification, executes the bit-wise comparison on the test cubes, which is the same as the later part of the first process. However, no ascending sort process is performed in this second process because the order of the cubes of the decompressed set is the same as the ones of the sorted test set. Although the process has a simple structure, due to the fact that bits of the decompressed set always have specified values, either zero or one, while the sorted test set has a mixture of specified values and don't cares, the procedure of the bit-wise comparison should be able to acknowledge the situations involving the don't cares. For example, a bit with the value of one from the decompressed set is an approved match for the don't care in the corresponding position in the sorted test set. Figure 4.20 is the pseudo code of the process.

while (not finished matching all the bits from both test sets) { if (the bit of decompressed set does not match any one of possible values of the bit of sorted set) { print error message on the screen; stop; } move on to the next pair of bits from the test sets; } print the completion message on the screen;

Figure 4.20 A Pseudo Code of the Decompressed Test Data Verification

As the verification processes are isolated from the compression and decompression methods, the results of the verifications will not be altered by the methods Huang 110 in any way. In addition, due to the simplicity of the processes, the error of each process is minimal. Therefore, in the overall testing procedure, the processes are the important element that can validate test sets and in turn support the claimed fault coverage of the decompressed test set.

4.6 Advantages and Disadvantages of the Shape-Oriented Compression Method

The proposed method has its advantages, such as the improved, two-dimensional compression, and constant decoder size, over the former and other compression methods.

Although the method is efficient in compressing test sets, it is burdened with some of the former method's disadvantages mentioned in section 3.4, such as the limited performance due to the specified bits. Nevertheless, the effect of two disadvantages is lessened because of the additional figures introduced in the enhanced method. Once its pros and cons are identified, the proposed method's characteristics can be realized more clearly.

4.6.1 Advantages

There are four advantages to the proposed compression method. Compared to the former and other compression methods, the proposed compression method is more efficient in compressing test data two-dimensionally and is the first advantage of the method. By employing additional figures - shape extensions, imperfect triangles, and four-bit by four-bit blocks - to compress test cubes, the proposed method can encapsulate Huang 111 a large number of bits that are in unappealing formations with a smaller number of bits compared to that required by the former method. Consequently, the employment of additional shapes lessens the burden of encoding shapes because in the proposed method, there exists a possibility of combining two shapes into one; the former method presents no such possibility. The combination takes place when the two or more shapes belong to one of the extended shape, or the bits are recognized in one of the additional imperfect shapes' formations. As a result, the compression ratio of the proposed method can be higher than that of the former method; such a statement is proven in test results shown in the next chapter.

The second advantage is that the sorting algorithm of the proposed method is

shape-oriented, which means the algorithm attempts to produce better-formed shapes, compared to the previous sorting scheme. By incorporating the shape-oriented sorting algorithm in the compression, the proposed method can produce high compression ratios based on the better-formed shapes. In addition, the disadvantage of the former compression method - disability of sorting test cubes according to defined shapes - is

eliminated.

The third advantage that both the proposed and the former method share is the constant size of the decompression architecture with respect to the amount of the test data. In the Huffman-related compression method - statistical code selection [17], the

Huffman tree is believed to be implemented in hardware under the name of the decoder;

as the size of the test data increases, the dimension of the corresponding Huffman tree increases as well; such an increase in the size of the tree unavoidably requires the

structure of the corresponding decoder to be augmented in a certain proportion. On the Huang 112 other hand, the dimension of the proposed decompression architecture remains constant regardless of the test data. This advantage is considered to be significant because minimizing the overhead of the test-related circuitry is an important issue of the overall testing strategy.

As in other non-fault-oriented compression schemes, the last advantage is that the proposed compression method does not need any knowledge of the architecture of the core-under-test to compress the data. Therefore, the core suppliers of a system-on-a-chip

(SoC) are not required to provide the designs of the architectures, and this reduces the transfer time of and the required memory of the design information.

4.6.2 Disadvantages

Instead of all disadvantages mentioned in the early section, the enhanced method has inherited fewer drawbacks from the former compression method; the limitation of the deployment of the sorting algorithm, the constrained performance due to the compression of fully specified test sets, and the significant amount of bits for representing shapes are the disadvantages of the enhanced method, although the impact of the drawbacks is lessened in the situation where a fully specified test set can be represented by a small number of desirable shapes. As mentioned in the earlier sections, because the sorting algorithm is disabled when the order of the test cubes cannot be altered, the performance of the compression method may suffer. In order to recover the original order of the cubes, it is discovered that additional bits are usually required to memorize or represent the original sequence in some style. As a result, if a certain number of bits is allowed, the Huang 113 effect of such a disadvantage can be lessened or removed, although in such a case the compression ratio decreases. A creditable, practised example of requiring additional encoding bits for recovering the original order is the Burrows-Wheeler Transformation method, which requires additional bits to store the information - the index of the original sequence in the sorted matrix - to recover the original order of the encoding bits.

The second disadvantage, the constrained performance due to the compression of fully specified test sets, always appears as long as the concept of representing two- dimensional shapes with a restricted amount of bits is the main theme of the compression method. Because a shape involves a controlled formation of bits in two dimensions, the performance of the shape based compression approach can be limited due to the absence of don't cares at the proper locations in the test set. However, it is believed that the constrained performance may occur less often in the enhanced method due to the introduction of the miniature blocks, which do not have the demanding formation required by the shapes.

The last disadvantage, the significant number of bits needed for representing shapes, is confronted and solved partially due to the additional figures, although the drawback still persists as a burden to the overall encoding of bits. Such a disadvantage is discovered to be always present in the shape based method, including both the former and the proposed method, as long as the various attributes, such as the location and type, of a shape are required to be transformed as a part of the encoding sequence. Fortunately, the last drawback and the previous disadvantages do not significantly decrement the performance of the proposed method. Huang 114

CHAPTER 5 EXPERIMENTAL RESULTS

The experimental approach and assumptions regarding compression methods are described first to establish the experimental conditions. Following the descriptions, the apparatus that carries out the experiment is detailed. Two types of experimental data have been gathered: the comparisons among the performance of the compression methods, and miscellaneous experimental information of the former and proposed methods based on the compression results. While the former demonstrates how well the proposed can perform compared to other contemporary compression methods, the latter helps elucidate the behaviour of the proposed method.

5.1 Experimental Approach and Assumptions

The experimental approach is to evaluate the performance of the proposed method by comparing the compression ratios that are generated by the proposed, former, and other common compression methods based on the same test sets. The test sets employed in the experiment have the characteristic mentioned in [1, 8, 14], in which different sets of pins take turns to receive their constant test values while other pins have varying test data for different periods of time; because of the permanent values, the test cubes look

similar to each other. Such a feature exists in the test data for a less-complex circuitry

[14] because of the structural relationships among the pins. In addition, the behaviour appears in the test set for a large complex circuit, such as a system-on-a-chip (SoC), because only the pins connected to the one or few modules that are currently under test Huang 115 are fed with varied data, while other pins corresponding to the inactivated modules are fed with constant values.

Although sometimes the real test data is utilized to obtain the experimental results, due to the difficulty of acquisition of and the unknown nature of such data, the randomly generated data that is always available and also has an unknown composition is employed in the experiments; the phrase "unknown composition" means that the specified bits and don't cares are randomly placed in the test data. There are several advantages - availability, impartial nature, and controllability - of employing random data compared to the utilization of real test sets. Unlike the release of the real test data which depends on its confidentiality and its owner's availability, the first advantage - availability of the random generated data - is convenient and useful in the research; this is because the stable, ample supply of the random data ensures the rate of the research progress. The second advantage - the impartial characteristic of the data - exists due to the random positions of both specified and unspecified bits. No matter how the data is generated, the randomness of the positions of the data is produced regardless of compression methods. Therefore, the random test sets ensure that no methods benefit from the generated test data in any aspect. On the other hand, the real data might be chosen to benefit one compression method over other methods. The last advantage is that the composition of the test data can be generated in a controlled manner if such an advantage plays a significant role in the research. For example, in order to understand how various percentages of specified bits present in a test set can affect the performance of a compression method, random test sets with predetermined percentages can be specifically generated. Although the data that will be generated for experiments are Huang 116

smaller than the real data for testing complex circuits, because a large test set can be partitioned into groups of smaller sets, the results obtained from compressing small sets of random data are still considered to be useful.

To understand their performance, Huffman coding, run-length coding, a combination of the run-length coding and the Burrows-Wheeler (BW) Transformation, modified combination of the run-length coding and the BW Transformation, the former compression method, and the proposed method are utilized to produce compression ratios based on the same data; the features of the methods are shown in table 5.1.

Table 5.1 Descriptions about the Compression Methods Employed in the Experiment

Dimensions of Blocks or Compression Methods Features Sequences

compress data row by row; Huffman Coding 6-, 8-, and 10-bit sequences consider all possible combinations of a segment

compress data column by column; Run-Length Coding 32-, 64-, and 128-bit sequences assign specified values based on the runs of the segment

compress data column by column; Run-Length Coding + Burrows- 32-, 64-, and 128-bit sequences assign specified values based on Wheeler Transformation the runs of the segment

compress data column by column; Modified Run-Length Coding + assign specified values based on Burrows-Wheeler 32-, 64-, and 128-bit sequences the runs of the segment; store Transformation original sequence

compress data block by block; Former or Primitive Shape assign specified values for the 8x8, 16x16, and 32x32 blocks Compression don't cares according to the compression method

compress data block by block; Proposed or Shape-Oriented assign specified values for the 8x8, 16x16, and 32x32 blocks Compression don't cares according to the compression method

NOTE: unit of the dimension of the block or partitioned block is bit. Huang 117

In the table, the various sizes of the employed sequence or block utilized by and the features of each compression method are listed to clarify the method's functionality.

While the former and proposed compression methods utilize blocks to compress data two-dimensionally, the Huffman coding compresses test sets row- or cube-wise according to the conventional compression approach, and other methods compress column- or pin-wise, as such a compression style is considered to be efficient [1] due to the strong relationship that is commonly found among the bits in the same column, rather than in the same row or test cube of a test set. In order to achieve fair comparisons among the compression methods, modifications that assist the methods, except the former and the proposed, in assigning appropriate values to the don't cares are made to the contemporary compression methods. The modifications are necessary because the shape- based methods take the advantage of assigning proper values to don't cares and consider two - zero and one - rather than three - zero, one, and don't care - logic values to achieve high compression ratios, while other methods do not have such an advantage since they are designed to have such a strategy in their schemes. The benefit of the modifications can be elucidated further according to the following example of the run- length coding. If the run-length coding is exercised to compress the segment 11X100XX the original style of the coding method requires it to store more runs than the modified method, because the don't cares in the segment are not replaced with either zero or one.

The discrepancies in compression results of both the original and modified methods are shown in detail in table 5.2; the modifications of other compression methods that incorporate the run-length coding can also be explained according to the example. Huang 118

Table 5.2 An Example That Shows the Differences between the Original and Modified Run-Length Coding Methods

Assumption: Each run requires three bits to encode its length Run-Length Coding Allowed Logic Values Runs Total Encoding Bits

Prior to the run's length, two bits are required to represent 5 runs (fom left to right): Original 5x2 + 5x3 = 25 the run's value, which can 11, X, 1,00, and XX be 0, l,orX

Prior to the run's length, one 2 runs (from left to right): bit is required to represent 11X1, and 00XX (can be Modified 2x1 + 2x3 = 8 the run's value, which can considered as 1111 and be 0 or 1 0000)

The modification made to the Huffman coding is to find all possible combinations of the segments being scanned to achieve a higher compression ratio. Due to the update in [22], modifications, including distance and number of shapes, are made to the former method.

The counterparts of all contemporary compression methods, the decompression methods, are also adjusted accordingly and accept the altered data formats. In addition, the decompression methods and the verification processes are utilized in the experiment to ensure the precision of the decompressed test data.

All the mentioned methods - the various compression methods, the matching decompression methods, and verification processes - are written in C computer language, and at the end of the research, the estimation of the total lines of all written algorithms is within the proximity of eight thousand lines. The size of the executable file of each proposed algorithm is approximately 350KB, and mainly consists of the C library information provided by the Visual C++ 6.0. To perform the compression, decompression, or verification on test data, which is in the text format, all methods require the information regarding the number of pins and cubes of the data to determine Huang 119 the end of test data. The compression and decompression methods need the information on the size of the associated sequence or block to perform the instructed operations.

5.2 Experimental Equipment

The experimental equipment, which comprises both uncomplicated hardware and software, is utilized to assess the performance of the compression methods. An IBM

Aptiva E85 PC computer, which consists of an AMD 300MHz CPU, a 64 MB RAM, and a 6GB hard drive, is the only hardware employed during the experiment. In addition to the hardware, the operating system - Windows 98 - and the Microsoft Visual C++ 6.0 program, are the software involved in the experiment; the compiler of the Visual C++ 6.0 is utilized to compile the C codes of all the mentioned compression methods.

5.3 Cost of Test Set Compression

Because the test data compression includes only the employment of test data and the execution of the written software, the cost of the test set compression is solely based on the mentioned experimental equipment, which is considered to be economical compared to expensive testing equipment. In addition, because of the simple codes of the compression algorithms, not only the experimental equipment, but also any other computer with C or C++ compiler can perform the proposed algorithms; therefore, there is no need for state-of-art equipment for executing the compression algorithms, and this means that the cost of executing the compression methods is minimal. Huang 120

5.4 Experimental Results

By following the course of the research approach, test sets and the compressed test data of the compression methods are gathered in the experiment. In order to establish limits to the dimensions of the test sets, both numbers of pins and cubes of a test set are in a range of 30 and 200. A total of 35 test sets, named al, a2, ..., a35, are generated in the experiment and the characteristics of each test set - number of pins, number of cubes, the percentages of the three logic values (zero, one, and X) - are displayed in appendix A. In the next two sections, the performance of the compression methods on the generated test sets and miscellaneous information of the former and proposed methods are evaluated for the purpose of discovering the behaviour of the proposed method.

5.4.1 Comparisons Among the Compression Methods

In addition to the information regarding the test sets, the corresponding details of the compression ratios and times of each compression method are gathered and displayed in appendix A. All the sorted and decompressed test data are verified. To calculate a compression ratio, a formula [14] is employed and shown below:

Compression ratio (in %)

= (original bits - compressed bits)/(original bits)xl00 (5.1)

To understand the performance of the compression methods, the highest and the average compression ratios of each method on each test set are displayed in tables 5.3 and 5.4; the highest compression ratios among the methods are identified by shaded backgrounds. Huang 121

Table 5.3 Highest Compression Ratios of the Compression Methods

Compression Ratio (in %)

Test Bits in Modified RLC + Set Test Set HC RLC RLC + FPS PSO BWT BWT

al 1254 9.73 3S.28 15.87 21.85 34.85 34.61 a2 1702 78.61 87.31 77.26 75.09 91.42 •' 93.77 a3 1890 27.78 8.57 0.00 3.28 31.22 36.03 a4 2800 20.50 9.57 0.00 24.50 34.11 4K.- ^ a5 2805 41.39 61.57 53.19 52.30 53.69 69.98 a6 3102 65.15 81.95 74.31 72.86 82.21 84.30 a7 3315 81.66 91.07 77.62 75.08 92.61 93.88 a8 4890 61.72 67.65 61.62 60.63 69.04 76.0-7 a9 5159 78.99 87.13 80.81 79.61 91.35 91.47 alO 5200 41.54 37.23 23.54 32.90 41.38 53.1 all 5346 65.64 66.35 51.95 50.32 73.16 73.61 al2 5699 72.82 82.59 73.17 72.61 84.65 85.31 al3 5888 50.08 62.50 54.38 51.70 63.47 63.84 al4 6020 42.87 43.49 24.90 26.94 47.13 51.03 al5 6248 86.36 92.57 85.66 84.25 94.91 96.29 al6 7425 46.33 62.95 56.43 55.53 63.84 72.20 al7 7920 45.74 62.53 55.20 54.14 62.71 68.21 al8 8118 80.85 89.06 85.69 84.68 91.11 92.37 al9 8216 74.49 81.99 74.18 72.31 86.17 X6.44 a20 8400 51.64 66.75 57.92 56.69 67.71 73.18 a21 9150 78.64 85.66 75.86 74.04 89.02 ' 89.02 a22 9234 57.54 72.48 65.69 64.11 73.01 ' 73.f a23 9801 52.27 70.36 66.13 65.43 70.95 73.36 a24 10044 56.94 77.00 70.71 68.95 77.02 77.36 a25 10336 19.46 0.00 0.00 26.59 30.05 38.74 a26 14200 46.92 55.93 49.76 55.18 65.82 69.86 a27 18584 76.87 87.95 83.52 82.46 91.21 92.46 a28 18795 63.94 76.42 71.04 71.02 79.67 83.56 a29 20520 41.82 28.95 17.83 35.39 43.07 48.C a30 22875 21.53 47.83 41.52 50.53 51.01 58.34 a31 27974 30.56 59.39 52.48 54.04 58.52 65.96 a32 28917 39.02 61.95 56.84 63.23 64.23 69.52 a33 29412 64.15 72.91 66.98 66.73 78.52 80.-79 a34 30336 74.34 86.74 82.36 81.33 89.81 90.80 a35 37600 56.32 75.06 70.36 69.22 75.95 78.61 Huang 122

Table 5.4 Average Compression Ratios of the Compression Methods

Compression Ratio (in %)

Bits in Modified Test Set RLC + Test Set HC RLC RLC + FPS PSO BWT BWT

al 1254 3.85 29.19 9.41 19.06 25.73 , 29.88 a2 1702 77.40 83.74 72.42 69.53 90.36 92.54 a3 1890 16.10 2.86 0.00 2.08 22.43 29.52 a4 2800 19.80 3.77 0.00 16.08 28.79 44.88 a5 2805 30.72 60.29 51.29 50.09 52.28 68.13 a6 3102 64.22 79.67 66.63 68.26 80.80 82.15 a7 3315 80.14 86.09 71.69 68.31 91.69 92.7S a8 4890 54.01 66.71 59.20 58.36 67.76 74.44 a9 5159 78.02 82.84 73.82 71.38 89.22 89.45 alO 5200 4.35 31.91 21.96 28.69 39.97 51.07 all 5346 64.07 65.23 45.10 47.51 71.60 72.91 al2 5699 71.79 79.41 70.23 68.51 83.52 84.33 al3 5888 46.79 60.84 47.25 45.09 P^73 62.37 al4 6020 38.43 37.33 19.02 24.28 43.02 47.43 al5 6248 84.00 87.37 77.25 74.43 94.64 95.00 al6 7425 44.17 62.16 53.25 53.67 63.11 69.S5 al7 7920 43.69 61.42 53.55 52.12 61.86 6(>.61 al8 8118 78.85 84.86 78.35 77.00 90.23 91.45 al9 8216 73.38 79.43 70.09 67.59 84.33 85.55 a20 8400 48.12 65.57 54.92 53.71 66.48 71.35 a21 9150 77.73 81.31 71.24 68.93 87.23 S7.(»7 a22 9234 54.58 70.95 62.30 60.27 70.93 73.29 a23 9801 48.01 69.29 63.85 63.07 69.06 72.76 a24 10044 53.13 75.56 66.97 64.71 75.93 76.4H a25 10336 14.35 0.00 0.00 19.23 25.48 ?7.40 a26 14200 45.36 55.15 48.69 53.23 65.09 •69.21 a27 18584 75.61 83.55 79.23 77.27 89.28 90.65 a28 18795 63.77 74.38 68.65 67.49 77.77 X0.»S a29 20520 39.18 22.35 13.79 30.83 41.69 48.05 a30 22875 14.76 46.35 40.23 46.97 48.44 54.77 ' a31 27974 28.23 57.92 50.45 52.74 55.30 63 a32 28917 36.10 60.71 54.93 58.97 61.83 67."" a33 29412 63.28 71.17 64.47 63.58 76.80 79.35 a34 30336 73.33 82.81 78.55 76.68 88.13 88.98 a35 37600 55.13 73.49 68.39 66.87 75.01 77.f~ Huang 123

Abbreviations of the methods employed by tables 5.3, 5.4, and the rest of tables are shown below:

HC = Huffman Coding RLC = Run-Length Coding BWT = Burrows-Wheeler Transformation FPS = Former Primitive Shape Compression PSO = Proposed Shape-Oriented Compression

In table 5.3, the highest ratios of each method are determined by comparing the ratios, collected in appendix A, of the three corresponding dimensions of the sequences or blocks. The best performance that each method can achieve on each test set can be found in the table. For the ease of comparing the average performance of each method, the average ratios are taken from the corresponding tables in appendix A and put side by side in table 5.4.

From the information in tables 5.3 and 5.4, several observations are concluded.

First, compared to the rest of compression methods, the proposed method always has the highest compression ratios for all the test sets, except the first test set in table 5.3 and the thirteenth test set in table 5.4. The reason that low compression ratios are produced by the proposed method in both sets is that the proposed method is burdened by the category headers, which require a higher number of bits than that of other compression methods.

The compression ratios of the proposed method on the other sets are higher than the rest of methods due to the ideal sorting and the extensive usage of the additional shapes; the distribution of the shapes and the relationship between the shape and the proposed method will be discussed later. In table 5.5, a summary shows the overall averages of the compression ratios from tables A4, A7, A10, A13, A16, and A19 in appendix A, and differences between the overall ratios' averages of the proposed and other methods. Huang 124

Table 5.5 Summaries of the Averages of the Compression Ratios and the Differences Between the Proposed and the Rest of Compression Methods' Compression Ratios

Average Compression Ratio (in %)

Modified RLC + HC RLC RLC + FPS PSO BWT BWT

Average 50.90 63.68 56.49 58.24 68.35 72.38 Difference in Avg. 21.48 8.70 15.88 14.13 4.03 0.00 with PSO

According to table 5.5, on average, the proposed shape-oriented method also performs better than other methods with distinctive margins.

The second observation is that a high compression ratio is usually produced by the compression methods if there is a high percentage of don't cares in the test data. For example, for test sets a2, a7, al2, al8, and a34, which have 80% and above of don't cares in the test data, the corresponding highest compression ratios are over 72%. Due to the fact that a part of the theme of the compression methods is to compress redundant data in an efficient fashion, the don't cares allow the proposed, former, and other modified compression methods to decide the required values of the don't cares, which can be zero or one, for increasing the frequencies of the desired sequences or blocks; the increase in the desired sequences or blocks helps the methods increase compression ratios.

The third observation is that when the percentage of don't cares in a test set is high, the ratios of the compression methods can sometimes be similar to one another. For example, in the mentioned five test sets, a2, a7, al2, al8, and a34, the performances of the methods - run-length coding, former primitive shape compression, and proposed shape-oriented compression - are similar to one another, although the proposed method still has the highest ratios among the three mentioned methods. This similarity in Huang 125 compression can be explained by the saturation of the don't cares, which can cause the sorting methods of the proposed and the former methods to have a weak impact on compression because the sorting requires specified bits to determine the optimal order of the test cubes and to assist in producing high ratios. Such a small influence on the cube or vector sorting hinders the growth of the ratios.

The last observation is that no single size of sequence or block is considered to be the best option. In addition, for acquiring the highest compression ratio, no definite trend of increasing or decreasing the size of the sequence or block is observed. For example, based on the ratios in table A17 in the appendix A, the proposed method performs well when the dimension of partitioned blocks is established at 8-bit by 8-bit (or 8x8 in the table) in 6 out of 35 test sets. Under either the dimension of 16-bit by 16-bit (or 16x16 in the table) or the dimension of 32-bit by 32-bit (or 32x32 in the table), the method has high ratios in 15 out of 35 test sets. While fifteen test sets have high ratios when size is established at 32-bit by 32-bit, indicating that the proposed method should follow the trend of increasing the size of the block to obtain higher ratios than the ones generated under the dimension of 32-bit by 32-bit. Therefore, two conclusions can be drawn from the last observation. The first one is that for the proposed method, the partitioned block's dimensions of 16-bit by 16-bit and 32-bit by 32-bit perform better than the dimension of

8x8; it is noticed that such a conclusion is true when a test set has a dimension close to the pin's average and the cube's average. As for other compression methods, there should also exist one or at most two dimensions of sequence or blocks that can ensure the optimum performance of the method. The second deduction is that the compression ratio of any method depends on the content of the test set considerably; in the case of the Huang 126 proposed method, increasing the block size can acquire higher ratios in 15 out of 35 test sets, while the other test sets have lower ratios if such an increment does occur; therefore, there is no definite trend of increasing or decreasing dimension for achieving high compression ratios.

To investigate the performance of the proposed method from another angle, the following equation is employed to determine the ratio of reduction by comparing the amount of encoding bits of the proposed method with the bits of other methods.

Reduction ratio (in %)

= (bits required by the other method - bits required by proposed method)/ (bits required by the other method) x 100 (5.2)

The equation is essentially the same as the one for calculating the compression ratio in

(5.1) except rather than the original bits, the proposed method's bits compares with other methods' bits. By obtaining reduction ratios, one can learn the percentage of the number of bits reduced when other methods that are already in use are replaced with the proposed method. The reduction ratios based on the overall average of the least number of encoding bits and the overall average of encoding bits of the methods are shown in table

5.6.

Table 5.6 Reduction Ratios Based on the Compression Methods

Reduction Ratio of Encoding Bits (in %) Types of Modified Bits RLC + HC RLC RLC + FPS Compared BWT BWT

Least Bits 44.16 23.53 40.40 38.90 12.44 Avg. Bits 44.41 25.92 41.89 40.85 12.14 Huang 127

The application of table 5.6 can be considered as follows: if the total time required for transferring a group of test data compressed by the modified Huffman coding from an automatic test equipment (ATE) to various circuits under tests (CUTs) is a day, according to the average in the table, the time for transferring the proposed method's bits is (1 -

44.41%) of a day, which is equivalent to 13.34 hours; as a result, the reduction in the transferring time is significant. Similar calculations can also be performed on other reduction ratios.

The compression time of each compression method is collected and shown in tables A20-A25 of the appendix A; according to the gathered information, the average compression time of the proposed method is around three to four times longer than the former and the combinations of the run-length and Burrows-Wheeler Transformation.

The increase in the compression time is allowed because test sets can be compressed prior to the testing procedure, which means the compression time does not affect the overall download or test time [8]. Another phenomenon is observed regarding the increase of the time required by the compression methods; for most of the test sets, the methods require more time to compress test sets when the corresponding dimension of the sequence or block increases. By compressing more bits at a time, the possible combinations of sequences or shapes grow exponentially because the combinations will be considered and compared with the methods for discovering the best compression ratio.

Further analysis on the compression time of the methods is included in the appendix A.

Because the detected decompression time of the methods is often zero or close to zero milliseconds, meaning that the time is shorter than a millisecond and is not detectable by the computer, the decompression time is not displayed in the appendix. Huang 128

This is because the decompression methods do not have the repetitive processes that the compression methods have for the purpose of searching for the best option for compressing the test data; the only straightforward operations that the decompression methods have to perform are decoding the compressed bits according to the encoding syntax employed by the corresponding compression schemes.

5.4.2 Miscellaneous Experimental Information

Three types of relationships are under investigation: the ratios of the number of pins to the number of cubes versus the proposed method's compression ratios, the percentage of each logic value, which can be zero, one, or don't care, versus the proposed method's compression ratios, and the shapes' distributions of the former method versus the shapes' distributions of the proposed method. While the first two relationships demonstrate the behaviour and the application of the proposed method, the last relationship provides the comparison between the former and the proposed methods for the purpose of displaying the evolvement of the proposed method. It is believed that by investigating the relationships, together with the comparisons of the compression ratios done in the previous section, the characteristics of the proposed method - shape-oriented test set compression - can be understood completely.

Because the pins-to-cubes ratio may have a certain impact on the compression ratio, the magnitude of their relationship is examined. In theory, either the proposed or the former method should achieve higher compression ratios on a test set with the number of pins lower than the number of cubes, than a test set with the number of pins higher than the number of cubes. The reason is that if the number of pins is lower than the Huang 129 number of cubes, the sorting algorithm can have more alternatives of changing the order of the cubes for the purpose of assisting the compression methods in obtaining a high compression ratio. However, if a test set has more pins than cubes, the sorting method provides less influence and hence a low compression ratio may be produced. Figure 5.1 shows the relationship, which is gathered from the experimental results, on a logarithmic scale.

Relationship Between Pins-to-Cubes Ratio and Compression Ratio

100 - • 90 - * V • • *

* • • 4 80 - < • • • • • Pi 70 - a • • o 60 - • a. 50 - E • • © U 40 - • M • & la 30 - > < 20 -

10 -

0 - 0.10 1.00 10.00 Pins-to-Cubes Ratio

Figure 5.1 The Relationship Among Pins, Cubes, and Compression Ratio

The figure employs the pins-to-cubes ratios from Al, and the corresponding compression ratios from A17 in appendix A. While the points on the left half of the figure are the test sets with the number of pins greater than the number of cubes, the points on the right half are the test sets with the number of pins less than the number of cubes. The points in the Huang 130 figure locate evenly on both sides of the centre vertical axis, indicating that the pins-to- cubes ratio has an insignificant impact on the compression ratio.

The second relationship, the correlation between the percentages of the logic values in the test sets and the related compression ratios, is investigated to clarify how the amount of logic values can influence the compression ratios. The presumption is that the high percentage of specified bits, the zeros and ones, in a test set can decrease the compression ratios; such a preliminary deduction is also mentioned in [14]. Based on the percentages of the zeros, ones, and don't cares in the test sets in table Al, and the corresponding compression ratios in table A17 in appendix A, figures 5.2, 5.3, and 5.4 are constructed for verifying the presumption made.

Relationship Between Percentage of Number of Zeros in Test Set and Compression Ratio

100

90 • 2 80 K ea * 70 s • • 1 60 • 1 50 • 3 40 • OX)

2 30

< 20

10

0 0.00 10.00 20.00 30.00 40.00 50.00 60.00 70.00 80.00 90.00 100.00 Percentage of Number of Zeros in Test Set

Figure 5.2 Correlation Between Percentages of Zeros and Compression Ratios Huang 131

Relationship Between Percentage of Number of Ones in Test Set and Compression Ratio

100 90 r ^

CS 80 : • • • 70 • • 60 • • • a. 50 E o • U 40 • • • • DD 30 CS S- • 20 >OI < 10 0 0.00 20.00 40.00 60.00 80.00 100.00 Percentage of Number of Ones in Test Set

Figure 5.3 Correlation Between Percentages of Ones and Compression Ratios

Relationship Between Percentage of Number of Don't Cares and Compression Ratio

100

90 A_ • • . • 1 80 Pi • • c 70 • • o • • + 8 60 01 • I 50 • • • rj 40 • 30 Iu > 20

10

0 0.00 20.00 40.00 60.00 80.00 100.00 Percentage of Number of Don't Cares in Test Set

Figure 5.4 Correlation Between Percentages of Don't Cares and Compression Ratios Huang 132

The points in the figures are the test sets with the corresponding percentage of logic values and compression ratios. In order to discover the relationship between logic values and compression ratios, certain percentages of logic values are established to allow comparisons among the test sets; while the percentage for the logic value zero and one is established at 20%, the percentage for the don't cares is set at 60%. Therefore, in figure

5.2, if the test sets have more than 20% of zeros, the proposed method has less chance of achieving high compression ratios; among the test sets with more than 20% of zeros, only

15% of them have compression ratios over 70%. On the other hand, if the test sets have less than or equal to 20% of zeros, the method can achieve the ratio 70% or above in 85% of the sets. The tables 5.7 and 5.8 show the breakdown of the test sets according to the three figures.

Table 5.7 Distributions of Test Sets According to the Established Percentages of Specified Bits and Figure 5.2 and 5.3

Have > 20% of Logic Values Have <= 20% of Logic Values Figures Compression Compression Compression Compression Ratio > 70% Ratio <= 70% Ratio > 70% Ratio <= 70% 5.2 15% 85% 82% 18% 5.3 53% 47% 60% 40%

Table 5.8 Distributions of Test Sets According to the Established Percentages of Don't Cares and Figure 5.4

Have > 60% of Logic Values Have <= 60% of Logic Values Figure Compression Compression Compression Compression Ratio > 70% Ratio <= 70% Ratio > 70% Ratio <= 70% 5.4 94% 6% 22% 78%

As expected, from the results in tables 5.7 and 5.8, the proposed method performs well when test sets have low percentages of specified bits and high percentage of don't cares. Huang 133

The last relationship, which involves the blocks' and shapes' distributions of both the former and proposed methods, shows the transitions in the usage of blocks and shapes from one method to another. Figure 5.5 is created based on the averages of various blocks and shapes - uncompressed block, all-zero or all-one block, point, line, triangle, rectangle, extended line, imperfect triangle, extended triangle, extended rectangle, homogeneous four-bit by four-bit block, and heterogeneous four-bit by four-bit block - of both compression methods in the table A26-A33 in appendix A.

Blocks and Shapes Distributions

Block or Shape Type

I Former Method 0 Proposed Method

Figure 5.5 Distributions of Blocks and Shapes of Former and Proposed Methods Huang 134

Several observations are made based on the figure. In spite of the quantities of other blocks or shapes, the decrease in the uncompressed blocks as a result of employing the proposed method rather than the former method indicates that the proposed method performs better than the former method. Another indication of good compression performance is the increase in the number of all-zero or all-one blocks because such type of block requires the least number of encoding bits among the blocks and shapes; unsurprisingly, because the proposed shape-oriented method has higher compression averages than that of the former primitive shape method, the shape-oriented method's usage of the all-zero or all-one block is higher than that of the primitive shape method.

Due to the employment of the additional shapes in the proposed method, the trend of shifting the high usage of primitive shapes - point, line, triangle, and rectangle - to the usage of other shapes or blocks is observed; such a shift is necessary as the proposed method attempts to find and has found a better solution, other than using the primitive shapes, in the compressing process. Huang 135

CHAPTER 6 PROPOSALS FOR THE COURSES OF THE FUTURE RESEARCH

Three main courses of the future action are proposed as follows: lessen existing disadvantages, increase compressing functionalities, and devise innovative algorithms.

As the first two courses concern the shape-oriented compression method, the last course does not necessary involve the operations of the proposed method. It is believed that by following the mentioned courses, a compression method that produces high compression ratios can be designed.

To decrease the magnitude of or to remove completely the disadvantages of the proposed method is one of the suggested courses of the future research. Because of the disadvantages, the proposed method requires more encoding bits to store the discovered information regarding test sets and the application of the method is constrained. As a result, inventive modifications are required in order to increase the performance of the method further.

The second course of the research - increase the functionalities of the proposed method - also assists the compression method in reaching for a higher compression ratio.

For example, a possible increase of types of shapes can take place in the proposed area- covering algorithm to decrease the total number of shapes required to encode a test set, as reducing the total can help increase the compression ratio. Therefore, augmenting the functionalities of any one of the algorithms of the proposed method is a necessary step towards the high compression execution. Huang 136

Although it may be the most difficult approach to design a compression method, the last course of future research is to devise innovative algorithms. As an innovative algorithm does not depend on the proposed or other existing methods of rearranging or encoding test data, the performance of such an algorithm is usually not hampered by the disadvantages associated with the methods. However, the efforts of searching for such an algorithm can be immense and requires a certain degree of understanding on existing compression methods. Because each algorithm of the proposed method can be a research topic itself, one can start with designing one algorithm while leaving the rest of the method as is to lessen the research effort. For example, in the proposed method, the general function - assisting in the encoding algorithm - of the ideal vector sorting algorithm is the same as that of the Burrows-Wheeler Transformation. If research time is a concern, replacing only the sorting algorithm with an innovative algorithm can achieve both the reduction in the research effort and the increment in the compression performance. Huang 137

CHAPTER 7 CONCLUSION

The proposed shape-oriented test set compression method has achieved both objectives and performs well compared to other contemporary compression methods in the experiment. The three algorithms - ideal vector sorting, amalgamated-shapes area- covering, and multi-syntax encoding - employed by the proposed method are discussed in detail to demonstrate the approaches of compressing test data. Based on the concept of completing better-formed, predefined shapes, the ideal vector sorting algorithm rearranges test cubes according to the recognized pieces of shapes in the cubes. The

second part of the proposed method, the amalgamated-shapes area-covering algorithm,

attempts to discover the shapes - primitive shapes, extended shapes, imperfect shapes,

and four-bit by four-bit blocks - in the cubes and gathers various information regarding the shapes. The last algorithm, the multi-syntax encoding algorithm, converts the gathered information into corresponding encoding bits according to the four syntax categories: original or real data, all-zero or all-one block, four-bit by four-bit blocks, and

shapes. As the efforts of the algorithms are gathered, the proposed compression method outperforms the other contemporary methods - Huffman coding, run-length coding, two types of combinations of run-length coding and Burrows-Wheeler Transformation, and the former method - in the experiment by a distinctive margin. To verify the compressed and decompressed test data of the methods, two straightforward verification processes are designed and deployed in the experiment. Compared to the compression time of other methods, the time required by the proposed method is slightly long; however, the extended period is acceptable because the compression process can be performed prior to Huang 138 the overall test time, meaning the compression time does not affect the overall test time.

Therefore, based on the collected experimental results, the proposed method is considered to be competitive compared to other compression methods. In conclusion, the shape-oriented test set compression method offers an alternative approach to compress the test data for a circuit under test (CUT), especially a complex circuitry such as system- on-a-chip (SoC). Huang 139

REFERENCES

T. Yamaguchi, M. Tilgner, M. Ishida, and D. S. Ha, "An Efficient Method for Compressing Test Data," Proceedings of International Test Conference, pp. 79- 88, Nov. 1997.

I. Pomeranz, L. N. Reddy and S. M. Reddy, "COMPACTEST: A Method to Generate Compact Test Sets for Combinational Circuits," Proceedings of International Test Conference, pp. 194-203, 1991

J.-S. Chang and C.-S. Lin, "Test Set Compaction for Combinational Circuits," IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, Vol. 14, No. 11, Nov. 1995, pp. 1370-1378, 1995.

S. Kajihara, I. Pomeranz, K. Kinoshita, and S. M. Reddy, "Cost-Effective Generation of Minimal Test Sets for Stuck-At Faults in Combinational Logic Circuits," Proceedings of the 30th Design Automation conference, pp. 102-106, 1993.

G.-J. Tromp, "Minimal Test Sets for Combinational Circuits," IEEE International Test Conference, pp. 194-203, 1991.

L. N. Reddy, I. Pomeranz, and S. M. Reddy, "ROTCO: A Reverse Order Test Compaction Technique," Euro-ASIC Conference, pp. 189-194, 1992.

I. Hamzaoglu and J. H. Patel, "Test Set Compaction Algorithms for combinational Circuits,"^CM, pp.283-289, 1998

M. Ishida, D.S. Ha, and T. Yamaguchi, "COMPACT: A Hybrid Method for Compressing Test Data," Proceedings Of VLSI Test Symposium, pp. 62-69, 1998.

Gilbert Held, Data Compression: Techniques and Applications: Hardware and Software Considerations, 3rd Edition, John Wiley & Sons Ltd., pp. 36-37, 141- 151,238-244, 1991.

A. Jas and N.A. Touba, "Test Vector Decompression via Cyclical Scan Chains and Its Application to Testing Core-Based Designs," Proceedings of International Test Conference, pp. 458-464, 1998.

M.R. Nelson, "Data Compression with the Burrows-Wheeler Transform," Dr. Dobb's Journal, pp. 46-50, September 1996. Huang 140

M. Burrows and D. J. Wheeler, "A Block-Sorting Lossless Data Compression Algorithm," Digital Systems Research Center Research Report 124, 1994, http://gatekeeper.dec.com/pub/DEC/SRC/research-reports/abstracts/src-rr- 124.html

C. Su and K. Hwang, "A Serial Scan Test Vector Compression Methodology," Proceedings of International Test Conference, pp. 981-988, 1993.

A. Jas and N.A. Touba, "Using an Embedded Processor for Efficient Deterministic Testing of System-on-a-Chip," Proceedings of IEEE International Conference on Computer Design (ICCD), pp. 418-423, 1999.

K. Sayood, Introduction to Data Compression, 2nd Edition, Morgan Kaufmann Publishers, pp. 118-132, 2000.

J. A. Storer, Data Compression: Methods and Theory, Computer Science Press Inc., pp. 39-40, 1988.

A. Jas, J.G. Dastidar and N.A. Touba, "Scan Vector Compression/Decompression Using Statistical Coding," Proceedings of International Test Conference, pp. 114- 120, 1999.

H. Ichihara, K. Kinoshita, I. Pomeranz, and S. M. Reddy, "Test Transformation to Improve Compaction by Statistical Encoding," 13th International Conference on VLSI Design, pp. 294-299, 2000.

M. E. Ng and N. A. Touba, "Test Vector Compression Via Statistical Coding and Dynamic Compaction," Autotestcon Proceedings, pp. 348-354, 2000.

M. Nelson, "LZWData Compression," Dr. Dobb's Journal, October 1989.

K. Chakrabarty, B.T. Murray, J. Liu, and M. Zhu, "Test Width Compression for Built-in Self-Testing," Proceedings Of International Test Conference, pp. 328- 337, 1997.

A. El-Maleh, S. A. Zahir, and E. Khan, "A Geometric-Primitives-Based Compression Scheme for Testing Systems-on-Chip," VLSI Test Symposium, 19th IEEE Proceedings on VTS2001, pp. 54-59, 2001.

S. A. Zahir, A. El-Maleh, and E. Khan, "An Efficient Test Vector Compression Technique Based on Geometric Shapes," Proceedings of ICECS, pp. 1561-1564, 2001. Huang 141

A. Jas, K. Mohanram, and N.A. Touba, "An Embedded Core DFT Scheme to Obtain Highly Compressed Test Sets," Proceedings of IEEE Asian Test Symposium, pp. 275-280, 1999.

S. Gupta, J. Rajski, and J. Tyszer, "Test Pattern Generation Based on Arithmetic Operations," Proceedings of International Conference on Computer-Aided Design (ICCAD), pp. 117-124, 1994.

C. Dufaza, C. Chevalier, and L. F. C. Lew Yan Voon, "LFSROM: A Hardware Test Pattern Generator for Deterministic ISCAS85 Test Sets," IEEE Proceedings of Asian Test Symposium, pp. 160-165, 1993.

S. Hellebrand, J. Rajski, S. Tarnick, S. Venkataraman and B. Courtois, "Built-in Test for Circuits with Scan Based on Reseeding of Multiple-Polynomial Linear Feedback Shift Registers," IEEE Transactions on Computers, Vol. C-44, pp.223- 33, February 1995.

S. Hellebrand, B. Reeb, S. Tarnick, and H-J. Wunderlich, "Pattern Generation for a Deterministic BIST Scheme," Proceedings of International Conference on Computer-Aided Design (ICCAD), pp. 88-94, November 1995.

N. Zacharia, J. Rajski, J. Tyszer, and J.A. Waicukauski, "Two-Dimensional Test Data Decompressor for Multiple Scan Designs," Proceedings of International Test Conference, pp. 186-194, 1996.

J. Rajski, J. Tyszer, and N. Zacharia, "Test Data Decompression for Multiple Scan Designs with Boundary Scan," IEEE Transactions On Computers, Vol. 47, No. 11, pp. 1188-1200, Nov. 1998.

T.M. Niermann and J.H. Patel, "HITEC: A Test Generation Package for Sequential Circuits," Proceedings European Conference Design Automation, pp. 214-218, 1991.

A. P. Strode, "Bit Serial Pattern Generation and Response Compaction using Arithmetic Functions," IEEE Proceedings of VLSI Test Symposium, pp. 78-84, 1998.

J. Rajski and J. Tyszer, "Accumulator-Based Compaction of Test Responses," IEEE Transactions on Computers, Vol. 42, pp. 643-50, June 1993.

R. Chandramouli, and S. Pateras, "Testing Systems on a Chip," IEEE Spectrum, pp. 42-47, Nov. 1996.

V.D. Agrawal, CR. Kime, and K.K. Saluja, "A Tutorial on Built-in Self Test, Part 1: Principles," IEEE Design and Test of Computers, pp. 73-82, March 1993 Huang 142

V.D. Agrawal, C.R. Kime, and K.K. Saluja, "A Tutorial on Built-in Self Test, Part 2: Applications," IEEE Design and Test of Computers, vol. 10, pp. 69-77, June 1993.

Y. Zorian, E.J. Marinissen, and S. Dey, "Testing Embedded-Core Based System Chips," Proceedings of International Test Conference, pp. 130-143, 1998.

M. Sugihara, H. Date, and H. Yasuura, "A Novel Test Methodology for Core- Based System LSIs and a Testing Time Minimization Problem," International Test Conference, pp.465-472, 1998. Huang 143

APPENDIX A EXPERIMENTAL-RESULT ADDENDUM

Test Sets Information

Table Al Test Sets Employed in the Experiment

Pins-to- Test Pins Cubes Cubes Total Bits 0s% ls% Xs% Set Ratio al 38 33 1.15 1254 45.61 25.36 29.03 a2 37 46 0.80 1702 1.41 3.29 95.30 a3 54 35 1.54 1890 56.03 16.98 26.98 a4 40 70 0.57 2800 20.36 72.61 7.04 a5 33 85 0.39 2805 14.33 56.54 29.13 a6 47 66 0.71 3102 5.54 15.83 78.63 a7 85 39 2.18 3315 1.27 7.90 90.83 a8 30 163 0.18 4890 11.55 22.76 65.69 a9 67 77 0.87 5159 2.21 26.87 70.92 alO 52 100 0.52 5200 39.06 13.94 47.00 all 162 33 4.91 5346 5.46 16.54 78.00 al2 41 139 0.29 5699 12.58 3.79 83.63 al3 184 32 5.75 5888 10.17 30.83 59.00 al4 172 35 4.91 6020 30.71 12.29 56.99 al5 88 71 1.24 6248 1.36 0.72 97.92 al6 75 99 0.76 7425 43.56 12.44 44.00 al7 90 88 1.02 7920 12.18 35.82 51.99 al8 82 99 0.83 8118 4.77 2.72 92.51 al9 158 52 3.04 8216 3.52 23.48 73.00 a20 112 75 1.49 8400 30.49 10.51 59.00 a21 183 50 3.66 9150 2.19 72.82 24.99 a22 162 57 2.84 9234 8.28 20.72 71.00 a23 81 121 0.67 9801 14.33 56.54 29.13 a24 186 54 3.44 10044 15.74 9.26 75.00 a25 68 152 0.45 10336 68.41 23.59 8.00 a26 71 200 0.36 14200 18.60 12.40 69.00 a27 101 184 0.55 18584 3.05 20.01 76.94 a28 105 179 0.59 18795 25.60 6.40 68.00 a29 120 171 0.70 20520 31.50 17.50 51.00 a30 183 125 1.46 22875 75.21 22.79 2.00 a31 142 197 0.72 27974 49.62 18.38 32.00 a32 153 189 0.81 28917 47.24 14.76 38.00 a33 172 171 1.01 29412 6.83 34.17 59.00 a34 158 192 0.82 30336 13.05 3.95 83.00 a35 200 188 1.06 37600 9.75 16.25 74.00

Avg. 106.63 104.77 1.49 11405.00 21.19 21.74 57.08 Huang 144

Encoding Bits and Corresponding Compression Ratios

Huffman Coding

Table Al Required Encoding Bits and Compression Ratios of the Huffman Coding

Huffman Coding

Test Bits in Encoding Bit Compression Ratio (in %) Set Test Set 6-Bit 8-Bit 10-Bit 6-Bit 8-Bit 10-Bit Average Average Sequence Sequence Sequence Sequence Sequence Sequence al 1254 1132 1231 1254 1205.67 9.73 1.83 0.00 3.85 a2 1702 408 382 364 384.67 76.03 77.56 78.61 77.40 a3 1890 1365 1617 1775 1585.67 27.78 14.44 6.08 16.10 a4 2800 2267 2244 2226 2245.67 19.04 19.86 20.50 19.80 a5 2805 1644 1945 2241 1943.33 41.39 30.66 20.11 30.72 a6 3102 1081 1088 1161 1110.00 65.15 64.93 62.57 64.22 a7 3315 727 640 608 658.33 78.07 80.69 81.66 80.14 a8 4890 2211 2663 1872 2248.67 54.79 45.54 61.72 54.01 a9 5159 1216 1102 1084 1134.00 76.43 78.64 78.99 78.02 alO 5200 8410 3040 3472 4974.00 -61.73 41.54 33.23 4.35 all 5346 1837 1859 2067 1921.00 65.64 65.23 61.34 64.07 al2 5699 1661 1549 1613 1607.67 70.85 72.82 71.70 71.79 al3 5888 2939 2958 3502 3133.00 50.08 49.76 40.52 46.79 al4 6020 3439 3653 4028 3706.67 42.87 39.32 33.09 38.43 al5 6248 1214 933 852 999.67 80.57 85.07 86.36 84.00 al6 7425 3985 4406 4046 4145.67 46.33 40.66 45.51 44.17 al7 7920 4297 4693 4390 4460.00 45.74 40.74 44.57 43.69 al8 8118 1937 1658 1555 1716.67 76.14 79.58 80.85 78.85 al9 8216 2339 2127 2096 2187.33 71.53 74.11 74.49 73.38 a20 8400 4236 4062 4776 4358.00 49.57 51.64 43.14 48.12 a21 9150 2158 2000 1954 2037.33 76.42 78.14 78.64 77.73 a22 9234 3921 4126 4534 4193.67 57.54 55.32 50.90 54.58 a23 9801 4678 5129 5480 5095.67 52.27 47.67 44.09 48.01 a24 10044 4325 4766 5031 4707.33 56.94 52.55 49.91 53.13 a25 10336 8325 8490 9744 8853.00 19.46 17.86 5.73 14.35 a26 14200 7948 7537 7792 7759.00 44.03 46.92 45.13 45.36 a27 18584 4853 4448 4299 4533.33 73.89 76.07 76.87 75.61 a28 18795 6777 6814 6838 6809.67 63.94 63.75 63.62 63.77 a29 20520 12587 11939 12916 12480.67 38.66 41.82 37.06 39.18 a30 22875 17949 19165 21385 19499.67 21.53 16.22 6.51 14.76 a31 27974 19426 20004 20801 20077.00 30.56 28.49 25.64 28.23 a32 28917 17634 18325 19474 18477.67 39.02 36.63 32.66 36.10 a33 29412 10938 10544 10920 10800.67 62.81 64.15 62.87 63.28 a34 30336 8547 7944 7783 8091.33 71.83 73.81 74.34 73.33 a35 37600 17575 16617 16425- 16872.33 53.26 55.81 56.32 55.13 Huang 145

In table A2, each number of encoding bits or compression ratio is generated by the

Huffman coding method according to one of the three dimensions of sequences, 6-, 8-, and 10-bit, mentioned in table 5.1. Each compression ratio is calculated by using the acquired number of encoding bits and the equation (5.1). Each average in the table is computed based on the number under the three dimensions on the same test set. For the average dimension of the test sets, which has around 106-107 pins and 104-105 cubes according to the last row of the table A2, the average encoding bits of all test sets under each dimension of the sequence is shown in table A3, and the corresponding compression ratios are shown in table A4; calculating the ratios based on the encoding bits, rather than the average of all compression ratios, has considered both the encoding bits and the corresponding size of the matching test sets.

Table A3 Average Encoding Bits of the Huffman Coding for the Test Set with the Average Dimension

Huffman Coding Average Average Encoding Bit Bits in a Test Set 6-Bit 8-Bit 10-Bit Overall Sequence Sequence Sequence Average 11405.00 5599.60 5477.09 5724.51 5600.40

Table A4 Average Compression Ratios of the Huffman Coding for the Test Set with the Average Dimension

Huffman Coding Averajie Compression Ratio (in %) 6-Bit 8-Bit 10-Bit Overall Sequence Sequence Sequence Average 50.90 51.98 49.81 50.90

The approaches of acquiring the number of encoding bits and compression ratios for the

Huffman coding method are the same for the other compression methods. Huang 146

Run-Length Coding

Table A5 Required Encoding Bits and Compression Ratios of the Run-Length Coding

Run-Length Coding

Test Bits in Encoding Bit Compression Ratio (in %) Set Test Set 32-Bit 64-Bit 128-Bit 32-Bit 64-Bit 128-Bit Average Average Sequence Sequence Sequence Sequence Sequence Sequence al 1254 774 882 1008 888.00 38.28 29.67 19.62 29.19 a2 1702 348 266 216 276.67 79.55 84.37 87.31 83.74 a3 1890 1728 1890 1890 1836.00 8.57 0.00 0.00 2.86 a4 2800 2532 2751 2800 2694.33 9.57 1.75 0.00 3.77 a5 2805 1128 1078 1136 1114.00 59.79 61.57 59.50 60.29 a6 3102 744 588 560 630.67 76.02 81.04 81.95 79.67 a7 3315 660 427 296 461.00 80.09 87.12 91.07 86.09 a8 4890 1686 1582 1616 1628.00 65.52 67.65 66.95 66.71 a9 5159 1152 840 664 885.33 77.67 83.72 87.13 82.84 alO 5200 3264 3486 3872 3540.67 37.23 32.96 25.54 31.91 all 5346 1866 1799 1912 1859.00 65.10 66.35 64.23 65.23 al2 5699 1422 1106 992 1173.33 75.05 80.59 82.59 79.41 al3 5888 2208 2254 2456 2306.00 62.50 61.72 58.29 60.84 al4 6020 3402 3717 4200 3773.00 43.49 38.26 30.23 37.33 al5 6248 1182 721 464 789.00 81.08 88.46 92.57 87.37 al6 7425 2838 2751 2840 2809.67 61.78 62.95 61.75 62.16 al7 7920 3054 2968 3144 3055.33 61.44 62.53 60.30 61.42 al8 8118 1680 1120 888 1229.33 79.31 86.20 89.06 84.86 al9 8216 2016 1575 1480 1690.33 75.46 80.83 81.99 79.43 a20 8400 2988 2793 2896 2892.33 64.43 66.75 65.52 65.57 a21 9150 2208 1610 1312 1710.00 75.87 82.40 85.66 81.31 a22 9234 2802 2541 2704 2682.33 69.66 72.48 70.72 70.95 a23 9801 3204 2905 2920 3009.67 67.31 70.36 70.21 69.29 a24 10044 2718 2310 2336 2454.67 72.94 77.00 76.74 75.56 a25 10336 10336 10336 10336 10336.00 0.00 0.00 0.00 0.00 a26 14200 6270 6258 6576 6368.00 55.85 55.93 53.69 55.15 a27 18584 4104 2828 2240 3057.33 77.92 84.78 87.95 83.55 a28 18795 5424 4592 4432 4816.00 71.14 75.57 76.42 74.38 a29 20520 14580 15876 17344 15933.33 28.95 22.63 15.48 22.35 a30 22875 11934 12012 12872 12272.67 47.83 47.49 43.73 46.35 a31 27974 12060 11361 11896 11772.33 56.89 59.39 57.47 57.92 a32 28917 11682 11004 11400 11362.00 59.60 61.95 60.58 60.71 a33 29412 9312 8162 7968 8480.67 68.34 72.25 72.91 71.17 a34 30336 6780 4837 4024 5213.67 77.65 84.06 86.74 82.81 a35 37600 11094 9436 9376 9968.67 70.49 74.90 75.06 73.49 Huang 147

Table A6 Average Encoding Bits of the Run-Length Coding for the Test Set with the Average Dimension

Run-Length Coding Average Average Encoding Bit Bits in a Test Set 32-Bit 64-Bit 128-Bit Overall Sequence Sequence Sequence Average 11405.00 4319.43 4018.91 4087.60 4141.98

Table A7 Average Compression Ratios of the Run-Length Coding for the Test Set with the Average Dimension

Run-Length Coding Average Compression Ratio (in %) 32-Bit 64-Bit 128-Bit Overall Sequence Sequence Sequence Average 62.13 64.76 64.16 63.68 Huang 148

Run-Length Coding and Burrows-Wheeler Transformation (BWT)

Table A8 Required Encoding Bits and Compression Ratios of the Combination of the Run-Length Coding and the Burrows-Wheeler Transformation

Run-Length Coding + Burrows-Wheeler Transformation (BWT)

Test Bits in Encoding Bit Compression Ratio (in %) Set Test Set 32-Bit 64-Bit 128-Bit 32-Bit 64-Bit 128-Bit Average Average Sequence Sequence Sequence Sequence Sequence Sequence al 1254 1152 1055 1201 1136.00 8.13 15.87 4.23 9.41 a2 1702 584 387 437 469.33 65.69 77.26 74.32 72.42 a3 1890 1890 1890 1890 1890.00 0.00 0.00 0.00 0.00 a4 2800 2800 2800 2800 2800.00 0.00 0.00 0.00 0.00 a5 2805 1407 1379 1313 1366.33 49.84 50.84 53.19 51.29 a6 3102 1243 1065 797 1035.00 59.93 65.67 74.31 66.63 a7 3315 1237 742 836 938.33 62.68 77.62 74.78 71.69 a8 4890 2173 1877 1935 1995.00 55.56 61.62 60.43 59.20 a9 5159 1666 1396 990 1350.67 67.71 72.94 80.81 73.82 alO 5200 4028 3976 4171 4058.33 22.54 23.54 19.79 21.96 all 5346 3322 2569 2914 2935.00 37.86 51.95 45.49 45.10 al2 5699 1935 1625 1529 1696.33 66.05 71.49 73.17 70.23 al3 5888 2686 3106 3526 3106.00 54.38 47.25 40.12 47.25 al4 6020 4960 4521 5144 4875.00 17.61 24.90 14.55 19.02 al5 6248 1884 1485 896 1421.67 69.85 76.23 85.66 77.25 al6 7425 3841 3337 3235 3471.00 48.27 55.06 56.43 53.25 al7 7920 3740 3748 3548 3678.67 52.78 52.68 55.20 53.55 al8 8118 2512 1599 1162 1757.67 69.06 80.30 85.69 78.35 a 19 8216 2850 2121 2402 2457.67 65.31 74.18 70.76 70.09 a20 8400 4001 3824 3535 3786.67 52.37 54.48 57.92 54.92 a21 9150 3184 2209 2501 2631.33 65.20 75.86 72.67 71.24 a22 9234 3678 3168 3598 3481.33 60.17 65.69 61.04 62.30 a23 9801 3920 3388 3320 3542.67 60.00 65.43 66.13 63.85 a24 10044 3673 2942 3337 3317.33 63.43 70.71 66.78 66.97 a25 10336 10336 10336 10336 10336.00 0.00 0.00 0.00 0.00 a26 14200 7525 7201 7134 7286.67 47.01 49.29 49.76 48.69 a27 18584 5064 3456 3062 3860.67 72.75 81.40 83.52 79.23 a28 18795 6720 5514 5443 5892.33 64.25 70.66 71.04 68.65 a29 20520 16862 17338 18868 17689.33 17.83 15.51 8.05 13.79 a30 22875 13856 - 13377 13786 13673.00 39.43 41.52 39.73 40.23 a31 27974 14522 13766 13292 13860.00 48.09 50.79 52.48 50.45 a32 28917 13632 12481 12988 13033.67 52.86 56.84 55.09 54.93 a33 29412 11831 9805 9711 10449.00 59.77 66.66 66.98 64.47 a34 30336 8271 5895 5352 6506.00 72.74 80.57 82.36 78.55 a35 37600 13317 11143 11195 11885.00 64.58 70.36 70.23 68.39 Huang 149

Table A9 Average Encoding Bits of the Combination - the Run-Length Coding and the Burrows-Wheeler Transformation - for the Test Set with the Average Dimension

Run-Length Coding + BWT Average Average Encoding Bit Bits in a Test Set 32-Bit 64-Bit 128-Bit Overall Sequence Sequence Sequence Average 11405.00 5322.91 4757.74 4805.26 4961.97

Table AlO Average Compression Ratios of the Combination - the Run-Length Coding and the Burrows-Wheeler Transformation - for the Test Set with the Average Dimension

Run-Length Coding + BWT Averajge Compression Ratio (in %) 32-Bit 64-Bit 128-Bit Overall Sequence Sequence Sequence Average 53.33 58.28 57.87 56.49 Huang 150

Modified Combination of the Run-Length Coding and the Burrows-Wheeler Transformation (BWT)

Table All Required Encoding Bits and Compression Ratios of the Modified Combination of the Run-Length Coding and the Burrows-Wheeler Transformation

Modified Run-Length Coding + Burrows-Wheeler Transformation (BWT)

Test Bits in Encoding Bit Compression Ratio (in %) Set Test Set 32-Bit 64-Bit 128-Bit 32-Bit 64-Bit 128-Bit Average Average Sequence Sequence Sequence Sequence Sequence Sequence al 1254 980 989 1076 1015.00 21.85 21.13 14.19 19.06 a2 1702 658 424 474 518.67 61.34 75.09 72.15 69.53 a3 1890 1828 1834 1890 1850.67 3.28 2.96 0.00 2.08 a4 2800 2114 2507 2428 2349.67 24.50 10.46 13.29 16.08 a5 2805 1440 1422 1338 1400.00 48.66 49.30 52.30 50.09 a6 3102 1190 922 842 984.67 61.64 70.28 72.86 68.26 a7 3315 1406 826 920 1050.67 57.59 75.08 72.25 68.31 a8 4890 2198 1925 1985 2036.00 55.05 60.63 59.41 58.36 a9 5159 1862 1516 1052 1476.67 63.91 70.61 79.61 71.38 alO 5200 3582 3489 4054 3708.33 31.12 32.90 22.04 28.69 all 5346 2802 2656 2961 2806.33 47.59 50.32 44.61 47.51 al2 5699 2113 1709 1561 1794.33 62.92 70.01 72.61 68.51 al3 5888 2844 3240 3616 3233.33 51.70 44.97 38.59 45.09 al4 6020 4542 4398 4735 4558.33 24.55 26.94 21.35 24.28 al5 6248 2148 1661 984 1597.67 65.62 73.42 84.25 74.43 al6 7425 3657 3360 3302 3439.67 50.75 54.75 55.53 53.67 al7 7920 3890 3854 3632 3792.00 50.88 51.34 54.14 52.12 al8 8118 2594 1763 1244 1867.00 68.05 78.28 84.68 77.00 al9 8216 3158 2275 2556 2663.00 61.56 72.31 68.89 67.59 a20 8400 4154 3872 3638 3888.00 50.55 53.90 56.69 53.71 a21 9150 3494 2375 2660 2843.00 61.81 74.04 70.93 68.93 a22 9234 3963 3314 3728 3668.33 57.08 64.11 59.63 60.27 a23 9801 4078 3388 3392 3619.33 58.39 65.43 65.39 63.07 a24 10044 4004 3119 3512 3545.00 60.14 68.95 65.03 64.71 a25 10336 7588 7611 9846 8348.33 26.59 26.36 4.74 19.23 a26 14200 7158 6402 6364 6641.33 49.59 54.92 55.18 53.23 a27 18584 5656 3755 3260 4223.67 69.57 79.79 82.46 77.27 a28 18795 7178 5705 5447 6110.00 61.81 69.65 71.02 67.49 a29 20520 13860 13258 15465 14194.33 32.46 35.39 24.63 30.83 a30 22875 11317 11402 13673 12130.67 50.53 50.16 40.23 46.97 a31 27974 13530 12857 13274 13220.33 51.63 54.04 52.55 52.74 a32 28917 12570 10634 12392 11865.33 56.53 63.23 57.15 58.97 a33 29412 12413 9942 9784 10713.00 57.80 66.20 66.73 63.58 a34 30336 9190 6365 5664 7073.00 69.71 79.02 81.33 76.68 a35 37600 14224 11576 11574 12458.00 62.17 69.21 69.22 66.87 Huang

Table A12 Average Encoding Bits of the Modified Combination - the Run-Length Coding and the Burrows-Wheeler Transformation - for the Test Set with the Average Dimension

Modified Run-Length Coding + BWT Average Average Encoding Bit Bits in a Test Set 32-Bit 64-Bit 128-Bit Overall Sequence Sequence Sequence Average 11405.00 5125.23 4467.00 4694.94 4762.39

Table Al 3 Average Compression Ratios of the Modified Combination - the Run- Length Coding and the Burrows-Wheeler Transformation - for the Test Set with the Average Dimension

Modified Run-Length Coding + BWT Average Compression Ratio (in %) 32-Bit 64-Bit 128-Bit Overall Sequence Sequence Sequence Average 55.06 60.83 58.83 58.24 Huang 152

Former Primitive Shape Compression

Table A14 Required Encoding Bits and Compression Ratios of the Former Primitive Shape Compression

Former Primitive Shape Compression

Test Bits in Encoding Bit Compression Ratio (in %) Set Test Set 8x8 16x16 32x32 8x8 16x16 32x32 Average Average Block Block Block Block Block Block al 1254 817 981 996 931.33 34.85 21.77 20.57 25.73 a2 1702 185 161 146 164.00 89.13 90.54 91.42 90.36 a3 1890 1300 1389 1709 1466.00 31.22 26.51 9.58 22.43 a4 2800 1845 1919 2218 1994.00 34.11 31.46 20.79 28.79 a5 2805 1402 1299 1315 1338.67 50.02 53.69 53.12 52.28 a6 3102 676 559 552 595.67 78.21 81.98 82.21 80.80 a7 3315 315 266 245 275.33 90.50 91.98 92.61 91.69 a8 4890 1697 1518 1514 1576.33 65.30 68.96 69.04 67.76 a9 5159 720 503 446 556.33 86.04 90.25 91.35 89.22 alO 5200 3051 3048 3265 3121.33 41.33 41.38 37.21 39.97 all 5346 1499 1435 1621 1518.33 71.96 73.16 69.68 71.60 al2 5699 1064 879 875 939.33 81.33 84.58 84.65 83.52 al3 5888 2261 2172 2151 2194.67 61.60 63.11 63.47 62.73 al4 6020 3183 3394 3713 3430.00 47.13 43.62 38.32 43.02 al5 6248 367 318 319 334.67 94.13 94.91 94.89 94.64 al6 7425 2840 2693 2685 2739.33 61.75 63.73 . 63.84 63.11 al7 7920 3057 2953 3053 3021.00 61.40 62.71 61.45 61.86 al8 8118 831 826 722 793.00 89.76 89.83 91.11 90.23 al9 8216 1385 1136 1342 1287.67 83.14 86.17 83.67 84.33 a20 8400 2893 2712 2841 2815.33 65.56 67.71 66.18 66.48 a21 9150 1406 1094 1005 1168.33 84.63 88.04 89.02 87.23 a22 9234 2839 2492 2722 2684.33 69.25 73.01 70.52 70.93 a23 9801 3207 3043 2847 3032.33 67.28 68.95 70.95 69.06 a24 10044 2614 2308 2330 2417.33 73.97 77.02 76.80 75.93 a25 10336 7395 7230 8481 7702.00 28.45 30.05 17.95 25.48 a26 14200 4858 4853 5159 4956.67 65.79 65.82 63.67 65.09 a27 18584 2505 1840 1634 1993.00 86.52 90.10 91.21 89.28 a28 18795 4749 3964 3821 4178.00 74.73 78.91 79.67 77.77 a29 20520 12035 11683 12179 11965.67 41.35 43.07 40.65 41.69 a30 22875 12613 11206 11561 11793.33 44.86 51.01 49.46 48.44 a31 27974 13757 11604 12149 12503.33 50.82 58.52 56.57 55.30 a32 28917 12093 10675 10343 11037.00 58.18 63.08 64.23 61.83 a33 29412 7662 6491 6318 6823.67 73.95 77.93 78.52 76.80 a34 30336 4377 3338 3092 3602.33 85.57 89.00 89.81 88.13 a35 37600 9917 9043 9234 9398.00 73.63 75.95 75.44 75.01 Huang 153

Table A15 Average Encoding Bits of the Former Primitive Shape Compression for the Test Set with the Average Dimension

Former Primitive Shape Compression Average Average Encoding Bit Bits in a Test Set 8x8 16x16 32x32 Overall Block Block Block Average 11405.00 3811.86 3457.86 3560.09 3609.93

Table A16 Average Compression Ratios of the Former Primitive Shape Compression for the Test Set with the Average Dimension

Former Primitive Shape Compression Averajj e Compression Ratio (in %) 8x8 16x16 32x32 Overall Block Block Block Average 66.58 69.68 68.78 68.35

In the tables A14 - A16, the 8x8 block means 8-bit by 8-bit partitioned block, and

16x16 block means 16-bit by 16-bit partitioned block. Similarity, 32x32 block is the same as 32-bit by 32-bit block. The notations of the blocks are also applied to the next three tables, A17 - A19, of the proposed method. Huang 154

Proposed Shape-Oriented Compression

Table A17 Required Encoding Bits and Compression Ratios of the Proposed Shape- Oriented Compression

Proposed Shape-Oriented Compression

Test Bits in Encoding Bit Compression Ratio (in %) Set Test Set 8x8 16x16 32x32 8x8 16x16 32x32 Average Average Block Block Block Block Block Block al 1254 820 861 957 879.33 34.61 31.34 23.68 29.88 a2 1702 145 130 106 127.00 91.48 92.36 93.77 92.54 a3 1890 1209 1296 1491 1332.00 36.03 31.43 21.11 29.52 a4 2800 1454 1435 1741 1543.33 48.07 48.75 37.82 44.88 a5 2805 998 842 842 894.00 64.42 69.98 69.98 68.13 a6 3102 600 574 487 553.67 80.66 81.50 84.30 82.15 a7 3315 269 246 203 239.33 91.89 92.58 93.88 92.78 a8 4890 1366 1213 1170 1249.67 72.07 75.19 76.07 74.44 a9 5159 668 448 440 518.67 87.05 91.32 91.47 89.95 alO 5200 2435 2484 2714 2544.33 53.17 52.23 47.81 51.07 all 5346 1411 1419 1515 1448.33 73.61 73.46 71.66 72.91 al2 5699 995 847 837 893.00 82.54 85.14 85.31 84.33 al3 5888 2167 2129 2351 2215.67 63.20 63.84 60.07 62.37 al4 6020 2948 3128 3418 3164.67 51.03 48.04 43.22 47.43 al5 6248 339 232 254 275.00 94.57 96.29 95.93 95.60 al6 7425 2394 2064 2258 2238.67 67.76 72.20 69.59 69.85 al7 7920 2741 2518 2675 2644.67 65.39 68.21 66.22 66.61 al8 8118 798 666 619 694.33 90.17 91.80 92.37 91.45 al9 8216 1261 1114 1186 1187.00 84.65 86.44 85.56 85.55 a20 8400 2490 2253 2478 2407.00 70.36 73.18 70.50 71.35 a21 9150 1277 1102 1005 1128.00 86.04 87.96 89.02 87.67 a22 9234 2484 2475 2441 2466.67 73.10 73.20 73.57 73.29 a23 9801 2726 2611 2671 2669.33 72.19 73.36 72.75 72.76 a24 10044 2392 2274 2426 2364.00 76.18 77.36 75.85 76.46 a25 10336 6616 6332 6464 6470.67 35.99 38.74 37.46 37.40 a26 14200 4280 4326 4509 4371.67 69.86 69.54 68.25 69.21 a27 18584 2178 1632 1401 1737.00 88.28 91.22 92.46 90.65 a28 18795 4201 3434 3089 3574.67 77.65 81.73 83.56 80.98 a29 20520 10738 10532 10710 10660.00 47.67 48.67 47.81 48.05 a30 22875 10775 9530 10732 10345.67 52.90 58.34 53.08 54.77 a31 27974 11361 9521 10042 10308.00 59.39 65.96 64.10 63.15 a32 28917 10063 8914 8813 9263.33 65.20 69.17 69.52 67.97 a33 29412 6861 5712 5651 6074.67 76.67 80.58 80.79 79.35 a34 30336 4070 3165 2790 3341.67 86.58 89.57 90.80 88.98 a35 37600 9032 8042 8232 8435.33 75.98 78.61 78.11 77.57 Huang 155

Table Al 8 Average Encoding Bits of the Proposed Shape-Oriented Compression for the Test Set with the Average Dimension

Proposed Shape-Oriented Compression Average Average Encoding Bit Bits in a Test Set 8x8 16x16 32x32 Overall Block Block Block Average 11405.00 3330.34 3014.31 3106.23 3150.30

Table A19 Average Compression Ratios of the Proposed Shape-Oriented Compression for the Test Set with the Average Dimension

Proposed Shape-Oriented Compression Averaj» e Compression Ratio (in %) 8x8 16x16 32x32 Overall Block Block Block Average 70.80 73.57 72.76 72.38 Huang 156

Compression Time

In table A20 shown on the next page, each compression time is acquired when the

Huffman coding method compresses the corresponding test set on the mentioned computer equipment in Chapter 5. The average of each test set displayed on the right of the table is computed based on the required time under the three dimensions of the sequences, and the averages on the bottom of the table are based on the time for compressing all test sets using the same dimension of the sequence. The unit for all the compression time is millisecond; the time of 0.00 means that the compression time is under one millisecond and is undetectable by the code generated by the Visual C++ 6.0.

As for the compression time of other compression methods, the mentioned techniques of

acquiring the compression time are also applied.

There is a small difference between the tables of the contemporary compression methods and the tables of the shape-based compression schemes. In table A24, the

former method has an extra column titled "WS Time" that has the sorting time spent for

each test set. Similarly, in table A25, the proposed method has the column with the title

"IS Time" that contains the time spent on the ideal vector sorting.

The decompression time of the compression methods is not shown in the thesis due to the fact that the time is often close to zero milliseconds; the amount of time spent on the decompression is small because executing straightforward operations according to the encoding bits is the notion of the decompression methods. Huffman Coding

Table A20 Required Compression Time of the Huffman Coding

Huffman Coding

Bits in Compression Time (Unit: ms) Test Set Test Set 6-Bit 8-Bit 10-Bit Average Sequence Sequence Sequence al 1254 880 1200 1600 1226.67 a2 1702 15270 44000 135390 64886.67 a3 1890 1210 1590 2310 1703.33 a4 2800 380 380 440 400.00 a5 2805 1810 2200 2860 2290.00 a6 3102 16480 39600 104910 53663.33 a7 3315 25870 71460 210420 102583.33 a8 4890 15540 34210 75580 41776.67 a9 5159 20370 44870 106440 57226.67 alO 5200 3235 13180 23340 13251.67 all 5346 27520 68220 178400 91380.00 al2 5699 36030 93210 256000 128413.33 al3 5888 14820 27020 55260 32366.67 al4 6020 13730 24940 48220 28963.33 al5 6248 60310 178460 560620 266463.33 al6 7425 10770 17080 28670 18840.00 al7 7920 15650 27130 48890 30556.67 al8 8118 66900 186970 557980 270616.67 al9 8216 35980 82340 200480 106266.67 a20 8400 22190 42560 84970 49906.67 a21 9150 5660 7190 9560 7470.00 a22 9234 36690 79700 186580 100990.00 a23 9801 30760 61290 130120 74056.67 a24 10044 45810 107330 264190 139110.00 a25 10336 1590 1650 1760 1666.67 a26 14200 55090 121820 289020 155310.00 a27 18584 94140 228210 587260 303203.33 a28 18795 64980 134570 295280 164943.33 a29 20520 44100 73490 137810 85133.33 a30 22875 940 990 940 956.67 a31 27974 25540 34930 51470 37313.33 a32 28917 30970 45150 67940 48020.00 a33 29412 79590 152800 330590 187660.00 a34 30336 189220 488450 1336220 671296.67 a35 37600 171590 395960 946970 504840.00

Average 11405.00 36617.57 83832.86 209099.71 109850.05 Run-Length Coding

Table A21 Required Compression Time of the Run-Length Coding

Run-Length Coding

Bits in Compression Time (Unit: ms) Test Set Test Set 32-Bit 64-Bit 128-Bit Average Sequence Sequence Sequence al 1254 0 0 0 0.00 a2 1702 0 0 0 0.00 a3 1890 0 0 0 0.00 a4 2800 0 0 0 0.00 a5 2805 0 0 0 0.00 a6 3102 0 0 0 0.00 a7 3315 0 0 0 0.00 a8 4890 0 0 0 0.00 a9 5159 0 0 0 0.00 alO 5200 0 0 0 0.00 all 5346 0 0 50 16.67 al2 5699 0 0 0 0.00 al3 5888 0 0 0 0.00 al4 6020 0 0 0 0.00 al5 6248 0 0 0 0.00 al6 7425 0 0 0 0.00 al7 7920 0 0 0 0.00 al8 8118 0 0 0 0.00 al9 8216 0 0 0 0.00 a20 8400 0 0 0 0.00 a21 9150 0 0 0 0.00 a22 9234 0 0 0 0.00 a23 9801 0 0 0 0.00 a24 10044 0 0 0 0.00 a25 10336 0 0 0 0.00 a26 14200 0 0 0 0.00 a27 18584 0 0 0 0.00 a28 18795 0 0 0 0.00 a29 20520 0 0 0 0.00 a30 22875 0 0 0 0.00 a31 27974 0 0 0 0.00 a32 28917 0 0 0 0.00 a33 29412 0 0 0 0.00 a34 30336 0 0 0 0.00 a35 37600 50 0 0 16.67

Average 11405.00 1.43 0.00 1.43 0.95 Huang 1

Run-Length Coding and Burrows-Wheeler Transformation (BWT)

Table A22 Required Compression Time of the of the Combination of the Run-Length Coding and the Burrows-Wheeler Transformation

Run-Length Coding + BWT

Bits in Compression Time (Unit: ms) Test Set Test Set 32-Bit 64-Bit 128-Bit Average Sequence Sequence Sequence al 1254 60 60 60 60.00 a2 1702 0 0 0 0.00 a3 1890 60 50 50 53.33 a4 2800 110 380 490 326.67 a5 2805 60 330 770 386.67 a6 3102 60 220 270 183.33 a7 3315 0 0 0 0.00 a8 4890 50 330 1810 730.00 a9 5159 50 160 440 216.67 alO 5200 110 490 1430 676.67 all 5346 110 110 110 110.00 al2 5699 50 280 2190 840.00 al3 5888 110 110 110 110.00 al4 6020 110 160 220 163.33 al5 6248 0 0 0 0.00 al6 7425 110 550 2910 1190.00 al7 7920 110 660 2030 933.33 al8 8118 50 110 550 236.67 al9 8216 60 280 280 206.67 a20 8400 110 770 1590 823.33 a21 9150 60 380 330 256.67 a22 9234 110 660 600 456.67 a23 9801 60 600 4230 1630.00 a24 10044 50 380 390 273.33 a25 10336 160 710 3130 1333.33 a26 14200 160 430 2580 1056.67 a27 18584 110 610 5270 1996.67 a28 18795 110 720 5880 2236.67 a29 20520 330 1370 6480 2726.67 a30 22875 210 1820 10270 4100.00 a31 27974 280 1920 8630 3610.00 a32 28917 220 1320 7750 3096.67 a33 29412 330 1530 11370 4410.00 a34 30336 110 770 5160 2013.33 a35 37600 330 1980 12690 5000.00

Average 11405.00 114.57 578.57 2859.14 1184.10 Huang

Modified Combination of the Run-Length Coding and the Burrows-Wheeler Transformation (BWT)

Table A23 Required Compression Time of the Modified Combination of the Run- Length Coding and the Burrows-Wheeler Transformation

Modified Run-Length Coding + BWT

Bits in Compression Time (Unit: ms) Test Set Test Set 32-Bit 64-Bit 128-Bit Average Sequence Sequence Sequence al 1254 60 60 50 56.67 a2 1702 0 0 0 0.00 a3 1890 60 110 110 93.33 a4 2800 110 380 440 310.00 a5 2805 60 270 770 366.67 a6 3102 0 220 280 166.67 a7 3315 0 50 0 16.67 a8 4890 0 320 1820 713.33 a9 5159 0 160 440 200.00 alO 5200 110 440 1430 660.00 all 5346 50 110 110 90.00 al2 5699 50 270 2310 876.67 al3 5888 110 110 160 126.67 al4 6020 170 220 220 203.33 al5 6248 0 0 0 0.00 al6 7425 60 550 2800 1136.67 al7 7920 110 710 2080 966.67 al8 8118 0 110 540 216.67 al9 8216 60 270 270 200.00 a20 8400 110 770 1540 806.67 a21 9150 50 380 330 253.33 a22 9234 110 610 660 460.00 a23 9801 110 660 4290 1686.67 a24 10044 50 390 440 293.33 a25 10336 170 710 3240 1373.33 a26 14200 170 440 2640 1083.33 a27 18584 110 710 5390 2070.00 a28 18795 160 720 5990 2290.00 a29 20520 330 1320 6600 2750.00 a30 22875 280 1750 10380 4136.67 a31 27974 380 1860 8630 3623.33 a32 28917 330 1320 7910 3186.67 a33 29412 330 1480 11470 4426.67 a34 30336 170 830 5220 2073.33 a35 37600 280 1970 12360 4870.00

Average 11405.00 118.57 579.43 2883.43 1193.81 Huang 161

Former Primitive Shape Compression

Table A24 Required Compression Time of the Former Primitive Shape Compression

Former Primitive Shape Compression

Bits in Compression Time (Unit: ms) Test Set WS Time Test Set (Unit: ms) 8x8 16x16 32x32 Average Block Block Block al 1254 60 60 160 2420 880.00 a2 1702 50 50 110 610 256.67 a3 1890 60 50 170 1590 603.33 a4 2800 110 0 170 2310 826.67 a5 2805 110 50 220 1970 746.67 a6 3102 110 60 220 1650 643.33 a7 3315 50 60 270 2750 1026.67 a8 4890 330 110 220 940 423.33 a9 5159 160 0 110 1370 493.33 alO 5200 220 110 270 1810 730.00 all 5346 110 110 280 4780 1723.33 al2 5699 330 60 330 3570 1320.00 al3 5888 60 110 110 170 130.00 al4 6020 110' 110 380 5110 1866.67 al5 6248 160 0 440 2470 970.00 al6 7425 270 110 280 3520 1303.33 al7 7920 330 110 280 390 260.00 al8 8118 330 50 600 4060 1570.00 al9 8216 220 110 380 1100 530.00 a20 8400 220 110 220 2420 916.67 a21 9150 170 60 280 1320 553.33 a22 9234 220 220 440 1480 713.33 a23 9801 550 170 330 1100 533.33 a24 10044 270 160 550 1210 640.00 a25 10336 660 110 330 3520 1320.00 a26 14200 1650 280 710 3790 1593.33 a27 18584 1380 170 610 4780 1853.33 a28 18795 1380 270 710 4120 1700.00 a29 20520 1480 330 550 2200 1026.67 a30 22875 1150 110 220 270 200.00 a31 27974 2360 330 550 5000 1960.00 a32 28917 2360 270 440 610 440.00 a33 29412 2140 330 600 3950 1626.67 a34 30336 2410 320 880 3020 1406.67 a35 37600 2970 550 1430 4940 2306.67

Average 11405.00 701.43 146.00 395.71 2466.29 1002.67 Huang 162

Proposed Shape-Oriented Compression

Table A25 Required Compression Time of the Proposed Shape-Oriented Compression

Proposed Shape-Oriented Compression

Bits in Compression Time (Unit: ms) Test Set IS Time Test Set (Unit: ms) 8x8 16x16 32x32 Average Block Block Block al 1254 110 110 390 3570 1356.67 a2 1702 110 170 870 1650 896.67 a3 1890 110 160 440 2530 1043.33 a4 2800 220 110 270 3630 1336.67 a5 2805 270 110 220 1650 660.00 a6 3102 270 280 880 3070 1410.00 a7 3315 220 280 1590 3130 1666.67 a8 4890 770 440 930 2030 1133.33 a9 5159 390 330 770 3300 1466.67 alO 5200 390 330 820 3070 1406.67 all 5346 330 600 1760 10880 4413.33 al2 5699 710 490 1650 6700 2946.67 al3 5888 380 550 660 600 603.33 al4 6020 380 500 1260 8080 3280.00 al5 6248 500 170 2690 15270 6043.33 al6 7425 660 440 770 5710 2306.67 al7 7920 660 540 1150 1430 1040.00 al8 8118 650 770 4390 12350 5836.67 al9 8216 500 600 1320 3510 1810.00 a20 8400 550 600 1090 4890 2193.33 a21 9150 440 220 820 2750 1263.33 a22 9234 610 1100 2030 3410 2180.00 a23 9801 880 720 1750 2850 1773.33 a24 10044 600 1150 2640 3620 2470.00 a25 10336 880 280 880 4340 1833.33 a26 14200 2360 1430 3240 10000 4890.00 a27 18584 2150 990 3470 9890 4783.33 a28 18795 2030 1650 3410 6430 3830.00 a29 20520 2200 1540 2640 5220 3133.33 a30 22875 1370 490 980 1200 890.00 a31 27974 2850 1320 2360 9000 4226.67 a32 28917 2910 1370 2040 2960 2123.33 a33 29412 2960 1650 3080 9720 4816.67 a34 30336 2970 2640 12250 29500 14796.67 a35 37600 3960 3740 8780 19170 10563.33

Average 11405.00 1067.14 796.29 2122.57 6203.14 3040.67 Huang 163

Analysis

The compression time of the run-length coding is short due to the simplicity of the method. In addition, as no enumeration of all possible sequences is required and the designation of the specified values for the don't cares is straightforward, the compression method requires the least amount of time among all the compression methods.

Although the run-length coding is uncomplicated, carrying out the Burrows-

Wheeler Transformation requires some amount of time, which is why the amount of time required by the combination of the run-length coding and the transformation is greater than that of the run-length coding only.

The average time of the modified version of the combination of the run-length coding and Burrows-Wheeler Transformation is slightly more than that of the unmodified version due to the time required to perform the analysis of whether or not to store the original sequence.

Because of the repetition of seeking the primitive shapes, the compression time of the shape-related compression schemes is longer than that of the run-length coding or the combination of the run-length coding and the Burrows-Wheeler Transform.

The compression time of the proposed method is longer than the former method's time because of the additional shapes and four-bit by four-bit blocks, which require more frequent searches for the appropriate bits in test sets. However, it is mentioned in [8] that the increase in the compression time is allowed as such an increment does not impact the overall test time. Therefore, the performance of the proposed compression method is still better than the former and other contemporary methods because of its higher compression ratios. Huang 164

Distributions of the Shapes

Having the knowledge of the distributions of the shapes or blocks employed in the two shape-related methods - former primitive shape and proposed shape-oriented - permits the understanding of the behaviour of the methods in greater detail. Therefore, the number of employed shapes or blocks is gathered and shown in the tables A26-A33, and the related investigation is performed in the second part of the experimental results of

Chapter 5. In tables A26 to A31, the quantities of uncompressed blocks, all-zero or all- one blocks, points, lines, triangles, and rectangles employed by both compression methods according to the predefined sizes of the partitioned blocks are collected and the averages are calculated; the gathered and calculated data are displayed side by side to show any discrepancy between the two methods. While the quantities of extended lines, imperfect triangles, and extended triangles are displayed in table A32, the amounts of extended rectangles, homogeneous four-bit by four-bit blocks, and heterogeneous four-bit by four-bit blocks are shown in table A33. The overall averages shown at the last rows of all the tables are employed to construct figure 5.5 for displaying the numbers in a graphical fashion. Huang 165

Uncompressed Block

Table A26 Quantities of and Average Numbers of Uncompressed Blocks Employed by Shape-Related Compression Methods

Uncompressed Block Former Method Proposed Method Test Set 8x8 16x16 32x32 8x8 16x16 32x32 Block Block Block Block Block Block al 10 4 2 6 3 2 a2 0 0 0 0 0 0 a3 15 7 2 11 4 1 a4 11 4 3 5 1 0 a5 6 3 0 2 0 0 a6 0 0 0 0 0 0 a7 0 0 0 0 0 0 a8 1 0 1 0 0 0 a9 0 0 0 0 0 0 alO 7 4 2 10 6 1 all 2 2 1 2 2 1 al2 0 0 0 0 0 0 al3 0 0 0 1 0 0 al4 16 5 4 9 2 1 al5 0 0 0 0 0 0 al6 10 3 3 5 1 0 al7 6 1 0 3 0 0 al8 0 0 0 0 0 0 al9 0 0 0 0 0 0 a20 6 1 0 5 0 0 a21 0 0 0 0 0 0 a22 10 0 0 1 0 0 a23 9 1 0 3 0 0 a24 0 0 0 0 0 0 a25 77 26 7 65 20 4 a26 3 0 0 2 1 0 a27 0 0 0 0 0 0 a28 2 0 0 0 0 0 a29 59 23 8 52 16 4 a30 56 15 5 45 5 0 a31 41 9 0 29 3 0 a32 22 3 1 16 2 0 a33 1 0 0 1 0 0 a34 0 0 0 0 0 0 a35 4 1 0 1 0 0

Average 10.69 3.20 1.11 7.83 1.89 0.40 Overall 5.00 3.37 Average Huang 166

All-Zero or All-One Block

Table A27 Quantities of and Average Numbers of All-Zero or All-One Blocks Employed by Shape-Related Compression Methods

All-Zero or All-One Blocks Former Method Pro nosed Method Test Set 8x8 16x16 32x32 8x8 16x16 32x32 Block Block Block Block Block Block al 1 0 0 2 0 0 a2 22 4 2 24 4 2 a3 2 0 0 4 0 0 a4 0 0 0 8 2 0 a5 10 3 1 23 7 2 a6 23 2 1 26 2 1 a7 42 6 0 44 8 2 a8 11 0 0 32 0 0 a9 57 11 3 61 12 2 alO 5 2 0 22 4 0 all 49 11 2 49 7 0 al2 63 4 0 70 6 0 al3 10 0 0 16 1 0 al4 17 2 0 29 2 0 al5 92 15 2 94 21 1 al6 35 0 0 49 8 0 al7 32 1 0 43 1 0 al8 113 14 1 114 19 0 al9 82 13 0 85 16 0 a20 42 0 0 58 5 0 a21 104 17 0 109 13 0 a22 48 3 1 56 4 1 a23 66 10 0 87 13 0 a24 63 6 0 70 8 0 a25 9 0 0 41 7 2 a26 72 5 3 94 14 2 a27 200 34 2 222 42 5 a28 135 10 0 151 23 7 a29 31 0 0 83 14 3 a30 35 0 0 99 12 0 a31 38 0 0 134 20 0 a32 105 9 0 175 20 1 a33 183 19 4 248 40 10 a34 287 41 2 311 44 3 a35 236 14 0 266 43 3

Average 66.29 7.31 0.69 85.69 12.63 1.34 Overall 24.76 33.22 Average Huang 167

Point

Table A28 Quantities of and Average Numbers of Points Employed by Shape-Related Compression Methods

Point Former Method Proposed Method Test Set 8x8 16x16 32x32 8x8 16x16 32x32 Block Block Block Block Block Block al 4 6 11 5 5 8 a2 5 3 2 0 2 0 a3 17 12 30 12 6 11 a4 26 27 26 8 12 13 a5 30 28 27 10 11 7 a6 17 15 13 14 11 8 a7 9 8 0 3 5 3 a8 31 32 26 22 17 17 a9 22 16 14 15 13 13 alO 93 71 54 49 37 • 22 all 58 45 39 53 42 35 al2 25 19 17 25 21 12 al3 53 39 36 57 39 35 al4 76 72 65 84 53 62 al5 7 12 9 1 7 5 al6 63 60 54 39 36 32 al7 53 42 42 38 27 25 al8 15 22 18 5 13 9 al9 42 35 35 32 35 21 a20 50 36 39 35 31 35 a21 41 41 32 38 33 32 a22 47 '38 34 43 44 37 a23 70 51 44 38 28 31 a24 52 32 28 49 29 23 a25 46 20 72 32 13 26 a26 120 89 73 82 64 46 a27 55 48 38 38 33 26 a28 108 99 75 66 62 52 a29 208 122 94 174 88 29 a30 99 100 97 32 42 42 a31 146 133 184 81 84 91 a32 211 210 168 124 87 92 a33 258 221 198 217 188 178 a34 92 67 57 70 55 45 a35 203 159 131 161 121 98

Average 70.06 58.00 53.77 50.06 39.83 34.89 Overall 60.61 41.59 Average Huang 168

Line

Table A29 Quantities of and Average Numbers of Lines Employed by Shape-Related Compression Methods

Line Former Method Pro posed Method Test Set 8x8 16x16 32x32 8x8 16x16 32x32 Block Block Block Block Block Block al 15 28 37 16 22 33 a2 3 1 2 0 0 1 a3 19 25 51 16 14 8 a4 51 51 58 12 18 37 a5 52 40 43 22 21 31 a6 18 11 13 6 11 7 a7 4 3 5 0 3 3 a8 64 35 31 17 18 24 a9 15 10 8 8 8 10 alO 84 77 76 45 36 38 all 42 40 47 19 32 32 al2 23 19 14 10 14 17 al3 80 68 56 37 51 67 al4 76 107 109 56 61 86 al5 0 1 1 0 1 2 al6 89 85 79 38 50 57 al7 97 81 95 37 33 48 al8 12 6 8 10 5 6 al9 27 18 27 13 16 15 a20 91 80 92 33 47 66 a21 37 26 27 23 28 27 a22 92 63 67 36 50 56 a23 110 95 92 48 38 69 a24 90 66 56 35 51 58 a25 88 65 103 41 19 37 a26 150 151 152 78 82 79 a27 60 41 34 18 17 16 a28 155 114 105 64 70 73 a29 291 188 168 139 98 47 a30 407 315 240 93 116 135 a31 490 356 403 102 140 203 a32 422 362 307 131 180 202 a33 240 175 154 101 84 106 a34 100 79 70 29 41 49 a35 303 237 253 125 121 165

Average 111.34 89.11 88.09 41.66 45.60 54.57 Overall 96.18 47.28 Average Huang

Triangle

Table A30 Quantities of and Average Numbers of Triangles Employed by Shape- Related Compression Methods

Triangle Former Method Pro posed Method Test Set 8x8 16x16 32x32 8x8 16x16 32x32 Block Block Block Block Block Block al 1 4 3 2 3 4 a2 0 2 2 1 1 1 a3 3 2 8 3 2 4 a4 2 5 3 3 4 4 a5 3 2 2 1 1 1 a6 2 4 3 3 3 4 a7 0 0 0 0 2 1 a8 6 10 10 5 5 7 a9 1 1 1 0 0 0 alO 17 19 15 10 9 9 all 4 4 5 8 3 7 al2 3 2 5 5 4 5 al3 7 7 5 11 11 8 al4 23 17 16 10 7 9 al5 0 2 3 0 0 3 al6 11 11 6 5 9 8 al7 12 18 21 2 2 10 al8 4 8 4 2 7 6 al9 6 9 11 1 5 8 a20 12 14 11 9 12 12 a21 0 0 0 0 0 0 a22 17 19 17 11 13 9 a23 3 10 7 8 14 16 a24 8 14 12 10 13 5 a25 11 8 14 6 2 3 a26 42 38 32 29 31 27 a27 6 9 8 6 10 11 a28 26 23 20 19 17 19 a29 55 40 37 49 35 10 a30 8 12 15 6 6 10 a31 24 17 33 16 16 18 a32 21 31 29 32 25 24 a33 17 23 18 22 26 26 a34 17 23 20 15 20 18 a35 56 55 47 57 50 54

Average 12.23 13.23 12.66 10.49 10.51 10.31 Overall 12.70 10.44 Average Huang 170

Rectangle

Table A31 Quantities of and Average Numbers of Rectangles Employed by Shape- Related Compression Methods

Rectangle Former Method Pro nosed Method Test Set 8x8 16x16 32x32 8x8 16x16 32x32 Block Block Block Block Block Block al 9 4 2 3 2 4 a2 0 2 1 0 0 0 a3 5 1 2 2 0 3 a4 6 6 7 3 0 1 a5 3 4 4 1 0 2 a6 4 4 2 4 2 4 a7 0 2 0 1 0 1 a8 9 18 13 6 10 5 a9 0 2 2 4 0 0 alO 19 13 5 6 7 0 all 0 4 2 4 6 4 al2 8 10 10 3 3 0 al3 19 23 23 15 16 17 al4 12 14 7 10 13 13 al5 0 0 3 0 1 1 al6 . 9 11 5 1 5 5 al7 25 25 12 12 7 14 al8 1 8 8 0 2 4 al9 6 7 5 5 4 3 a20 18 24 14 11 14 9 a21 0 0 0 0 0 0 a22 18 28 28 13 11 15 a23 16 17 15 6 5 14 a24 15 22 27 10 11 14 a25 33 13 10 2 5 2 a26 17 28 28 14 14 18 a27 8 6 8 4 9 8 a28 13 13 15 36 5 3 a29 69 45 30 34 13 8 a30 96 55 32 54 12 14 a31 92 78 61 21 17 24 a32 95 53 40 32 29 19 a33 13 19 17 15 11 6 a34 21 20 20 23 21 17 a35 61 83 72 40 42 31

Average 20.57 18.91 15.14 11.29 8.49 8.09 Overall 18.21 9.29 Average Huang 171

Extended Line, Imperfect Triangle, and Extended Triangle

Table A32 Quantities of and Average Numbers of Extended Lines, Imperfect Triangles, and Extended Triangles Employed by Shape-Related Compression Methods

Proposed Method Extended Line Imperfect Triangle Extended Triangle Test Set 8x8 16x16 32x32 8x8 16x16 32x32 8x8 16x16 32x32 Block Block Block Block Block Block Block Block Block al 1 1 0 1 1 0 1 0 0 a2 0 0 0 0 1 2 0 0 0 a3 3 0 0 0 0 0 0 0 0 a4 11 12 6 0 0 0 1 0 0 a5 11 8 1 1 1 1 3 0 0 a6 2 3 0 1 0 1 0 0 0 a7 0 0 1 0 0 0 0 0 0 a8 16 7 3 5 3 1 1 0 1 a9 2 3 1 0 0 0 0 0 0 alO 6 3 5 2 1 2 0 0 0 all 2 0 0 2 1 2 0 0 0 al2 4 3 2 2 0 1 0 0 0 al3 2 5 0 7 5 2 1 1 0 al4 13 0 0 3 4 6 0 0 0 al5 0 0 0 0 0 0 0 0 0 al6 19 13 8 2 2 2 0 0 0 al7 14 15 3 2 1 1 0 0 0 al8 1 1 0 0 2 2 2 1 0 al9 2 2 0 1 1 2 1 0 1 a20 14 8 4 4 0 0 2 2 1 a21 3 0 0 0 0 0 0 0 0 a22 8 6 4 7 4 2 1 1 0 a23 20 22 4 7 8 4 2 2 0 a24 6 5 4 6 6 4 3 5 0 a25 30 16 7 1 1 0 0 0 0 a26 24 20 8 12 7 4 3 0 2 a27 12 10 6 2 1 1 4 1 0 a28 12 17 15 3 4 2 3 0 0 a29 39 18 7 11 4 1 3 0 0 a30 125 88 49 0 2 1 2 0 0 a31 151 83 39 7 . 5 4 1 2 1 a32 106 59 37 14 4 1 1 0 0 a33 59 39 21 3 2 0 4 1 1 a34 17 14 9 5 4 3 9 4 0 a35 42 41 18 16 11 10 11 6 2

Average 22.20 14.91 7.49 3.63 2.46 1.77 1.69 0.74 0.26 Overall 14.87 2.62 0.90 Average Huang 172

Extended Rectangle, Homogeneous 4x4 Block, and Heterogeneous 4x4 Block

Table A33 Quantities of and Average Numbers of Extended Rectangles, Homogeneous 4x4 Blocks, and Heterogeneous 4x4 Blocks Employed by Shape-Related Methods

Proposed Method Extended Rectangle 4x4 Block (Homo) 4x4 Block (Hetero.) Test Set 8x8 16x16 32x32 8x8 16x16 32x32 8x8 16x16 32x32 Block Block Block Block Block Block Block Block Block al 3 1 0 6 12 0 8 12 0 a2 0 0 0 20 16 0 0 0 0 a3 1 1 0 10 20 15 6 28 57 a4 2 2 2 17 22 16 23 26 32 a5 1 1 0 1 5 .7 1 7 1 a6 0 1 0 15 2 2 1 2 2 a7 0 1 0 28 0 0 0 0 0 a8 1 2 2 22 21 6 2 3 2 a9 0 0 0 12 0 0 0 0 0 alO 6 6 1 25 12 36 3 20 68 all 1 2 1 17 23 40 5 5 8 al2 1 0 0 4 9 19 2 3 5 al3 3 2 0 17 0 0 7 0 0 al4 3 1 0 15 18 18 7 53 17 al5 0 0 0 16 0 0 0 0 0 al6 11 3 1 18 2 8 14 2 11 al7 9 7 2 46 50 25 30 44 39 al8 0 0 0 44 8 20 0 0 1 al9 1 1 0 55 1 27 3 3 13 a20 4 1 5 54 18 0 12 14 0 a21 0 0 0 4 8 0 4 4 0 a22 3 5 6 85 36 0 15 8 0 a23 8 6 2 28 27 0 8 17 0 a24 6 3 2 79 4 35 5 4 • 13 a25 17 8 4 8 13 16 14 43 120 a26 5 8 2 74 30 26 6 10 54 a27 3 1 1 51 0 0 1 0 0 a28 1 5 2 164 55 0 10 13 0 a29 17 15 5 57 48 76 35 140 372 a30 25 22 7 59 112 246 81 160 298 a31 53 31 17 84 76 101 80 100 131 a32 20 12 9 170 89 104 54 79 80 a33 7 3 2 11 3 0 5 13 0 a34 1 3 1 119 15 0 5 1 0 a35 12 22 20 280 76 35 28 32 29

Average 6.43 5.03 2.69 49.00 23.74 25.09 13.57 24.17 38.66 Overall 4.71 32.61 25.47 Average