DCF-Module1
DCF-Module1
Important topics
Ans: 1100010.01110 …
2.BINARY TO DECIMAL
4.OCTAL TO DECIMAL
5.DECIMAL TO HEXADECIMAL
6.HEXADECIMAL TO DECIMAL
8.OCTAL TO BINARY
9.BINARY TO HEXADECIMAL
10.HEXADECIMAL TO BINARY
OCTAL TO HEXADECIMAL
HEXADECIMAL TO OCTAL
BINARY ARITHMETIC
Negative Binary Numbers
Negative numbers can be distinguishable with the help of extra bit or flag called
sign bit or sign flag in Binary number representation system for signed numbers.
That’s why we use this extra bit called sign bit or sign flag. The value of sign bit
is 1 for negative binary numbers and 0 for positive numbers.
When an integer binary number is positive, the sign is represented by 0 and the
magnitude by a positive binary number.
When the number is negative, the sign is represented by 1 but the rest of the
number may be represented in one of three possible ways: Sign-Magnitude
method, 1’s Complement method, and 2’s complement method.
Sign-Magnitude method
In this method, number is divided into two parts: Sign bit and Magnitude. If the
number is positive then sign bit will be 0 and if number is negative then sign bit
will be 1. Magnitude is represented with the binary form of the number to be
represented.
Complements
Complements are used in digital computers to simplify the subtraction operation
and for logical manipulation. Simplifying operations leads to simpler, less
expensive circuits to implement the operations.
Generally, there are two types of complement of Binary number: 1’s complement
and 2’s complement.
1’s Complement Method:
Positive numbers are represented in the same way as they are represented in sign
magnitude method. If the number is negative then it is represented using 1’s
complement. First represent the number with positive sign and then take 1’s
complement of that number. To get 1’s complement of a binary number, simply
invert the given number.
2’s Complement Method:
Positive numbers are represented in the same way as they are represented in sign
magnitude method. If the number is negative then it is represented using 2’s
complement. First represent the number with positive sign and then take 2’s
complement of that number.
✓ Digital systems require to handle the data which may be numeric, alphabets
or special characters.
✓ As these digital systems operate in a binary system and hence the numerals
and alphabets are to be converted into binary format
✓ Process of converting into binary is called coding
✓ Codes are classified into 2 groups.
DECIMAL BCD
8 4 2 1
(weights)
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
10 0001 0000
11 0001 0001
. .
. .
. .
Example:The BCD or binary-coded decimal of the number 15 is 00010101.
The 0001 is the binary code of 1 and 0101 is the binary code of 5.
Any single decimal numeral [0-9] can be represented by a four bit pattern. The
procedure of encoding digits is called "Natural BCD" (NBCD), where each
decimal digit is represented by its corresponding four-bit binary value
• Step 1: Add the two BCD numbers using the rules for binary addition.
• Step 2: If a 4-bit sum is equal to or less than 9, it is a valid BCD number.
• Step 3: If a 4-bit sum is greater than 9 or if a carry-out of the 4-bit group
is generated, it is an invalid result. Add 6 (0110) to the 4-bit sum in order
to skip the six invalid BCD code words and return the code to 8421. If a
carry results when 6 is added, simply add the carry to the next 4-bit group.
In the above example, all the 4-bit BCD additions generate valid BCD numbers,
which means less than 9. So, the final correct result is 7810 = 01111000BCD.
Let’s take an example where the addition generates an invalid BCD number.
Solution:
GRAY CODE
The code which exhibits only a single bit change from one code number to the
next. As there are no specific weight assigned to the bit positions and hence this
code is an unweighted code
First MSB in the binary code as that of the corresponding digit in the gray code
and next perform ex-or operation
Gray to Binary
First MSB in the gray code as that of the corresponding digit in the binary code
and next perform ex-or operation in diagonal manner
ALPHA NUMERIC CODE
Digital system require the handling of data that consist not only of numbers but
also letters of the alphabet and certain special characters (= ,+,-,*,#)
A code which contains letters, numbers and other symbols known as Alpha
numeric codes
It is an 8 bit alpha numeric code , the decimal digits are represented by 8421 code
preceded by 111
Error Correction
What is Error?
✓ Error is a condition when the output information does not match with the
input information.
✓ During transmission, digital signals suffer from noise that can introduce
errors in the binary bits travelling from one system to other.
✓ That means a 0 bit may change to 1 or a 1 bit may change to 0.
Parity Method for Error Detection Code
To avoid this, we use error-detecting codes which are additional data added to a
given digital message to help us detect if an error occurred during transmission of
the message.
✓ To detect and correct the errors, additional bits are added to the data bits
at the time of transmission.
✓ The additional bits are called parity bits. They allow detection or
correction of the errors.
✓ The data bits along with the parity bits form a code word.
✓ There are 2 types of parity, even parity & odd parity
✓ Even parity : no. of 1’s should be even including parity bit (Fig.(a))
✓ Odd parity : no. of 1’s should be odd including parity bit (Fig.(b ))
✓ Parity checking at the receiver can detect the presence of an error if the
parity of the receiver signal is different from the expected parity.
✓ That means, if it is known that the parity of the transmitted signal is
always going to be "even" and if the received signal has an odd parity ,
then the receiver can conclude that the received signal is not correct.
✓ If an error is detected, then the receiver will ignore the received byte and
request for retransmission of the same byte to the transmitter.
D7 D6 D5 P4 D3 P2 P1