Decimal to other codes conversions To convert decimal number into other system

# Decimal to other codes conversions to convert decimal

This preview shows page 21 - 24 out of 82 pages.

Decimal to other codes conversions: To convert decimal number into other system with base ‘ r ’, divide integer part by r and multiply fractional part with r . Other codes to Decimal Conversions: Hexadecimal to Binary: Convert each Hexadecimal digit into 4 bit binary. 2 16 1111) (0101 1010 (5 ) 5 AF A F Binary to Hexadecimal: Grouping of 4 bits into one hex digit. Octal to Binary and Binary to Octal: Same procedure as discussed above but here group of 3 bits is made. Codes: Binary coded decimal (BCD): In BCD code each decimal digit is represented with 4 bit binary format. 10 9 4 9 :(943) 1001 0100 0011 BCD Eg It is also known as 8421 code Invalid BCD codes Total Number possible Valid BCD codes 10 Invalid BCD codes These are 1010, 1011, 1100, 1101, 1110, and 1111 Excess-3 code: (BCD + 0011) It can be derived from BCD by adding ‘3’ to each coded number. It is unweighted and self-complementing code. 2 1 0 1 2 10 ( . ) (A) r x x x y y 2 1 2 2 1 0 1 2 A x r x r x y r y r   2 16 (110101.11) 0011 0101.1100 (35.C) 4 2 16 16 10 6
ECE FORMULA BOOK 3. DIGITAL ELECTRONICS AND CIRCUITS [77] Published by: ENGINEERS INSTITUTE OF INDIA . ALL RIGHTS RESERVED Gray Code: It is also called minimum change code or unit distance code or reflected code. Binary code to Gray code: Gray code to Binary code: Alpha Numeric codes: EBCDIC (Extended BCD Interchange code) It is 8 bit code. It can represent 128 possible characters. Parity Method is most widely used schemes for error detection. Hamming code is most useful error correcting code. BCD code is used in calculators, counters. Complements: If base is r then we can have two complements. (i) (r – 1)’ s complement. (ii) r’ s complement. To determine (r–1)’s complement : First write maximum possible number in the given system and subtract the given number. To determine r’ s complement: (r–1)’ s complement + 1 First write (r–1)’ s complement and then add 1 to LSB Example: Find 7’ s and 8’ s complement of 2456 7777 5321 2456 1 7's complement 8's complement 5321 5322 Find 2’s complement of 101.110 1’s complement 010.001 For 2’s complement add 1 to the LSB 010.001 1 2'scomplement 010.010 + 1 0 0 1 0 + + + 1 1 0 1 1 MSB MSB Binary Gray
ECE FORMULA BOOK 3. DIGITAL ELECTRONICS AND CIRCUITS [78] Published by: ENGINEERS INSTITUTE OF INDIA . ALL RIGHTS RESERVED Data Representation: Unsigned Magritude: Range with n bit Signed Magritude: Range with n bit 1’s complement: Range with n bit 2’ complement: With n bits Range In any representation +ve numbers are represented similar to +ve number in sign magnitude. 1 0 to 2 n 5 101 5 Not possible 1 1 (2 1) to (2 1) n n   6 0110 sign bit sign bit with 4 bits with 8 bits 6 1 110 1 0000110   1 1 (2 1) to (2 1) n n   6 0110 sign bit 1's complement of 6 6 1 001 1 1 2 to (2 1) n n 6 0110 sign bit 2's complement of 6 6 1 010

#### You've reached the end of your free preview.

Want to read all 82 pages?

• Summer '16
• Binary numeral system, Binary-coded decimal, Voltage source, ECE FORMULA BOOK,  Power dissipation

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern