0% found this document useful (0 votes)
5 views

DCF-Module1 points only

Uploaded by

shihankv807
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

DCF-Module1 points only

Uploaded by

shihankv807
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

MODULE 1

2. BINARY TO DECIMAL
1. DECIMAL TO BINARY Convert Binary number 11011.101 to
decimal
Convert Decimal (98.46) to Binary

Ans: 1100010.01110 …
Ans:27.625

3. DECIMAL TO OCTAL
4. OCTAL TO DECIMAL

5. DECIMAL TO HEXADECIMAL
6. HEXADECIMAL TO DECIMAL

Convert Hexadecimal number 54.D2 to


Decimal
2. OCTAL TO BINARY
1. BINARY TO OCTAL

1. BINARY TO HEXADECIMAL
1. HEXADECIMAL TO BINARY

OCTAL TO HEXADECIMAL HEXADECIMAL TO OCTAL


Negative Binary Numbers

 When a number is Sign-Magnitude 1’s Complement Method: 2’s Complement


positive, the sign is method Method:
If the number is negative
represented by 0 If the number is
In this method, number then it is represented
 When the no is is divided into two parts: using 1’s complement. negative then it is
negative, the sign is Sign bit and Magnitude. represented using 2’s
First represent the number complement. First
represented by 1 but
 If the number is with positive sign and represent the number
the rest of the number then take 1’s complement
positive then sign with positive sign and
may be represented in of that number.
bit will be 0 then take 2’s
one of three possible
ways:  if number is complement of that
negative then sign number.
1. Sign-Magnitude
method
2. 1’s Complement
method
3. 2’s complement
method bitwill be 1.
Binary Subtraction with compliments
If we want to find the difference between M and N
Difference=M-N
1’s Compliment 2’s Compliment

M>N Determine 1’s compliment of ‘ N’ Add Determine 2’s compliment of ‘ N’ Add this to M
this to M Ingnore Carry
Add carry to the result Eg: Find 1111-1010M=1111 ,
Result= 1’sCompliment(N)+M+ Carry N=1010
1111+
2’s Compliment0 1 1 0
1 0101
Ignore Carry 1
Result: 0 1 0 1

M<N Determine 1’s compliment of ‘N’ Add this to M Determine 2’s compliment of ‘N’ Add this to M
Find 1’s compliment of result\Put -ve sign in the Find ’2s compliment of result
result Put -ve sign in the result
Eg: Find 1010 - 1111 Eg: Find 1010 -1111
M=1 0 1 0 , N=1 1 1 1 M=1 0 1 0 , N=1 1 1 1
1010+ 1010+
1’s Compliment0 0 0 0 2’s Compliment 0001
1010 1011
1’s Compliment (1 0 1 0) 0 1 0 1 2’s Compliment (1011) 0 1 0 1
Put -ve Sign -0101 Put -ve Sign -0101
BINARY CODES BCD and its ADDITION
BCD or binary-coded decimal is a each
 Process of converting into binary is individual digit of a number is converted into a
binary number, and then by combining them all,
called coding
the BCD code is generated.
Codes are classified into 2 groups.
Weighted Codes DECIMAL BCD
Exhibit a specific weights assignedto the bit 8 4 2 1
position (weights)
eg– BCD, 2421, 5211 0 0000
Unweighted Codes 1 0001
Exhibit no specific weights 2 0010
assigned to the bit position Eg—Excess 3 3 0011
code , Gray code 4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
10 0001 0000
11 0001 0001

 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.

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.

Example 1: Find the sum of the BCD numbers 01000011 + 00110101

01000011BCD = 4310 and 00110101BCD = 3510


Example 2: Find the sum of the BCD numbers 01110101 + 00110101 Solution:
The decimal number of the given BCD numbers are as below:

01110101BCD = 7510 and 00110101BCD = 3510

ALPHA NUMERIC Error Correction


GRAY CODE CODE
A code which contains What is Error?
letters, numbers and
The code which exhibits only a  During transmission, digital signals suffer
single bit change from one other symbols known from noise that can introduceerrors in the
code number to the next. As as Alphanumeric codes binary bits travelling from one system to
there are no specific weight 2 types of alpha other.
assigned to the bit positions numeric codes are  That means a 0 bit may change to 1 or a 1 bit
and hence this code is an there; may change to 0.
unweighted code Parity Method for Error Detection Code
1.ASCII:(American
Convert binary to Gray Standard Code for A simple example of error-detecting code is
code Information Interchange) parity check.
It is a 7 bit code in A parity bit is attached to a group of bits to
First MSB in the binary which the decimal make the total number of 1s in agroup always
code as that of the digits are represented even or always odd
corresponding digit in the by 8421codedpreceded How to Detect and Correct Errors?
gray code and next perform by 011  To detect and correct the errors, additional
ex-or operation 2. bits are added to the data bitsat the time of
EBCDIC:(Extended transmission.
Gray to Binary Binary Coded Decimal  The additional bits are called parity bits.
Interchange Code) They allow detection or correction of the
First MSB in the gray code errors.
as that of the corresponding It is an 8 bit alpha  There are 2 types of parity, even parity
digit in the binary codeand numeric code , the & odd parity
next perform ex-or decimal digits are  Even parity : no. of 1’s should be even
operation in diagonal represented by 8421 code including parity bit (Fig.(a))
manner preceded by 111
Odd parity : no. of 1’s should be odd including
parity bit (Fig.(b ))
Error correction --- Hamming Code

 Hamming code is a set of error-correction codes that can be used to detectand correct the errors
 It is a technique developed by R.W. Hamming for error correction
 It is a 7 bit code in which 4 data bits can be transmitted
 This code contains 4 data bits (D3, D5, D6, D7) and 3 parity bits (P4, P2,P1)

D7 D6 D5 P4 D3 P2 P1

 Parity checking at the receiver can detect the presence of an error if theparity 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.

You might also like