Correcting error while reading a number in binary format
First: I assume 1111 and 1001 are read as -1 and -7 (Not -7 and -1!).
Second: I assume for some reason your computer is working with 4 bit values.
I am going to use unsigned 8 bit variables for those for now.

The simplest way to combine the two four bit values back to an 8 bit value is to concatenate the bits:

#include &lt;stdint.h&gt;

int8_t u8;
uint8_t u4a,u4b;

  u4a = 0x0F; // '-1' in 4 bits
  u4b = 0x09; // '-7' in 4 bits

  u8  = (u4a&lt;&lt;4)|u4b;