Convert from 8 bits to 16 bits

I was wondering how you convert from 8-bit add-on 2 to 16-bit 2-digit number?

1100 0110 - example

+4
source share
1 answer

It is called a sign extension . You simply repeat the most significant bit until you get the right number of bits. For your example, this will be 1111 1111 1100 0110

+8
source

Source: https://habr.com/ru/post/1441042/


All Articles