In the digital system of logic, binary forms have core functions with respect to data processing. Binary numbers systems in which only two states are possible-0 and 1 are used in digital circuits for mathematical computations for storing information as well as information transmission. Such techniques include sign and magnitude, one’s complement and two’s complement and etc which are used to represent both positive and negative numbers in digital systems so as to enable arithmetic and logic operations to work full well.
What is Binary Number System?
Binary is a base-2 number system that uses two states 0 and 1 to represent a number. We can also call it to be a true state and a false state. A binary number is built the same way as we build the normal decimal number.
For example, a decimal number 45 can be represented as 4*10^1+5*10^0 = 40+5
Now in binary 45 is represented as 101101. As we have powers of 10 in decimal number similarly there are powers of 2 in binary numbers. Hence 45 which is 101101 in binary can be represented as:
2^0*1+2^1*0+2^2*1+2^3*1+2^4*0+2^5*1 = 45
The binary number is traversed from left to right.
What does Binary Representation Imply in Terms of Digital Electronics?
In digital electronics, the capability of binary representation is central to encoding and processing of information. Binary numbers are used in digital systems such as computer to carry out arithmetic, storing and retrieval of data and to control and organize tasks. In binary representation all information has to be given in terms of a sequence of 0s and 1s which are then used to be processed by circuits.
For example, the decimal number is 7, and in binary format by using 8 bits it is 0111.
In binary systems, there is one bit present that will represent one power of two, so even when complicated data and operations are to be managed in hardware, they exist only in simple on-off states.
Types of Binary Representations in Digital Electronics
Sign and Magnitude Representation
There are many ways for representing negative integers. One of the way is sign-magnitude. This system uses one bit to indicate the sign. Mathematical numbers are generally made up of a sign and a value. The sign indicates whether the number is positive, (+) or negative, (–) while the value indicates the size of the number.
For example 13, +256 or -574. Presenting numbers in this way is called sign-magnitude representation since the left most digit can be used to indicate the sign and the remaining digits the magnitude or value of the number.
Sign-magnitude notation is the simplest and one of the most common methods of representing positive and negative numbers. Thus negative numbers are obtained simply by changing the sign of the corresponding positive number, for example, +2 and -2, +10 and -10, etc. Similarly adding a 1 to the front of a binary number is negative and a 0 makes it positive.
For example 0101101 represents +45 and 1101101 represents -45 if 6 digits of a binary number are considered and the leftmost digit represents the sign.
But a problem with the sign-magnitude method is that it can result in the possibility of two different bit patterns having the same binary value. For example, +0 and -0 would be 0000 and 1000 respectively as a signed 4-bit binary number. So using this method there can be two representations for zero, a positive zero 0000 and also a negative zero 1000 which can cause big complications for computers and digital systems.
The 2 complement notations used to represent signed magnitude numbers are:
One’s complement
One’s Complement is a method which can be used to represent negative binary numbers in a signed binary number system. In one’s complement, positive numbers remain unchanged as before.
Negative numbers however, are represented by taking the one’s complement of the unsigned positive number. Since positive numbers always start with a 0, the complement will always start with a 1 to indicate a negative number.
The one’s complement of a negative binary number is the complement of its positive, so to take the one’s complement of a binary number, all we need to do is subtract 1’s equal to the number of digits present in the number from that number. This can also be achieved by just interchanging the digits of the number. Thus the one’s complement of 1 is 0 and vice versa.
For example One’s Complement of 1010100:
1111111
-1010100
0101011
The one’s complement of number can also be obtained by just interchanging the digits of the binary number.
2. Two’s complement
Two’s Complement is another method like one’s complement form, which we can use to represent negative binary numbers in a signed binary number system. In two’s complement, the positive numbers are exactly the same as before for unsigned binary numbers. A negative number, however, is represented by a binary number, which when added to its corresponding positive equivalent results in zero.
In two’s complement representation, a negative number is the 2’s complement of its positive number. If the subtraction of two numbers is X – Y then it can be represented as X + (2’s complement of Y).
The two’s complement is one’s complement + 1 of a number in binary.
The main advantage of two’s complement over the previous one’s complement is that there is no double-zero problem and it is a lot easier to generate the two’s complement of a signed binary number. In two’s complement arithmetic operations are relatively easier to perform when the numbers are represented in the two’s complement format.
For example to represent -27
27 in binary is: 00011011
11111111
-00011011
11100100 <– 1’s Complement
+1
11100101 <– The 2’s Complement
The above 2 are the formats that can be too long practically. So real number representations are used.
Real Number Representations
The goal is to represent a number with a decimal point in binary using the form. IEEE 754 standard defines how to encode a real number. This standard offers a way to code a number using 32 bits (as well as 64 bits), and defines three components:
- The plus/minus sign is represented by one bit, the highest-weighted bit (furthest to the left).
- The exponent is encoded using 8 bits (11 bits in 64 bit representation) immediately after the sign.
- The mantissa (the bits after the decimal point) with the remaining 23 bits(52 bits in 64 bit representation).
Analog and Digital Signals
- Analog Signals: Analog signals are of analogue type and they are characterized by being continuous in form and fluctuate smoothly. They can have a large range of applications and are used in simple radio, audio and video systems.
- Digital Signals: Digital signals are actually analogue and are spaced a good distance apart from each other and are basically any kind of data in the form of 0’s and 1’s. They are used in microprocessors, computers, telecommunication and in other digital products and devices.
Advantages
Binary System
- Simplicity in hardware design.
- Error detection and correction are not as complex as the other error control techniques.
- Effective for computer based calculations as well as computerized data archiving.
Sign and Magnitude
- They are easily understandable as well as easy to be implemented.
One’s Complement and Two’s Complement
- This in turn helps to perform arithmetic operations easily and does not result to what we call dual zeroes.
Disadvantages
Sign and Magnitude
- Zero creates problem to various operations because it has two symbols.
One’s Complement
- Dual zeroes issue.
- More complex arithmetic operations.
Two’s Complement
- At least apparently more complex to comprehend at first, but in most instances, more effective overall.
Applications
- Binary Numbers: Employed in all up-to-date computer-based processing and transmission methods.
- Sign and Magnitude: Not used actively in practice for couple of decades but still can be useful in simple educational settings.
- One’s Complement: Used in some of the older systems and networking protocols.
- Two’s Complement: Common in today’s computers performing calculations because of its effectiveness and ease in computation.
Conclusion
Binary representation is one of the core aspects of digital systems right from computing. Of the three representation methods -sign and magnitude, one’s complement, and two’s complement, each has its appropriateness concerning the complexity of summing operations. Two’s complement is preferred in most of the modern systems because it has some benefits over the other methods; arithmetic operations becomes much easier with it and there are no dual zeroes.
Frequently Asked Questions on Binary Representations in Digital Logic-FAQ’s
For what purpose is binary applied in digital electronics?
Binary is used because it is simple to implement using digital circuits, which have only two states: encoded as ‘On’ with a value of 1 and ‘Off’ with a value of 0. For this reason, binary systems are dependable and performant for electronic computations, due to their simplicity.
What is working of Two’s Complement and what is the main difference between two’s complement and one’s complement?
The main benefit of two’s complement is the fact that unlike one’d signed, it has only one option for zero term which makes arithmetic as well as detecting errors easier.
What is the info exchange rate mode established by the 754 IEEE regulation for floating-point numbers?
The IEEE 754 standard represents floating-point numbers using three components: The floating point representation of an integer is a sign bit, an exponent, or precision and a fraction. This makes it possible for a broad spectrum with the corresponding value and obtain high accuracy in mathematical computation.