# Marked Binary Numbers / Signed Binary Numbers

Uses msb as a cue bit to display a range of marked binary numbers, positive numbers, or negative numbers.

In mathematics, positive numbers (including zero) are represented as unsigned numbers.So we don't put the + sign in front of them to show that they are positive numbers.

However, when dealing with negative numbers, we use a – sign in front of the number to indicate that the number is negative in value and different from a positive unmarked value, and the same applies **to binary numbers marked.**

However, since numerical systems in numerical circuits work with binary numbers represented by "0s" and "1s", there is no provision to put a plus or even minus sign on a number.When used in conceived with microprocessors or microcontrollers, this is called **lice** "1s" and " 0s" **(short** for BI nary digi **T). **

We have also previously seen that an 8-bit binary number (one byte) can have a value between 0 (00000000 2) and 255 (111111111 _{2),} that is, a combination of 2 8 = 256 different bits that make up a single _{} ^{8-bit} number.For example, an unmarked binary number such as _{2} = 64 + 8 + 4 + 1 = 77_{10,} 01001101 in de deities.However, digital systems and computers should be able to use and change negative numbers as well as positive numbers.

Mathematical numbers usually consist of a sign and a value (magnitude) that indicates that the number is positive, ( + ) or negative, and a value that indicates the magnitude of the number, such as 23, +156, or -274.Presenting numbers is called a "sign-magnitude" representation because the leftmost digit can be used to indicate the sign, and the remaining digits indicate the size or value of the number.

Sign-size notation is one of the simplest and most common methods of representing positive and negative numbers on both sides of zero ( 0 ).Thus, negative numbers are obtained by changing the sign of the corresponding positive number, since each positive or unmarked number will have a marked opposite, such as +2 and -2, +10 and -10, and so on.

But if all we have is one and zero, how do we represent marked binary numbers?We know that binary digits or bits have only two values, "1" or "0", and for us, a sign has only two values, " **+** " or " **–** " .

Next, we can use a single bit to define the sign of a *marked binary number* as positive or negative as a value .This means that we can use them by adding a sign to represent a positive binary number ( +n ) and a negative ( -n ) binary number.

The most meaningful bit (MSB) is used as the mark bit for marked binary numbers.If the mark bit is "0", it means that the number is positive as a value.If the mark bit is "1", the value of the number is negative.The remaining bits in the number are used to represent the size of the binary number in the usual unmarked binary number format.

Next, we can see that the Mark and Magnitude (SM) representation stores positive and negative values by dividing the total bit "n" into two parts: 1 bit for the mark and n–1 bit for the value, which is a pure binary.For example, a deger number of 53 can be expressed as a binary number marked 8 bits as follows.

The disadvantage here is that we previously had a fully spaced n-bit unmarked binary number, but now we have a binary number marked n-1 bit and give a lower range of numbers than the following:

-2 ^{(n-1)} vs. +2 ^{(n-1)}

For example: if we have 4 bits to represent a marked binary number (1 **bit** for **sign bit** and 3 **bits** for **magnitude bits),** then the actual number range that we can represent in the sign size representation:

-2 ^{(4-1)} – 1 to +2 ^{(4-1)} – 1

-2 ^{(3)} – 1 to +2 ^{(3)} – 1

-7 vs. +7

Previously, the range of an unmarked binary number of 4 bits was from 0 to 15 or 0 to F in hexagons, but now we have a reduced range from -7 to +7.Therefore, an unmarked binary number does not have a single sign bit, and therefore the most meaningful bit (MSB) can have a larger binary range than an extra bit or number instead of a cue bit used.

Another drawback of the sign size form here is that it is a positive result for zero, +0 or 0000_{2,} and a negative result for zero, -0 or 1000_{2} .Both are valid, but we can't decide which one is right.

### Marked Binary Number Question Example 1

Use the mark size format to convert the following decathlete values to marked binary numbers:

-15_{10} as a 6-bit number | ⇒ | 1 01111 _{2} |

+23_{10} as a 6-bit number | ⇒ | 0 10111 _{2} |

-56_{10} as an 8-bit number | ⇒ | 1 0111000 _{2} |

+85_{10} as an 8-bit number | ⇒ | 0 1010101 _{2} |

-127_{10} as an 8-bit number | ⇒ | 1 11111111 _{2} |

For a binary number marked 4-bit, 6-bit, 8-bit, 16-bit, or 32-bit, all bits must have a value, so "0s" are used to fill in the gaps between them and the leftmost cue bit. the first or maximum value must be "1".

The sign size representation of a binary number is a simple method to use and understand to represent marked binary numbers, since in mathematics we always use this system with normal deprecation (base 10) numbers.If the binary number is negative, "1" is added in front of it, and "0" is added if positive.

However, the use of this sign size method may result in the possibility of two different bit patterns with the same binary value.For example, +0 and -0 are 0000 and 1000, respectively, as signed 4-bit binary numbers.Using this method there, you can have two representations for zero, a positive zero (which you can see is 0 000 _{2),} and also a negative zero (1 000 _{2} can cause major complications for computers and digital systems).

## Complement of One's Binary Number

It is another method that we can use to represent negative binary numbers in a marked binary number system, also called **Complementary** of One.In someone's integer, positive numbers (also known as non-complementary ones) remain unchanged, as in sign-sized numbers.

However, negative numbers are represented by taking the inversion (inversion, neanation) of the unmarked positive number.Since positive numbers always begin with "0", the integration will always begin with "1" to indicate a negative number.

The one-to-one integer of a negative binary number is the integer of its positive response, that is, all we have to do to get the integer of a binary number is to replace each bit sequenciously.Therefore, "1", which is complementary to one "0" or vice versa, then complementary 10010100 _{2} is simply 01101011 _{2} all 1 1's 0 and 0' s are changed.

When installing numeric arithmetic or logic decoder circuits, the easiest way to find the integer of a marked binary number is to use an inverter.The inverter is naturally a complementary generator and can be used in parallel to find the integer of 1 of any binary number, as shown.

Also, like the previous sign size notation, the intemer can have ^{n-bit} notation to represent numbers in the range ^{-2 (n-1)} and +2 (n-1) – 1.For example, a 4-bit representation in the intelicular format of one can be used with two zero representations to represent deprecation numbers between -7 and +7: 0000 (+0) and 1111 (-0) the same as before .

### Collecting and Subtract Using a Complement to One

One of the main advantages of complementing **one**is the collection and subtracting of two binary numbers.In mathematics, subtraction can be applied in various ways, such as A – B, the same as A + (-B) or -B + A, etc. Therefore, the complexity of issuing two binary numbers can simply be done.

In binary Gatherer training, we found that binary aggregation follows the same rules as regular aggregation, except that there are only two bits (digits) in the binary system, and the largest digit is "1" (just as "9" is the largest). decimal places) so the possible combinations for binary aggregation are as follows:

0 | 0 | 1 | 1 | |

+ 0 | + 1 | + 0 | + 1 | |

0 | 1 | 1 | 1← 0 | (0 plus one move 1) |

When both numbers to be added are positive, the sum A + B can be combined together directly through the total (including the number and bit mark), since when single bits are added together, the sum "0 + 0", "0 + 1" or "1 + 0" results in "0" or "1".This is because the result is "1" if the two bits that we want to collect are single ("0" + "1" or "1 + 0").Likewise, when there are two bits of pairs to add ("0 + 0" or "1 + 1"), the result is "0", until "1 + 1", the total is equal to "0" plus a. Move "1".Let's look at a simple example.

### Subtracting Two Binary Numbers

The following two numbers, 115 and 27, require an 8-bit digital system to distinguish between each other using one's integer.So in de deseds, this is as follows: 115 – 27 = 88 .

First we need to convert two deacation numbers to binary numbers and make sure that each number is the same number of bits by adding the leading zeros to produce an 8-bit number (bytes).Then:

115 _{10} doubles : 01110011 _{2}

27 _{10} doubles : 00011011 _{2}

Now we need to find the integer of the second binary number (00011011) while leaving the first number (01110011) unchanged.So 1s 0s and 0s change all 1s, 00011011 to the intemer of one, so —> 11100100 .

Adding the integer of the first number and the second number returns:

01110011 |

+ 11100100 |

overflow → 1 01010111 |

Since the numerical system will work with 8 bits, only the first eight digits are used to provide the answer to the total, and we only ignore the last bit (bit 9).This bit is called an "overflow" bit.Overflow occurs when the sum of the most important (leftmost) column produces a forward move.This overflow or transport bit can be completely destroyed or passed to the next digital partition for use in its calculations.Overflow indicates that the answer is positive.If there is no overflow, the answer is negative.

The above 8-bit result: 01010111 ("1" cancels overflow) and to reverse it from the inteclusive response of one to the actual answer, we must now add "1" to the inteclusive result of one, so:

01010111 |

+ 1 |

01011000 |

Therefore, the result of subtract from 115 ( 01110011 2 ) _{2} ( 00011011 2 ) using the complement of _{1} in pairs gives the following answer: decimal 01011000 _{2} or (64 + 16 + 8) = 88 _{10} ._{}_{}_{}

Next, we can see that binary numbers marked or unmarked can be subtract from each other using the Complement of **One** and aggregation process.Binary collectors, such as TTL 74LS83 or 74LS283, can be used to add or remove two 4-bit marked binary numbers, or they can be cascaded together to produce 8-bit collectors complete with execution.

## Complement to Two's Marked Binary Number

It is also called **Complementary of Two** or Complement of **2,** another method that we can use to represent negative binary numbers in a marked binary number system, such as the previous sign size and the integer form of one.In the integer of two, positive numbers are exactly the same as before for unmarked binary numbers.However, a negative number is represented by a binary number that results in zero when added to its corresponding positive equivalent.

In the integer form of two, a negative number is the integer of the positive number 2, and the subtracting of the two numbers is basically the integration of two, using almost the same process as the previous one, A – B = A + ( the integer of 2).

The main advantage of the two integrations over the complement of the previous one is that there are no double zero problems, and it is much easier to create an integer of a signed binary number of the two.Therefore, arithmetic operations are relatively easy to perform when the numbers are represented in the integer format of the two.

Let's look at the removal of our two 8-bit numbers 115 and 27 from above using the integer of the two and remember that there are binary equivalents from above:

115_{10} doubles : 01110011_{2}

27_{10} doubles : 00011011_{2}

Our numbers are 8 bits long, then there are 2^{8} digits to represent our values, and in pair this is equal to: 1000000000 _{2} or 256_{10} .Then the intemer of the two to_{27 10}will be as follows:

(2 ^{8} ) _{2} – 00011011 = 100000000 – 00011011 = 11100101 _{2}

The integer of the second negative number means that the subtraction is much easier to collect two numbers, so the total is: 115 + (integer of 27 of 2):

01110011 + 11100101 = **1** 01011000 _{2}

As before, the 9th overflow bit is not taken into account, since we are only interested in the first 8 bits, so the result is: 01011000 _{2} or (64 + 16 + 8) = 88 _{10} decimals the same as before.

## Summarize

We found that negative binary numbers can be represented as sign bits using the most meaningful bit (MSB). The n-bit binary number represents the number of bits n-1 used to represent the sign by leaving the bit on the left that is signed.

For example, in a 4-bit binary number, this leaves only 3 bits to hold the actual number.However, if the binary number is unchecked, all bits can be used to represent the number.

The representation of a marked binary number is generally referred to as *sign size notation,* and if the cue bit is "0", the number is positive.If the mark bit is "1", the number is negative.When dealing with binary arithmetic operations, it is more convenient to use the integer of the negative number.

Completion is an alternative way to represent negative binary numbers.This alternative encoding system allows the extraction of negative numbers using simple aggregation.

Because numbers the size of a positive sign always start with zero (0), the complement will therefore always start with one (1) to indicate a negative number, as shown in the following table.

Decimal | Marked Size | Marked Complement | Complement to Marked Two |

+7 | 0111 | 0111 | 0111 |

+6 | 0110 | 0110 | 0110 |

+5 | 0101 | 0101 | 0101 |

+4 | 0100 | 0100 | 0100 |

+3 | 0011 | 0011 | 0011 |

+2 | 0010 | 0010 | 0010 |

+1 | 0001 | 0001 | 0001 |

+0 | 0000 | 0000 | 0000 |

-0 | 1000 | 1111 | – |

-1 | 1001 | 1110 | 1111 |

-2 | 1010 | 1101 | 1110 |

-3 | 1011 | 1100 | 1101 |

-4 | 1100 | 1011 | 1100 |

-5 | 1101 | 1010 | 1011 |

-6 | 1110 | 1001 | 1010 |

-7 | 1111 | 1000 | 1001 |