0% found this document useful (0 votes)
25 views6 pages

1 Binary Numbers Representation

The document explains various number systems used in computing, including decimal, binary, octal, and hexadecimal systems, highlighting their symbols and positional notations. It also details the representation of signed binary numbers, including sign-magnitude, 1's complement, and 2's complement forms, along with examples. Additionally, it covers fixed-point and floating-point representations for real numbers, describing their structures and how to convert numbers into these formats.

Uploaded by

arpiarpi1663
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views6 pages

1 Binary Numbers Representation

The document explains various number systems used in computing, including decimal, binary, octal, and hexadecimal systems, highlighting their symbols and positional notations. It also details the representation of signed binary numbers, including sign-magnitude, 1's complement, and 2's complement forms, along with examples. Additionally, it covers fixed-point and floating-point representations for real numbers, describing their structures and how to convert numbers into these formats.

Uploaded by

arpiarpi1663
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Number Systems

Human beings use decimal (base 10) number systems for counting and measurements. Computers
use binary (base 2) number system, as they are made from binary digital components (known as
transistors) operating in two states - on and off. In computing, we also use hexadecimal (base 16)
or octal (base 8) number systems, as a compact form for representing binary numbers.

Decimal (Base 10) Number System

Decimal number system has ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9, called digits. It uses positional
notation. That is, the least-significant digit (right-most digit) is of the order of 10^0 (units or ones), the
second right-most digit is of the order of 10^1 (tens), the third right-most digit is of the order
of 10^2 (hundreds), and so on, where ^ denotes exponent. For example,

735 = 700 + 30 + 5 = 7×10^2 + 3×10^1 + 5×10^0

We shall denote a decimal number with an optional suffix D if ambiguity arises.

Binary (Base 2) Number System

Binary number system has two symbols: 0 and 1, called bits. It is also a positional notation, for
example,

10110 = 1×2^4 + 0×2^3 + 1×2^2 + 1×2^1 + 0×2^0=22

A binary digit is called a bit. Eight bits is called a byte.

Octal (Base 8) Number System

Octal number system uses 8 symbols: 0, 1, 2, 3, 4, 5, 6


and 7. It is a positional notation, for example,

735 = 7×8^2 + 3×8^1 + 5×8^0=(477)10

Hexadecimal (Base 16) Number System

Hexadecimal number system uses 16 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F,


called hex digits. It is a positional notation, for example,

A3E = 10×16^2 + 3×16^1 + 14×16^0=2622(10)

Binary Number Representation Page 1 of 6


Binary Numbers Representation for Integer Numbers

Representation of Signed Binary Numbers

The Most Significant Bit MSB𝑀𝑆𝐵 of signed binary numbers is used to indicate the sign of the numbers.
Hence, it is also called as sign bit. The positive sign is represented by placing ‘0’ in the sign bit.
Similarly, the negative sign is represented by placing ‘1’ in the sign bit.

If the signed binary number contains ‘N’ bits, then N−1𝑁−1 bits only represent the magnitude of the
number since one bit MSB𝑀𝑆𝐵 is reserved for representing sign of the number.

There are three types of representations for signed binary numbers

• Sign-Magnitude form
• 1’s complement form
• 2’s complement form

Representation of a positive number in all these 3 forms is same. But, only the representation of
negative number will differ in each form.

Example: Consider the positive decimal number +108. The binary equivalent of magnitude of this
number is 1101100. These 7 bits represent the magnitude of the number 108. Since it is positive
number, consider the sign bit as zero, which is placed on left most side of magnitude.

+108(10) = 01101100(2)

Therefore, the signed binary representation of positive decimal number +108 is 𝟎𝟏𝟏𝟎𝟏𝟏𝟎𝟎. So, the
same representation is valid in sign-magnitude form, 1’s complement form and 2’s complement form
for positive decimal number +108.

Sign-Magnitude form: In sign-magnitude form, the MSB is used for representing sign of the number
and the remaining bits represent the magnitude of the number. So, just include sign bit at the left most
side of unsigned binary number. This representation is similar to the signed decimal numbers
representation.

Binary Number Representation Page 2 of 6


Example: Consider the negative decimal number -108. The magnitude of this number is 108. We
know the unsigned binary representation of 108 is 1101100. It is having 7 bits. All these bits represent
the magnitude.

Since the given number is negative, consider the sign bit as one, which is placed on left most side of
magnitude.

−108(10) = 11101100(2)

Therefore, the sign-magnitude representation of -108 is 11101100.

1’s complement form: The 1’s complement of a number is obtained by complementing all the bits of
signed binary number. So, 1’s complement of positive number gives a negative number. Similarly, 1’s
complement of negative number gives a positive number.

That means, if you perform two times 1’s complement of a binary number including sign bit, then you
will get the original signed binary number.

Example: Consider the negative decimal number -108. The magnitude of this number is 108. We
know the signed binary representation of 108 is 01101100.

It is having 8 bits. The MSB of this number is zero, which indicates positive number. Complement of
zero is one and vice-versa. So, replace zeros by ones and ones by zeros in order to get the negative
number.

−108(10) = 10010011(2)

Therefore, the 1’s complement of 10810 is 100100112.

2’s complement form: The 2’s complement of a binary number is obtained by adding one to the 1’s
complement of signed binary number. So, 2’s complement of positive number gives a negative
number. Similarly, 2’s complement of negative number gives a positive number.

That means, if you perform two times 2’s complement of a binary number including sign bit, then you
will get the original signed binary number.

Example: Consider the negative decimal number -108.

We know the 1’s complement of (108)10 is (10010011)2

2’s compliment of 10810 = 1’s compliment of 10810 + 1.

= 10010011 + 1

= 10010100

Therefore, the 2’s complement of 10810 is 100101002.

Binary Number Representation Page 3 of 6


Binary Numbers Representation for Real Numbers

We have two major approaches for storing real numbers: Fixed and Floating-Point Representation.

Fixed Point Representation: In computers, fixed-point representation is a real data type for
numbers. Fixed point representation can convert data into binary form, and then the data is
processed, stored, and used by the computer. It has a fixed number of bits for the integral and
fractional parts.

Parts of fixed-point representation

• Sign bit:- The fixed-point number representation in binary uses a sign bit. The negative number
has a sign bit 1, while a positive number has a bit 0.
• Integral Part:- The integral part in fixed-point numbers is of different lengths at different places.
It depends on the register's size; for an 8-bit register, the integral part is 4 bits.
• Fractional part:- The Fractional part is of different lengths at different places. It depends on the
registers; for an 8-bit register, the fractional part is 3 bits.

Register Sign Bit Integer Part Fraction Part

8-bit register 1 bit 4 bits 3 bits

16-bit register 1 bit 9 bits 6 bits

32-bit register 1 bit 15 bits 9 bits

How to write numbers in Fixed-point notation?

Now that we have learned about fixed-point number representation, let's see how to represent it.

The number considered is 4.5

Step 1: We will convert the number 4.5 to binary form. 4.5 = 100.1

Step 2: Represent the binary number in fixed-point notation with the following format.

Binary Number Representation Page 4 of 6


Fixed Point Notation of 4.5

Floating Point Representation: Floating Point representation doesn't reserve any specific
number of bits for the integer or fractional parts. But instead, it reserves certain bits for the
number (called the significand or mantissa) and a fixed number of bits to say where the decimal place
lies (called the exponent).

The computer uses floating-point number representation to convert the input data into binary form. This
binary form number is converted into scientific notation, which is converted into floating-point
representation.

The floating-point representation has two types of notation:

1. Scientific notation: Scientific notation is the method of representing binary numbers into a x be form.
It is further converted into floating-point representation. For example,

Number = 32625

Number in Scientific Notation = 32.625 x 103

Number in binary form = 1101.101*2101

Here, Mantissa is 1101.101 and Base part is 2101.

2. Normalization notation: It is a special case of scientific notation. Normalized means that we have
at least one non-zero digit after the decimal point.

A floating-point representation has three parts: Sign bit, Exponent Part, and Mantissa. We can see
the below diagram to understand these parts.

Parts of floating-point representation

Sign bit:- The floating-point numbers in binary uses a sign bit. A negative number has a sign bit 1,
while a positive number has a sign bit 0. The sign of any number depends on mantissa, not on exponent.

Mantissa Part:- The mantissa part is of different lengths at different places. It depends on registers
like for a 16-bit register, and mantissa part is of 8 bits.

Binary Number Representation Page 5 of 6


Exponent Part:- It is the power of the number. It depends on the size of the register. For example, in
the 16-bit register, the exponent part is of 7 bits.

How to write numbers in Floating-point notation: Now that we have learned about floating-point
number representation, let's see how to represent it.

The number considered is 53.5

Step 1: We will convert the number 53.5 to binary form. 53.5 = 110101.1

Step 2: Normalize the number ( base is 2) = (1.101011) * 25.

Step 2: Represent the binary number in floating-point notation with the following format.

Floating Point Notation of 53.5

Binary Number Representation Page 6 of 6

You might also like