Top Banner

of 42

14. DIGITAL CIRCUITS

Apr 08, 2018

Download

Documents

dark_blade500
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/7/2019 14. DIGITAL CIRCUITS

    1/42

  • 8/7/2019 14. DIGITAL CIRCUITS

    2/42

    COMPUTER

    PLAY WORKORGANIZE THEIR LIVES

  • 8/7/2019 14. DIGITAL CIRCUITS

    3/42

    DIGITAL CIRCUITS are the

    brains of the technologicalworld

  • 8/7/2019 14. DIGITAL CIRCUITS

    4/42

    PC have subdivided the circuit

    board into four areas

  • 8/7/2019 14. DIGITAL CIRCUITS

    5/42

    FOUR AREAS

    1. BASIC LOGIC AREA. This consists of the

    basic gates (glue chips).

    2. MEMORY AREA. This consists of bothRAMs and ROMs,

    3. MICROPROCESSOR. This is the heart of

    the PC and contains several millions oftransistors and be able to execute over 100

    millions instruction/second.

  • 8/7/2019 14. DIGITAL CIRCUITS

    6/42

    4. PERIPHERAL ICs. These ICs

    primarily involved withInput/Output (I/O)

  • 8/7/2019 14. DIGITAL CIRCUITS

    7/42

    How this digital

    circuits works in a

    computer?

    To understand the operation

    and application digital

    electronics mastered theMATHEMATICS AND

    LOGIC DEVICES, then

    BASIC GATES

  • 8/7/2019 14. DIGITAL CIRCUITS

    8/42

    COMPUTERS are designed to handle numbers, not

    letters

    Use a more efficient code called theBINARY NUMBERS

    To understand the basic operation ofcomputer it is a prerequisite to knowthe conversion of each number system

  • 8/7/2019 14. DIGITAL CIRCUITS

    9/42

    Binary system- uses only two

    distinctive numbers: LOGIC 1 ------------ON

    LOGIC 0 -----------OFF

    An action of a switch0 and 1 called BIT

    Bit Quantities:

    4 bits = One nibble or hexadecimal digit

    8 bits = Two nibble or one byte

    16 bits = Two bytes or one word

    32 bits = Two words or one longword

    (Motorolas Term) one Double word (Intels term)

  • 8/7/2019 14. DIGITAL CIRCUITS

    10/42

    BINARY TO DECIMAL

    CONVERSION

    To find the equivalent decimal

    numbers, we will use thepolynomials expansion:

    N = +(B2R2) + (B1R

    1) + (B0R0)

  • 8/7/2019 14. DIGITAL CIRCUITS

    11/42

    CONVERSION OF BINARY

    FRACTIONS TO DECIMALSN = (B-1R

    -1) + (B-2R-2) +

    MIXED NUMBERS

    can be converted from binary to

    decimal by working on the integersand fraction portion separately.

  • 8/7/2019 14. DIGITAL CIRCUITS

    12/42

    EXAMPLES:1. 101112

    2. 1101012

    3. 1100010112

    4. 11011.101112

    5. 0.000100112

  • 8/7/2019 14. DIGITAL CIRCUITS

    13/42

    DECIMAL TO BINARY

    CONVERSION1. Obtain the N ( the decimal number to be

    converted_

    2. Determine if N is odd or even.3. (a) If N is odd, write 1 and subtract 1 from N.

    Go to step 4. (b) If N is even, write 0. Go to step4.

    4. Obtain a new value of N by dividing the N ofstep 3 by 2.

    5. (a) If N >1, go back to step 2 and repeat theprocedure. (b) If N = 1 , write 1.

  • 8/7/2019 14. DIGITAL CIRCUITS

    14/42

    NOTE: The number written is thebinary equivalent of the original

    decimal number. The number

    written first is the least

    significant bit (LSB), and the

    number written last is the mostsignificant bit (MSB)

  • 8/7/2019 14. DIGITAL CIRCUITS

    15/42

    EXAMPLES:1. 1010

    2. 2510

    3. 25010

    4. 7710

    5. 8910

  • 8/7/2019 14. DIGITAL CIRCUITS

    16/42

    CONVERTING DECIMAL

    FRACTION TO BINARY

    FRACTIONS1. Obtain N.

    2. Double N.3. (a) If the new value of N is greater than 1,

    write 1 as the next most significant bit,subtract 1 from N, and go back to step 2.(b) If the new value of N is less than 1,write 0 as the next most significant bit andgo back to step 2.

  • 8/7/2019 14. DIGITAL CIRCUITS

    17/42

    MIXED NUMBERSMixed numbers can be converted from

    decimal and fraction portions separately.

  • 8/7/2019 14. DIGITAL CIRCUITS

    18/42

    EXAMPLES:1. 0.510

    2. 0.2510

    3. 3.72510

    4. 0.69310

    5. 0.35610

  • 8/7/2019 14. DIGITAL CIRCUITS

    19/42

    TWO ALTERNATIVES

    SYSTEMS USEDF

    ORREPRESENTING BINARY:

    1. OCTAL NUMBER SYSTEM-uses 0 to 7 and base 8

    2. HEXADECIMAL NUMBERSYSTEM- uses 0 to 9, and Athrough F corresponding tonumbers 10 through 15 and base16

  • 8/7/2019 14. DIGITAL CIRCUITS

    20/42

    BINARY TO OCTAL

    CONVERSION1. Converting binary to octal is grouped into

    three from the least significant bit (LSB)

    to the most significant (MSB)Examples:

    1. 111111112

    2. 1000111023. 0000111124. 101010102

  • 8/7/2019 14. DIGITAL CIRCUITS

    21/42

    OCTAL TO BINARY

    CONVERSION Converting octal to binary just write the binary

    equivalent of the numbers in octal form

    EXAMPLES:

    1. 778

    2. 578

    3. 6584. 468

    5. 528

  • 8/7/2019 14. DIGITAL CIRCUITS

    22/42

    DECIMAL TO OCTAL

    CONVERSION1. Convert the decimal number to its binary

    equivalent

    2. Then grouped the binary equivalent into

    three and convert each group separately to

    octal equivalent

    Examples:

    1. 4410, 5410, 6610

  • 8/7/2019 14. DIGITAL CIRCUITS

    23/42

    OCTAL TO DECIMAL

    CONVERSION1. Convert the octal number to its binary equivalent

    by assigning a 3-bit binary equivalent to each

    octal digit2. Then convert the binary back to decimal using

    the usual method.

    EXAMPLES:

    1. 7782. 5783. 6584. 468

  • 8/7/2019 14. DIGITAL CIRCUITS

    24/42

    BINARY TO HEX

    CONVERSION To convert binary to hex, grouped the

    binary digits into four bits (from LSB to the

    MSB) and get the equivalent in hex.

    EXAMPLES:

    1. 1010101111002

    2. 1100000101111111012

  • 8/7/2019 14. DIGITAL CIRCUITS

    25/42

    HEX TO BINARY

    CONVERSION Get the binary equivalent of each digit in

    the proper order.

    EXAMPLES:

    1. 1CB0916

  • 8/7/2019 14. DIGITAL CIRCUITS

    26/42

    DECIMAL TO HEX

    CONVERSION1. Convert the decimal number to binary

    using the usual approach.

    2. Then, grouped the binary digits into 4 bits

    and take the hex equivalent of each group

    separately.

    EXAMPLES:

    1. 76410

  • 8/7/2019 14. DIGITAL CIRCUITS

    27/42

    HEX TO DECIMAL

    CONVERSION1. Using the direct approach, the hex digit

    are multiplied with the weighed bit

    equivalent of the number (Polynomialexpansion)

    2. Convert the hex number to binary by

    assigning 4-bit equivalent for each hexdigit and then converting the binary to

    decimal number.

  • 8/7/2019 14. DIGITAL CIRCUITS

    28/42

    EXAMPLE 1. 2FC16

    Since C = 12, F = 15

    H2 + H1 + H0

    = 162 x 2 + 161 x 15 + 160 x 12

    = 512 + 240 + 12

    = 764

  • 8/7/2019 14. DIGITAL CIRCUITS

    29/42

    BCD Code The BCD is one popular form of coding used to

    simplify the conversion of binary into its decimalequivalent.

    This is generally used for coding binary in 7-segment displays.

    Note: this code is weighed code, not a numbersystem.

    Similar to the hexadecimal number system, thebinary bits are grouped into four to facilitateconversion; but unlike hex, the acceptable binarycodes are obviously for digits 0 to 9 only.

  • 8/7/2019 14. DIGITAL CIRCUITS

    30/42

    BCD 1. 321 = 0011 0010 0001

    2. 10 = 0001 0000

    3. 11 = 0001 0001

    4. 22 = 0010 0010

    5. 100 = 0001 0000 0000

  • 8/7/2019 14. DIGITAL CIRCUITS

    31/42

    BASIC BINARY ARITHMETIC ADDTION

    Rules of Binary Addition:

    0+0 = 00+1 = 1

    1+0 = 1

    1+1 = 0, and carry 1 to the next most significantbit

    Examples: 1. 00011010 + 00001100

    2] 11+11 , 3] 11 + 101 , 4] 1001 + 1101

  • 8/7/2019 14. DIGITAL CIRCUITS

    32/42

    SUBTRACTION Rules of binary subtraction:

    0 0 = 0

    1 0 = 1

    1 1 = 0

    0 1 = 1, and borrow 1 from the next most significant

    bit.

    EXAMPLES:

    A] 00100101 00010001

    B] 00110011 00010110

  • 8/7/2019 14. DIGITAL CIRCUITS

    33/42

    MULTIPLICATIONRules of binary multiplication:

    0 * 0 = 0

    0 * 1 = 0

    1 * 0 = 0

    1 * 1 = 1, and no carry or borrow bits

    EXAMPLES:A] 00101001 * 00000110

    B] 00010111 * 00000011

  • 8/7/2019 14. DIGITAL CIRCUITS

    34/42

    DIVISIONBinary division is the repeated process of

    subtraction, just as in decimal division.

    EXAMPLES:

    A] 00101010

  • 8/7/2019 14. DIGITAL CIRCUITS

    35/42

    2s Complementing Numbers The 2s complement number system is used in all

    modern computers to express numbers.

    It is similar to the binary number system, but bothpositive and negative numbers can be represented.

    MSB of a 2s complement number denotes:

    0 means the number is positive

    1 means the number is negativeNOTE: 2s complement notation, positive numbers are

    represented as simple binary numbers with therestriction that the MSB is 0.

  • 8/7/2019 14. DIGITAL CIRCUITS

    36/42

    To obtain the representation of a

    negative number, use the following

    algorithm:1. Represent the number as a positive binary

    number.

    2. Complement it. (Write 0s where there are

    1s and 1s where there are 0s in the

    positive number)

    3. Add 1.

    4. Ignore any carries out of the MSB.

  • 8/7/2019 14. DIGITAL CIRCUITS

    37/42

    Example:1. Given 8-bit word, find the 2s complement

    representation of:

    a. 25 = 000110012

    b. 25

    c. 1

  • 8/7/2019 14. DIGITAL CIRCUITS

    38/42

    Adding 2s Complement Numbers

    C = A + B

    If A and B are both positive, addition is

    required.

    But if one of the operands is negative and

    the other is positive, a subtraction operation

    must be performed.

  • 8/7/2019 14. DIGITAL CIRCUITS

    39/42

    Example:1. Express the numbers 19 and 11 as 8-bit, 2s

    complement numbers, and add them.

    + 19 = 00010011

    Get the 2s complement of - 11

    = 11110101Then add:

    00001000

  • 8/7/2019 14. DIGITAL CIRCUITS

    40/42

    Example:2. Add 11 and 19.

    - 11 = 11110101

    - 19 = 11101101

    Then add:

    11100010

  • 8/7/2019 14. DIGITAL CIRCUITS

    41/42

    Subtraction of Binary Numbers The 2s complement of the subtrahend is taken

    and added to the minuend.

    Example:

    Subtract 30 from 53. Use 8-bit numbers.

    53 = 00110101 (Minuend)

    2s complement of 30 = 11100010 (Subtrahend)

    Then add:

    00010111

  • 8/7/2019 14. DIGITAL CIRCUITS

    42/42

    Subtract 30 from 19.- 19 = 11101101

    - 30 = 11100010 = 2s complement =

    00011110

    Then add:

    00001011