Signed numbers
Binary numbers can be structured as signed or unsigned. For signed numbers or integers, the most significant bit dictates what sign the number is in. This requires a defined size of the binary such as BYTE, WORD, DWORD, and QWORD. A BYTE has a size of 8 bits. A WORD has 16 bits while a DWORD (double WORD) has 32 bits. A QWORD (quad WORD) has 64 bits. Basically, the size doubles as it progresses.
In our example, let's use a BYTE. Identifying a positive binary number is easy. In positive numbers, the most significant bit, or 8th bit in a byte, is 0. The rest of the bits from 0 to the 7th bit is the actual value. For a negative binary number, the most significant bit is set to 1. However, the value set from 0 to the 7th bit is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access