Understanding Non-Weighted Codes and Excess-3 Code in Binary Systems

Slide Note
Embed
Share

Explore non-weighted binary codes like Excess-3 code, learn how to convert decimal numbers to XS-3 code, advantages and disadvantages of BCD codes, and steps to convert Excess-3 code to binary. Discover the intricacies of binary coding systems with practical examples.


Uploaded on Apr 19, 2024 | 5 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Non-weighted code

  2. Non-Weighted Codes type of binary codes, the positional weights are not assigned. The examples of non-weighted codes are Excess-3 code Gray code.

  3. Excess -3 Code

  4. Excess-3 code The Excess-3 code is also called as XS-3 code. It is non-weighted code used to express decimal numbers. The Excess-3 code words are derived from the 8421 BCD code words adding (0011)2or (3)10 to each code word in 8421.

  5. How to find XS-3 code of decimal number steps: find the BCD code number of each digit of decimal number. Then we add 3 in each BCD code.

  6. Example 1

  7. Example 2

  8. Binary to Excess-3 code

  9. Binary to Excess-3 code

  10. The Excess-3 code for the decimal number

  11. Advantages of BCD Codes It is very similar to decimal system. We need to remember binary equivalent of decimal numbers 0 to 9 only. Disadvantages of BCD Codes The addition and subtraction of BCD have different rules. The BCD arithmetic is little more complicated. BCD needs more number of bits than binary to represent the decimal number. So BCD is less efficient than binary.

  12. Excess-3 codes The excess-3 codes are obtained as follows

  13. Excess-3 code into binary steps to convert the Excess-3 code into binary: 1.make the group of 4 bits and write the equivalent decimal number from the Excess-3 table. 2.Find the binary number of the decimal number using a decimal to binary conversion. Example 1: (01100011)Excess-3 1) Making groups of four bits and write their equivalent decimal number. (01100011)Excess-3= (0110 0011)Excess-3 From the Excess-3 table: (0110)Excess-3= (3)10 (0011)Excess-3= (0)10 So, the decimal number of excess-3 code 01100011 is: (30)10

  14. Excess-3 to binary 2) Find the binary number. Now, find the binary number of the decimal number (30)10using a decimal to binary conversion as: Divide the number 30 and its successive quotients with base 2. (30)10=(11110)2 So, the binary number of excess-3 code 01100011 is: (11110)2

  15. BCD to Ex-3 conversion

  16. Ex-3 to BCD conversion

  17. Gray Code

  18. Gray Code It is the non-weighted code and it is not arithmetic codes. That means there are no specific weights assigned to the bit position. It has a very special feature that, only one bit will change each time the decimal number is incremented As only one bit changes at a time, the gray code is called as a unit distance code. The gray code is a cyclic code as the transition of one value to its successive value carries a change of one bit only. Gray code cannot be used for arithmetic operation. Ex. 0110G=4 0111G=5

  19. Gray Code

  20. Gray Code Example: For a 2-bit Gray code, n=1. 2-bit Gray code 1-bit Gray code 0 0 1 1 0 1 1 0 00 01 11 10 0 1

  21. 2.4 Gray Code Example: For a 3-bit Gray code, n=2. 3-bit Gray code 00 01 11 10 10 11 01 00 0 0 0 0 000 001 011 010 110 111 101 100 2-bit Gray code 00 01 11 10 1 1 1 1

  22. THE GRAY CODE Decim al 0 1 2 3 4 5 6 7 Binar y 0000 0001 0010 0011 0100 0101 0110 0111 Gray Code 0000 0001 0011 0010 0110 0111 0101 0100 Decim al 8 9 10 11 12 13 14 15 Binar y 1000 1001 1010 1011 1100 1101 1110 1111 Gray Code 1100 1101 1111 1110 1010 1011 1001 1000

  23. Binary to gray conversion:- a) The MSB in the Gray code is same as the corresponding bit in the binary number. b) Going from left to right, add each adjacent pair of binary bit to get next gray code bit and discard carry

  24. Binary-to-Gray code conversion i. The MSB in the Gray code is the same as corresponding MSB in the binary number. ii. Going from left to right, add each adjacent pair of binary code bits to get the next Gray code bit. Discard carries. ex: ex: convert 101102 to Gray code 1+0 1+0 + + 1 1 +1 +1 + +0 0 binary binary 1 1 1 0 1 Gray 1 1 1 0 1 Gray

  25. Binary to gray conversion Lets take a input string & we have to convert it into gray code MSB WILL BE SAME

  26. Gray to binary conversion:- a) The MSB is the binary code is same as corresponding digit in the gray code. b) Add each binary digit generated to the gray digit in the next adjacent position and discard carry.

  27. Gray to binary conversion Gray to binary conversion Taking a random input string and converting it. MSB WILL BE SAME

  28. The Gray Code - Application Bit 0 Bit 1 Bit 2 Bit 3 http://www.mipraso.de/enzyklopae die/g/gray-code-scheibe.gif http://www.engr.colostate.edu/ ~dga/mechatronics/figures/9- 11.gif

  29. Application of Gray code Gray code is popularly used in the shaft position encoders. A shaft position encoder produces a code word which represents the angular position of the shaft.

  30. Alphanumeric Codes

  31. Alphanumeric code Coding is the process of altering the characteristics of information to make it more suitable for intended application. The code which are used to encode the characters of alphabet and decimal digits in addition to special symbols is alphanumeric code.

  32. Necessity of alphanumeric code In many situation, digital systems are required to handle the data that may consists of numerals, alphabets and special symbols. So in digital computers for transmitting data between computers and its input/output devices alphanumeric codes are required.

  33. How should we select a code Ease of coding To increase the efficiency of transmission Ease in arithmetic operations Minimum use of hardware Error detection property Ability to prevent wrong output during transmission

  34. Alphanumeric Codes Represent numbers and alphabetic characters. Also represent other characters such as symbols and various instructions necessary for conveying information. The ASCII is the most common alphanumeric code. ASCII = American Standard Code for Information Interchange

  35. ASCII ASCII is a type of binary code has 128 characters and symbols represented by a 7-bit binary code. It can be considered an 8-bit code with the MSB always 0. (00h-7Fh) 95 graphic code 52 alphabetic code 29 punctuation 00h-1Fh (the first 32) control characters 20h-7Fh graphics symbols (can be printed or displayed)

  36. 95 graphic codes

  37. Alphabetic codes

  38. Punctuation etc

  39. Example of ASCII conversion

Related


More Related Content