Join - Maple Help

Bits

 Join
 join a list of digits into a number

 Calling Sequence Join(digits) Join(digits, sbits)

Parameters

 digits - a list of base 2^sbits positive digits sbits - positive integer number of bits to join on

Description

 • The Join command joins the input list of integers, least significant first, into a number base 2^sbits (sbits defaults to 1), using only the first sbits bits of each digit.
 • The most common usage of this command would be for conversion of a list of bits to a number.
 • The reverse operation, converting the number to digits, is accomplished using the Split command.

Examples

Convert from binary

 > $\mathrm{with}\left(\mathrm{Bits}\right):$
 > $\mathrm{Join}\left(\left[1,1,1,1,1,1,1,1\right]\right)$
 ${255}$ (1)

Higher bits are ignored

 > $\mathrm{Join}\left(\left[3,3,3,3,3,3,3,3\right]\right)$
 ${255}$ (2)

Convert from base-4 - 2 bits

 > $\mathrm{Join}\left(\left[3,3,3,3,3,3,3,3\right],2\right)$
 ${65535}$ (3)

To number, then back to bits

 > $\mathrm{Join}\left(\left[0,1,1,0,1,1,1,1,0,1,1,1,1,0,0,1,0,1,1,1,0,1,0,1,0,1,0,0,0,1,0,0,0,0,1,1,1,0,1\right]\right)$
 ${395718860534}$ (4)
 > $\mathrm{Split}\left(395718860534\right)$
 $\left[{0}{,}{1}{,}{1}{,}{0}{,}{1}{,}{1}{,}{1}{,}{1}{,}{0}{,}{1}{,}{1}{,}{1}{,}{1}{,}{0}{,}{0}{,}{1}{,}{0}{,}{1}{,}{1}{,}{1}{,}{0}{,}{1}{,}{0}{,}{1}{,}{0}{,}{1}{,}{0}{,}{0}{,}{0}{,}{1}{,}{0}{,}{0}{,}{0}{,}{0}{,}{1}{,}{1}{,}{1}{,}{0}{,}{1}\right]$ (5)