Encoding and decoding exercise
You're taking the task too literally. All the binary stuff is just for explanation, it's not meant to be implemented.

No time now to comment it... will do it later. Learn about bit operations in the meantime.

public static String encode(int num) {
    final int translated = num + 8192;
    final int lowSevenBits = translated &amp;  0x007F; // 0b0000_0000_0111_1111
    final int highSevenBits = translated &amp; 0x3F80; // 0b0011_1111_1000_0000
    final int composed = lowSevenBits + (highSevenBits &lt;&lt; 1);
    return String.format("%04X", composed);
}


You also should always write a test:

public void test() {
    assertEquals("4000", encode(0));
    assertEquals("0000", encode(-8192));
    assertEquals("7F7F", encode(8191));
    assertEquals("5000", encode(2048));
    assertEquals("2000", encode(-4096));
}