Number Systems and Codes

Number Systems and Codes

RAJASTHAN TECHNICAL UNIVERSITY KOTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR SUBJECT: DIGITAL ELECTRONICS BRANCH: COMPUTER SCIENCE/INFORMATION TECHNOLOGY YEAR/SEMESTER: II/III FACULTY NAME:SUJEET KUMAR GUPTA SYLLABUS Recommended books: T1 :- Modern Digital Electronics 4th Edition, R.P Jain: Tata Mcgraw-Hill T2 :- Digital Design [5th Edition] (M. Morris Mano and Michael Ciletti), Pearson T3 :- Digital Electronics, A.Anand , Pearson FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM UNIT 1 Fundamental Concept of Number System, Basic logic gates and Boolean algebra FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM BLOWN UP OF UNIT 1 FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM NUMBER SYSTEMS AND CODES Objectives : •Binary, Octal, Hexadecimal and BCD Number System. •Number Conversion FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM Outcomes At the end of this chapter, students should be able to:- – Differentiate between decimal, binary, octal, hexadecimal and BCD. – Convert number between bases. FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM 1.0 Types of Number System FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM 1.1 List of Number Type Base Numbers/Symbols Decimal 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary 2 0, 1 Octal 8 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM 2.0 Binary Numbers • Used to represent the voltage levels of a digital circuit. • Only two voltage levels present in a digital circuit, logic High and logic Low. • The high voltage is +5V and the low voltage is +0V. • The binary numbers represent the logic low as a 0 and the logic high as a 1. FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM 2.1 Decimal Binary Conversion • A decimal number can be converted to a binary number by successively dividing the number by 2 as follows: •Note that the first remainder becomes the most significant bit (MSB). The last remainder becomes the least significant bit (LSB). FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM Converting Fractional Decimal Number into Binary Number FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM Decimal Octal Conversion • A decimal number can be converted to an octal number by successively dividing the number by 8 as follows: 266 ‚ 8 = 33 remainder 2 LSD (right-most digit) 33 ‚ 8 = 4 remainder 1 4 ‚ 8 = 0 remainder 4 MSB (left-most digit). • Therefore 26610 = 4128 FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM Decimal Hexadecimal Conversion • A decimal number can be converted to hex number by successively dividing the number by 16 as follows: FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM 2.2 Binary Decimal Conversion • A binary number is converted to a decimal number by summing together the weights of various positions in the binary number which contain a 1. For example, 10101112 = 8710. FACULTY NAME:SUJEET KUMAR GUPTA Binary to octal conversion • A binary number is converted into an octal number by taking groups of 3 bits, starting from LSB, and replacing them with an octal digit. For example, 11 010 . 1102 = 3268 FACULTY NAME:SUJEET KUMAR GUPTA Binary to Hexadecimal conversion A binary number is converted into an octal number by taking groups of 4 bits, starting from LSB, and replacing them with a hex digit. For example, . 101111110101102 = 2FD616 FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM Octal Decimal Conversion • To convert an octal number to a decimal number, multiply each octal value by the weight of the digit and sum the results. For example, 4128 = 26610. FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM Octal Binary Representation • Each octal digit can be represented by a 3-bit binary number as shown below: FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM Octal Binary Conversion Conversion from octal to binary is very straightforward. Each octal digit is replaced by 3-bit binary number. For example, 4728 = 100 111 0102. A binary number is converted into an octal number by taking groups of 3 bits, starting from LSB, and replacing them with an octal digit. For example, 11 010 . 1102 = 3268 FACULTY NAME:SUJEET KUMAR GUPTA Octal to Hexadecimal Conversion • Step 1: Octal to Binary conversion • Step 2: Binary to Hexadecimal conversion • For example, Step 1 : 4728 = 100 111 0102 • Step 2 : 100 111 0102 = 13A 16 FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM Hexadecimal Number • The hexadecimal number uses base 16. It uses the digits 0 through 9 plus the letters A, B, C, D, E and F. • The letter A stands for decimal 10, B for 11, C for 12, D for 13, E for 14 and F for 15. FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM Hexadecimal Number FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM Hexadecimal Decimal Conversion • To convert a hex number to a decimal number, multiply each hex value by the weight of the digit and sum the results. For example, 1A716 = 42310. FACULTY NAME:SUJEET KUMAR GUPTA GLOBAL INSTITUTE OF TECHNOLOGY JAIPUR DIGITAL ELECTRONICS CSE/III SEM Hexadecimal Binary Conversion • Each hex digit can be represented by a 4-bit binary number as shown above. Conversion from hex to binary is very straightforward. Each hex digit is replaced by 4-bit binary number. A binary number is converted into an octal number by taking groups of 4 bits, starting from LSB, and replacing them with a hex digit. For example, . 110101102 = 3268 FACULTY NAME:SUJEET KUMAR GUPTA Binary Arithmetic • In binary number system there are only 2 digits 0 and 1, and any number can be represented by these two digits. The arithmetic of binary numbers means the operation of addition, subtraction, multiplication and division. Binary arithmetic operation starts from the least significant bit i.e. from the right most side. We will discuss the different operations one by one in the following. • Binary Addition • Binary Subtraction • Binary Multiplication • Binary Division FACULTY NAME:SUJEET KUMAR GUPTA Binary Addition • There are four steps in binary addition, they are written below • 0 + 0 = 0 • 0 + 1 = 1 • 1 + 0 = 1 • 1 + 1 = 0 (carry 1 to the next significant bit) • An example will help us to understand the addition process. Let us take two binary numbers 10001001 and 10010101 • The above example of binary arithmetic clearly explains the binary addition operation, the carried 1 is shown on the upper side of the operands. FACULTY NAME:SUJEET KUMAR GUPTA Complements • Complements are used in the digital computers in order to simplify the subtraction operation and for the logical manipulations. For each radix-r system (radix r represents base of number system) there are two types of complements. S.N. Complement Description 1 Radix Complement The radix complement is referred to as the r's complement 2 Diminished Radix The diminished radix Complement complement is referred to as the (r-1)'s complement FACULTY NAME:SUJEET KUMAR GUPTA Binary system complements • As the binary system has base r = 2. So the two types of complements for the binary system are 2's complement and 1's complement. • 1's complement • The 1's complement of a number is found by changing all 1's to 0's and all 0's to 1's. This is called as taking complement or 1's complement. Example of 1's Complement is as follows. FACULTY NAME:SUJEET KUMAR GUPTA Cont… • 2's complement • The 2's complement of binary number is obtained by adding 1 to the Least Significant Bit (LSB) of 1's complement of the number. • 2's complement = 1's complement + 1 • Example of 2's Complement is as follows. FACULTY NAME:SUJEET KUMAR GUPTA Binary Subtraction • Here are too four simple steps to keep in memory • 0 – 0 = 0 • 0 – 1 = 1, borrow 1 from the next more significant bit • 1 – 0 = 1 • 1 – 1 = 0 • Evaluate: • (i) 110110 - 10110 • Solution: • The numbers of bits in the subtrahend is 5 while that of minuend is 6. We make the number of bits in the subtrahend equal to that of minuend by taking a `0’ in the sixth place of the subtrahend. • Now, 2’s complement of 010110 is (101101 + 1) i.e.101010. Adding this with the minuend. • 1 1 0 1 1 0 Minuend 1 0 1 0 1 0 2’s complement of subtrahend Carry over 1 1 0 0 0 0 0 Result of addition • After dropping the carry over we get the result of subtraction to be 100000. FACULTY NAME:SUJEET KUMAR GUPTA Binary Multiplication • Binary multiplication may sound like it would be more difficult than binary addition or subtraction – but is actually a simple process. Here are the four steps to be followed, using the same binary numbers 10001001 and 10010101: • 0×0=0 • 1×0=0 • 0×1=0 • 1×1=1 (there is no carry or borrow for this) • The arithmetic of multiplying binary numbers is shown below: FACULTY NAME:SUJEET KUMAR GUPTA Binary Division • Binary division is comprised of other two binary arithmetic operations, multiplication and subtraction; an example will explain the operation more easily.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    57 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us