Communications Toolbox    

Representing Words for Binary Block Codes

Each message or codeword is an ordered grouping of symbols. The next few subsections illustrate the various ways that these symbols can be organized or interpreted as input and output. To process binary codes, see these topics:

Binary Vector Format

For binary codes, your messages and codewords can take the form of vectors containing 0s and 1s. For example, messages and codes might look like msg and code in the lines below.

In this example, msg consists of 12 entries, which are interpreted as three 4-digit (because k = 4) messages. The resulting vector code comprises three 6-digit (because n = 6) codewords, which are concatenated to form a vector of length 18. The parity bits are at the beginning of each codeword.

Binary Matrix Format

For binary codes, you can organize coding information so as to emphasize the grouping of digits into messages and codewords. If you use this approach, then each message or codeword occupies a row in a binary matrix. The example below illustrates this approach by listing each 4-bit message on a distinct row in msg and each 6-bit codeword on a distinct row in code.

Decimal Vector Format

For binary codes, your messages and codewords can take the form of vectors containing integers. Each element of the vector gives the decimal representation of the bits in one message or one codeword.

The syntax for the encode command must mention the decimal format explicitly, as in the example below. Notice that /decimal is appended to the fourth argument in the encode command.


  Block Coding Terminology Parameters for Binary Block Codes