0% found this document useful (0 votes)
3 views15 pages

Unit 2

The document discusses various number systems including binary, decimal, octal, and hexadecimal, detailing their bases, symbols, and applications in digital electronics. It also covers signed binary numbers, binary arithmetic, and different binary codes used for data representation, along with error detecting and correcting codes to ensure data integrity during transmission. Key advantages of digital number systems are highlighted, emphasizing their role in efficient information storage and compatibility between hardware and software.

Uploaded by

shlokparekh08
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)
3 views15 pages

Unit 2

The document discusses various number systems including binary, decimal, octal, and hexadecimal, detailing their bases, symbols, and applications in digital electronics. It also covers signed binary numbers, binary arithmetic, and different binary codes used for data representation, along with error detecting and correcting codes to ensure data integrity during transmission. Key advantages of digital number systems are highlighted, emphasizing their role in efficient information storage and compatibility between hardware and software.

Uploaded by

shlokparekh08
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

Unit 2

A number system is an ordered set of symbols known as digit with rules defined for performing
arithmetic operations like addition, subtraction, multiplication etc. Collection of such digits is
made up of two parts-integer and fractional, set apart by a radix point (.)

Binary Number System

The number system with base (or radix) two is known as the binary number system. Only two
symbols are used to represent in this system and these are 0 and 1. These are known as bits.
This system has the minimum base (0 is not possible and 1 is not useful). It is a positional
system in which each position is assigned a specific weight.
The left most bit is known as (MSB) Most significant bit and the right most bit is known as
the least significant bit (LSB). A group of four bits is known as nibble and a group of eight
bits is known as bytes.

Decimal Number System

Decimal number system is not inherently a digital number system. But it is widely used to
represent the digital information in a human readable format.

Decimal number system is a base 10 number system having 10 unique digits i.e., 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9. It is the standard number system used by human beings to represent
information in a natural way. However, a digital system cannot directly process the information
represented in decimal form, so it is converted into binary form and then processed. The base
of the decimal number system is 10. So, the value of a decimal number is calculated by the sum
of powers of 10.

Octal Number System

The octal number system is another type of digital number system used in the field of digital
electronics to represent information. It is a base 8 number system having eight unique digits
i.e., 0, 1, 2, 3, 4, 5, 6, and 7.

It is important note that the octal number system is equivalent to 3-bit binary number system
as 23 = 8. Hence, this number system can be used in computing and digital electronic
applications.
The value of an octal number is obtained by the sum of powers of 8, as 8 is the base of the octal
number system. Octal number system is used in the field of digital electronics to represent
binary information in compact form, permissions in Linux or Unix systems, IPv6 address,
binary machine code instructions, in error detection algorithms, etc.

Hexadecimal Number System

The hexadecimal number system is a base 16 number system. It has 16 digits, 0 to 9 and A to
F. Where, A represents 10, B represents 11, C represents 12, D represents 13, E represents 14,
and F represents 15. The hexadecimal number system is equivalent to a 4-bit binary number
system as 24 = 16. Thus, the value of a hexadecimal number can be calculated by the sum of
powers of 16.
In the field of digital electronics, the hexadecimal number system is used in memory address
representation, digital colours representation, low level computer programming, encoding,
assembly language programming, microcontrollers, keyboards, etc. Hexadecimal number
system creates a balance between digital representation and human readability.

The following are some key advantages of digital number systems −

 Digital number systems provide a simple and consistent way of representing and
understanding information.
 Digital number systems allow to develop efficient methods for storage and transmission
of digital information.

 Digital number systems provide methods of representing different types of information


like text, numbers, images, etc.

 Digital number systems allow to convert information from one form to full fill the needs
of applications.

 Digital number systems create compatibility between hardware and software.

Questions

Q. Convert binary number 10010110 into octal number.

First convert this into decimal number

= (10010110)2

= 1x27+0x26+0x25+1x24+0x23+1x22+1x21+0x20
= 128+0+0+16+0+4+2+0

= (150)10

Then, convert it into octal number

= (150)10

Remainder
8 150 6
8 18 2
8 2 2

= (226)8
Q. Convert binary number 10010110 into Hexadecimal number.

First convert this into decimal number

= (10010110)2

= 1x27+0x26+0x25+1x24+0x23+1x22+1x21+0x20
= 128+0+0+16+0+4+2+0

= (150)10

Then, convert it into Hexadecimal number

Remainder
16 150 6
16 8 8

= (86)16

Signed Binary Numbers

Sign-Magnitude Representation

In decimal number system a plus (+) sign is used to denote positive number and (-) sign for
denoting a negative number. The absence of any sign means that the number has positive value.
This representation of numbers is known as signed number. A digital circuit can understand
only two symbols, 0 and 1; therefore, we must use the same symbols to indicate the sign of the
number also. An additional bit known as the sign bit is placed as the most significant bit. A 0
is used is used to represent positive and a 1 to represent a negative number.
One’s Complement Representation

In binary number, if each 1 is replaced by 0 and each 0 by 1, the resulting number is known as
the one’s complement of the first number.

Two’s Complement Representation

If 1 is added to 1’s complement of a binary number, the resulting number is known as the two’s
complement of the binary number. For an n-bit number the maximum positive number that can
be represented in 2’s complement form is 2n-1 – 1 and the maximum negative number is -2n-1.
It is also observed that 2’s complement of the 2’s complement of a number is the number itself.

Binary Arithmetic

Binary Addition

Binary Subtraction

Binary Multiplication

Binary multiplication is similar to decimal multiplication


Binary Division

Binary Division is same as decimal division

2’s Complement Arithmetic

Subtraction using 2’s complement

Binary subtraction can be performed by adding the 2’s complement of the subtrahend to the
minuend. If the final carry is 0 the answer is negative
Addition/Subtraction in 2’s complement representation
CODES

Computers and digital circuits process data in binary format. Various binary codes are used to
represent data namely numeric, alphabets or special characters. Although in every code the
information represented in binary form, the interpretation of this binary form is possible only
if the code in which this information is available is known.

1. Straight Binary Code: - This used to represent numbers using natural (or straight)
binary form. Various arithmetic operations can be performed in this form. It is a
weighted code since weights are assigned at every position.

2. Natural BCD Code: - In this code decimal digits 0 through 9 represented (coded) by
their natural binary equivalent using four bits and each decimal digit of a decimal
number is represented by these four bits. For example, (23)10 is represented by 0010
0011. This code is also known as 8-4-2-1 code or simply BCD code. 8, 4, 2 and 1 are
the weights of the four bits of the binary code of each decimal digit similar to straight
binary number system

3. Excess-3 Code: - In this each decimal digit is coded into a 4-bit binary code. The code
for each decimal digit is obtained by adding decimal 3 to the natural BCD code of the
digit. For example, decimal 2 is coded as 0010 + 0011 = 0101 in Excess-3 Code. It is
not a weighted code.

4. Gray Code: - It is a very useful code in which decimal number is represented in binary
form in such a way so that each Gray-code number differs from the preceding and the
succeeding number by a single bit. For example, the gray code for 5 is 0011 and for 6
is 0101.
5. Octal Code: - It is a 3-bit binary code in which each of the octal digits 0 through 7 is
coded into 3-bit straight binary number. Code for octal digit 4 is 100. Using this code
octal numbers can be coded into straight binary form or the binary numbers.
6. Hexadecimal Code: - It is a 4-bit binary code used for input/output in digital
computers, microprocessors.
7. Alphanumeric Codes: - It is a binary code for alphabets as in many situations, digital
system may be able to handle data that may consist of numerals, letters, and special
symbols. If we use an n-bit binary code, we can represent 2n elements using this code
It is used in many alphanumeric characters and symbols internally and therefore can be
called internal code. Frequently, there is a need to represent more than 64 characters
including the lower case letters and special control characters for the transmission of
digital information. For this reason the following two codes are normally used:
 Extended BCD Interchange Code (EBCDIC)
 American Standard Code for Information Interchange (ASCII)
Error Detecting and Correcting Codes

Digital signals are processed for performing various operations and are transmitted from one
circuit or system to another circuit or system. When these binary signals are transmitted from
one location (transmitter) to another location (receiver), transmission errors may occur because
of electrical noise in the transmission channel. Due to transmission error a signal transmitted
as a 0 may be received as a 1 or vice-versa. In complex digital systems, millions of bits per
second are manipulated and it is desired to have high data integrity, or at least a violation of
data integrity must be detectable.

A digital data in the form of a code word such as BCD, ASCII etc. is transmitted and there is
always a finite probability of occurrence of an error in a single bit position. The probability of
occurrence of error in two or more-bit positions simultaneously is substantially smaller. It is
desired to detect the error in the received data word, locate its bit position and correct it. Various
codes are used for the detection and correction of error. Since the probability of simultaneous
occurrence of error in two or more-bit positions is negligibly small, therefore, we restrict our
discussion to the detection and correction of single error, i.e. error in one bit position.
Error Detecting Codes

When digital information is transmitted, it may not always be received correctly by the receiver.
At the receiving end, it is sometimes possible, but not guaranteed, to detect whether the
information has been received accurately. For example, if the BCD code for decimal 9 (1001)
is transmitted and the receiver gets 1011 instead, the error may be detected because 1011 is not
a valid BCD code. However, if the received code is 0001, which is a valid BCD code for
decimal 1, the receiver will interpret it as correct, and the error will go undetected. Thus, an
erroneous word received may or may not be valid.

To avoid incorrect interpretation, error-detecting codes are designed such that any single error
transforms a valid code word into an invalid one. In an n-bit code, there are 2ⁿ possible
combinations. To ensure error detection, only half of these possible combinations are used as
valid codes. By attaching an extra bit to the n-bit code, the system can enforce a rule—for
instance, making the total number of 1s in the resulting (n+1)-bit code always even (even
parity) or always odd (odd parity). This ensures that a single-bit error will convert the code into
an invalid word, which can then be detected.

Another way to evaluate the strength of an error-detecting code is by using the concept of
minimum distance. The minimum distance of a code is the smallest number of bit positions in
which any two valid code words differ. A code qualifies as an error-detecting code if its
minimum distance is two or more, because this guarantees that a single error will not transform
one valid code word into another valid one. In practice, error detection is often achieved by
attaching an extra bit called the parity bit to each code word. This bit is chosen so that the total
number of 1s in the code word is always even (even parity) or always odd (odd parity), thereby
enabling detection of single-bit errors.
Error Correcting Codes

When a single parity bit is added to the transmitted information, it enables the detection of
errors in a single bit position. However, the parity check only indicates that the received
message is incorrect; it does not reveal the specific bit position where the error has occurred
and therefore cannot correct the error. For example, if a 4-bit binary word such as 0101 is
transmitted with an even parity bit, and a single-bit error occurs during transmission, the
received message may become 00100, 00111, 00001, or 01101, depending on which bit was
corrupted.

To examine this further, consider whether these erroneous words could also arise from some
other valid transmitted word. If 01100 is sent, but due to an error in the third bit position it
becomes 00100, then the receiver may misinterpret it. Similarly, errors in other bit positions of
different words can also lead to the same erroneous outputs. This shows that if the minimum
distance between valid code words is only two, then it is not possible to uniquely identify the
bit position of the error. Hence, for a code to be error-correcting, its minimum distance must
be greater than two.

When the minimum distance is three, every single-bit error results in an invalid code word that
is one bit away from the original code and at least two bits away from any other valid code
word. In this way, the error can be both detected and located. Once the erroneous bit is located,
it can be inverted to restore the correct code word.

In general, a code is called error-correcting if the correct code word can be recovered from the
erroneous one. The error-detecting and error-correcting capability of a code is determined by
its minimum distance. Specifically, if a code has a minimum distance of 2c+d+1, it can correct
up to ccc errors and detect up to odd errors with the help of additional bits.

You might also like