Presentation is loading. Please wait.

Presentation is loading. Please wait.

Binary Systems1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.

Similar presentations


Presentation on theme: "Binary Systems1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN."— Presentation transcript:

1 Binary Systems1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN

2 Binary Systems2 Digital Systems  They manipulate discrete information (A finite number of elements)  Example discrete sets 10 decimal digits, the 26 letters of alphabet 10 decimal digits, the 26 letters of alphabet  Information is represented in binary form  Examples  Digital telephones, digital television, and digital cameras  The most commonly used one is DIGITAL COMPUTERS

3 Binary Systems3 CENTRAL PROCESSING UNIT Digital Computers Control Unit Arithmetic Logic Unit (ALU) Registers R1 R2 Rn Main Memory DiskKeyboardPrinter I/O Devices Bus

4 Binary Systems4 Binary Signals  It means two-states  1 and 0  true and false  on and off  A single “on/off”, “true/false”, “1/0” is called a bit  Example: Toggle switch

5 Binary Systems5 Byte  Computer memory is organized into groups of eight bits  Each eight bit group is called a byte

6 Binary Systems6 Why Computers Use Binary  They can be represented with a transistor that is relatively easy to fabricate (in silicon)  Millions of them can be put in a tiny chip  Unambiguous signal (Either 1 or 0)  This provides noise immunity

7 Binary Systems7 Analog Signal

8 Binary Systems8 Binary Signal  A voltage below the threshold  off  A voltage above the threshold  on

9 Binary Systems9 Binary Signal

10 Binary Systems10 Noise on Transmission  When the signal is transferred it will pick up noise from the environment

11 Binary Systems11 Recovery  Even when the noise is present the binary values are transmitted without error

12 Binary Systems12 Binary Numbers  A number in a base-r system x = x n-1 x n-2... x 1 x 0. x -1 x -2... X -(m-1) x -m

13 Binary Systems13 Radix Number System  Base – 2 (binary numbers)  0 1  Base – 8 (octal numbers)  0 1 2 3 4 5 6 7  Base – 16 (hexadecimal numbers)  0 1 2 3 4 5 6 7 8 9 A B C D E F

14 Binary Systems14 Radix Operations  The same as for decimal numbers 11001011 +10011101 101101000 11001011 - 10011101 00101110 101 * 110 000 1010 +10100 11110

15 Binary Systems15 Conversion From one radix to another  From decimal to binary

16 Binary Systems16 Conversion From one radix to another  From decimal to base-r  Separate the number into an integer part and a fraction part  For the integer part Divide the number and all successive quotients by r Divide the number and all successive quotients by r Accumulate the remainders Accumulate the remainders 165 23 3 0 423423 0.6875 x 2 = 1 + 0.3750 0.3750 x 2 = 0 + 0.7500 0.7500 x 2 = 1 + 0.5000 0.5000 x 2 = 1 + 0.0000

17 Binary Systems17 Different Bases

18 Binary Systems18 Conversion From one radix to another  From binary to octal  Divide into groups of 3 bits  Example 11001101001000.1011011 = 31510.554 11001101001000.1011011 = 31510.554  From octal to binary  Replace each octal digit with three bits  Example 75643.5704 = 111101110100011.101111000100 75643.5704 = 111101110100011.101111000100

19 Binary Systems19 Conversion From one radix to another  From binary to hexadecimal  Divide into groups of 4 bits  Example 11001101001000.1011011 = 3348.B6 11001101001000.1011011 = 3348.B6  From hexadecimal to binary  Replace each digit with four bits bits  Example 7BA3.BC4 = 111101110100011.101111000100 7BA3.BC4 = 111101110100011.101111000100

20 Binary Systems20 Complements  They are used to simplify the subtraction operation  Two types (for each base-r system)  Diminishing radix complement (r-1 complement)  Radix complement (r complement) For n-digit number N r-1 complement r complement

21 Binary Systems21 9’s and 10’s Complements  9’s complement of 674653  999999-674653 = 325346  9’s complement of 023421  999999-023421 = 976578  10’s complement of 674653  325346+1 = 325347  10’s complement of 023421  976578+1=976579

22 Binary Systems22 1’s and 2’s Complements  1’s complement of 10111001  11111111 – 10111001 = 01000110  Simply replace 1’s and 0’s  1’s complement of 10100010  01011101  2’s complement of 10111001  01000110 + 1 = 01000111  Add 1 to 1’s complement  2’s complement of 10100010  01011101 + 1 = 01011110

23 Binary Systems23 Subtraction with Complements of Unsigned  M – N  Add M to r’s complement of N Sum = M+(r n – N) = M – N+ r n Sum = M+(r n – N) = M – N+ r n  If M > N, Sum will have an end carry r n, discard it  If M<N, Sum will not have an end carry and Sum = r n – (N – M) (r’s complement of N – M) Sum = r n – (N – M) (r’s complement of N – M) So M – N = – (r’s complement of Sum) So M – N = – (r’s complement of Sum)

24 Binary Systems24 Subtraction with Complements of Unsigned  65438 - 5623 65438 10’s complement of 05623 +94377 159815 Discard end carry 10 5 -100000 Answer 59815

25 Binary Systems25 Subtraction with Complements of Unsigned  5623 - 65438 05623 10’s complement of 65438 +34562 40185 There is no end carry => -(10’s complement of 40185) -59815

26 Binary Systems26 Subtraction with Complements of Unsigned  10110010 - 10011111 10110010 2’s complement of 10011111 +01100001 100010011 Discard end carry 2^8 -100000000 Answer 000010011

27 Binary Systems27 Subtraction with Complements of Unsigned  10011111 -10110010 10011111 2’s complement of 10110010 +01001110 11101101 There is no end carry => -(2’s complement of 11101101) Answer = -00010011

28 Binary Systems28 Signed Binary Numbers  Unsigned representation can be used for positive integers  How about negative integers?  Everything must be represented in binary numbers  Computers cannot use – or + signs

29 Binary Systems29 Negative Binary Numbers  Three different systems have been used  Signed magnitude  One’s complement  Two’s complement NOTE: For negative numbers the sign bit is always 1, and for positive numbers it is 0 in these three systems

30 Binary Systems30 Signed Magnitude  The leftmost bit is the sign bit (0 is + and 1 is - ) and the remaining bits hold the absolute magnitude of the number  Examples -47 = 1 0 1 0 1 1 1 1 -47 = 1 0 1 0 1 1 1 1 47 = 0 0 1 0 1 1 1 1 47 = 0 0 1 0 1 1 1 1 For 8 bits, we can represent the signed integers –128 to +127 How about for N bits?

31 Binary Systems31 One’s complement  Replace each 1 by 0 and each 0 by 1  Example (-6)  First represent 6 in binary format (00000110)  Then replace (11111001)

32 Binary Systems32 Two’s complement  Find one’s complement  Add 1  Example (-6)  First represent 6 in binary format (00000110)  One’s complement (11111001)  Two’s complement (11111010)

33 Binary Systems33 Arithmetic Addition  Usually represented by 2’s complement + 5 00000101 +11 00001011 +16 00010000 - 5 11111011 +11 00001011 +6 100000110 Discard + 5 00000101 -11 11110101 -6 11111010 - 5 11111011 -11 11110101 -16 111110000 Discard

34 Binary Systems34 Registers  They can hold a groups of binary data  Data can be transferred from one register to another

35 Binary Systems35 Processor-Memory Registers

36 Binary Systems36 Operations

37 Binary Systems37 Logic Gates - 1

38 Binary Systems38 Logic Gates - 2

39 Binary Systems39 Ranges The gate inputThe gate output

40 Binary Systems40 Study Problems  Course Book Chapter – 1 Problems  1 – 2  1 – 7  1 – 8  1 – 20  1 – 34  1 – 35  1 – 36

41 Binary Systems41 Sneak Preview  Next time  ASSIGNMENT Will be given Will be given  QUIZ……. Expect a question from each one of the following Expect a question from each one of the following  Convert decimal to any base  Convert between binary, octal, and hexadecimal  Binary add, subtract, and multiply  Negative numbers

42 Binary Systems42 Questions


Download ppt "Binary Systems1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN."

Similar presentations


Ads by Google