Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1 (Part c) Digital Systems and Binary Numbers

Similar presentations


Presentation on theme: "Chapter 1 (Part c) Digital Systems and Binary Numbers"— Presentation transcript:

1 Chapter 1 (Part c) Digital Systems and Binary Numbers
Digital Logic Design Chapter 1 (Part c) Digital Systems and Binary Numbers Originally by T.Tasniem Nasser Al-Yahya

2 Outline of Chapter 1 (Part c)
1.6 Signed Binary Numbers 1.7 Binary Codes

3 Outline of Chapter 1 (Part c)
1.6 Signed Binary Numbers 1.7 Binary Codes

4 1.6 Signed Binary Numbers To represent negative integers, we need a notation for negative values. It is customary to represent the sign with a bit placed in the leftmost position of the number. The convention is to make the sign bit 0 for positive and 1 for negative. Example the different representations of -9 using 8 bit number: Table 1.3 lists all possible four-bit signed binary numbers in the three representations.

5 Signed Binary Numbers

6 Signed Binary Numbers Arithmetic Addition
When adding two numbers in the signed magnitude system we follow the following rules: If the signs are the same, add the two magnitudes, and give the sum the common sign. If the signs are different, subtract the smaller magnitude from the larger magnitude, give the difference the sign of the larger magnitude. When adding two signed binary numbers in signed 2`s complement system, we follow the following rule : Add the two numbers, including the sign bits. A carry out of the sign bit is discarded. We need to make sure that the result has sufficient number of bits to accommodate the sum. If adding two n bits numbers requires n+1 bits for the result, this is called overflow.

7 Signed Binary Numbers Arithmetic Subtraction Example:
In 2’s-complement form: Example: Take the 2’s complement of the subtrahend (including the sign bit) and add it to the minuend (including sign bit). A carry out of sign-bit position is discarded. ( 6)  ( 13) (  ) ( ) (+ 7)

8 Outline of Chapter 1 (Part c)
1.6 Signed Binary Numbers 1.7 Binary Codes

9 1.7 Binary Codes Any discrete element of information that distinct among a group of quantities can be represented with a binary code. An n bit binary code is a group of n bits that assumes up to 2n distinct combinations of 1 and 0. The minimum number of bits required to code 2n distinct quantities is n, there is no maximum number of bits that may be used for a binary code. Example: A set of 4 elements could be coded with 2 bits having the following assignments 00,01,10,11. A set of 8 elements will need 3 bits.

10 1.7 Binary Codes BCD Code A number with k decimal digits will require 4k bits in BCD. Decimal 396 is represented in BCD with 12bits as , with each group of 4 bits representing one decimal digit. A decimal number in BCD is the same as its equivalent binary number only when the number is between 0 and 9. The binary combinations 1010 through 1111 are not used and have no meaning in BCD.

11 Binary Code Example: BCD addition
Consider decimal 185 and its corresponding value in BCD and binary: BCD addition

12 Binary Code Example: Decimal Arithmetic: (+375) + (-240) = +135
Consider the addition of = 760 in BCD: Decimal Arithmetic: (+375) + (-240) = +135 Hint 6: using 10’s of BCD

13 Binary Codes Other Decimal Codes

14 Binary Codes Gray code Only one bit in the code group Changes in going from one number to the next number. Used in applications in which the normal system of binary numbers may produce an error or ambiguity during the transition from one number to the next.

15 Reading Chapter 1: 1.6,1.7


Download ppt "Chapter 1 (Part c) Digital Systems and Binary Numbers"

Similar presentations


Ads by Google