Question: How to convert a word to binary number?

Hello, anyone know how to convert a word to 8 bits binary number ?

For example:

Here is my code:

message:=Hello
m:=convert(message,bytes);

>m:=[104,101,108,108,111]

with(Bits):

for i from 1 to 5 do:
mb[i]:=Split(m[i]);

end do;

>mb[1]:=[0,0,0,1,0,1,1] mb[2]:=[1,0,1,0,0,1,1] mb[3]:=[0,0,1,1,0,1,1] mb[4]:=[0,0,1,1,0,1,1]

  mb[5]:=[1,1,1,1,0,1,1]

 

Anycommand can add additional one column when split the words into binary to form 8 bit in each row? Any help will be highly appreciated. Thank you.

 

Please Wait...