int i = int.Parse(s, System.Globalization.NumberStyles.BinaryNumber);
erlang:list_to_integer(S,2).
character (len=:), allocatable :: s
integer :: i
s = '1101'
read (s,'(B4)') i
The B4 format means a string of length 4. The length of the field could be adjusted by constructing the format field on the fly with an internal write.