meljun cortes handouts_the number system

Upload: meljun-cortes-mbampa

Post on 01-Jun-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    1/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page1of 54

    Base or Radix 10 number ing sy stem 

    also known as the decimal numbering system

    uses ten symbols: digits 0,1,2,3 up to 9

    Binary number ing system  uses binary digit (0 and 1) commonly called a

    bit -- the bits correspond to the off and on

    positions of the switches in the computer 

     

    1 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page3of 54

     

    3 __________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page2of 54

    the position of the digit with respect to the

    decimal point (radix point )

     

    2 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page4of 54

     

    4 __________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    2/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page5of 54

    Step 1: Make a listing of the position valuesabove each digit.

    Step 2: For each column, multiply the position

    value of the column by the digit

    contained in that column.

     

    5 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page7of 54

    Step 3: Multiply .25 by 2.

    Step 4: Multiply the fractional part again by 2.

     

    7 __________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page6of 54

    Step 3:  Add the values listed in the decimal

    equivalent row to get the decimal

    answer.

    Step 1: Separate the integer part from the

    fractional part then; convert the decimalnumber 2110.

    Step 2: Divide the integer 21 by 2 to get the

    quotient 10 and the remainder 1.

     

    6 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page8of 54

    Separate the integer from the fractional part.

    For the integer number 697 :

     

    8 __________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    3/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page9of 54

     

    9 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page11of 54

    Octal Number ing System 

    uses 0, 1, 2, 3, 4, 5, 6, 7 digits

     

    11 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page10of 54

    For the fractional part 0.78125 10 :

    Step 11: 

    0.78125 * 2 = 1.5625 Answer: 0 . 1 ? ? ? ?

    Step 12: 

    0.5625 * 2 = 1.125 Answer: 0 . 1 1 ? ? ?

    Step 13: 

    0.125 * 2 = 0.25 Answer: 0 . 1 1 0 ? ?

    Step 14: 

    0.25 * 2 = 0.5 Answer: 0 . 1 1 0 0 ?

     

    10 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page12of 54

    Hexadecimal Number ing System 

    uses the numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

    digits and the letters A, B, C, D, E, and F to

    supplement for the values of 10 to 15

     

    12 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    4/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page13of 54

    binary digits are grouped into 3’s, right to left

    before the binary point, left to right after thebinary point

    Padding the number with 0: 

    add 0’s to the left of the most significant bit

    add 0’s to the right of the least significant bit

     

    13 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page15of 54

     

    15 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page14of 54

    Step 1: Divide the binary number into groups of

    3.

    Step 2: Multiply each binary number to its place

    value and add the products to get theoctal digit.

     

    14 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page16of 54

    binary digits are grouped into 4’s, right to left

    before the binary point, left to right after the

    binary point

    the rules for adding 0’s remain the same

     

    16 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    5/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page17of 54

    Step 1: Divide the binary number into groups of4.

    Step 2: Multiply each binary number to its placevalue and add the products to get the

    hexadecimal digit.

     

    17 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page19of 54

     

    19 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page18of 54

     

    18 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page20of 54

    Solution:

    1. 5.58 5 = 10125.58 = 101.1012

    2. FACE16 F = 11112 A = 10102C = 11002E = 11102FACE16 = 1111 1010 1100

    11102

    3. 86416 8 = 100026 = 01102

    4 = 0100286416 = 1000 0110 01002

    4. 7001.68 7 = 11120 = 00021 = 00126 = 11027001.68 = 111 000 001 1102

    5. 25.716 2 = 001025 = 010127 = 0111225.716 100101.0111 2(the two 0’s at the beginning wasdisregarded )

     

    20 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    6/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page21of 54

    Signed Magnitude Representation

    padding the binary number with a sign bit at

    the beginning to indicate its sign

    0 - added at the start to indicate a positive

    number 

    1 - stands for a negative number 

     

    21 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page23of 54

    Complements

    used in digital computers for simplifying the

    subtraction operation and for logical operations

    diminished radix complement of a number N of

    base r and with n digits is defined as:

    (r - 1)’s complement:

    (r n - 1) - N 

     

    23 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page22of 54

     

    22 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page24of 54

    Solution:

    Formula:(r n - 1 ) -N

    Given: n = 6; r = 10

    Then: 106 = 1,000,000

    r n - 1 = 1,000,000 -1 = 999,999

    a. N = 5 678 94

    9’s complement:

    (106 - 1) - 567894 = 432105

    b. N = 0 125 98

    9’s complement:

    (106 - 1) - 012598 = 987401

     

    24 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    7/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page25of 54

    1’s complement:

    (2n - 1) – N 

    Solution:

    a. 002 = 112

    b. 01112 = 10002

    c. 01001000102 = 10110111012

    d. 1.10012 = 01.10012 = 10.01102

    e. 1510 = 0011112 = 1100002

     

    25 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page27of 54

    Step 1: Find the least significant 1 bit and let

    this be the anchor .

    Step 2: Change each of the bits to the left of this

    anchor while the 1 itself (or LSB) and all

    other bits in the less significant positions

    remain unchanged.Step 3: The result is the 2’s complement.

     

    27 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page26of 54

    radix complement of a number N of base r and

    with n digits is defined as r’s complement:

    r n - N , for N not 0

    0, for N = 0

    for values of N not 0:

    r’s complement = (r - 1)’s complement +1

    since r n - N = (r n - 1) - N + 1

    10’s complement:

    (106 - 1) - 567894 + 1 = 432106

     

    26 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page28of 54

    Solution:

    a. 002 = 0 (the special caseN = 0)

    b. 011.12 = 101.12

    c. 11001000102 = 00110111102

    d. 01000112 = 10111012

    e. Convert the decimal number to binary and pad

    leading or trailing 0’s as necessary to get the

    fixed 16-bit size.

     

    28 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    8/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page29of 54

    may represent the numbers, letters, symbols, or

    any information or characters

    Solution:

    2n > = number of information to be

    represented

    where n

    = the number of binary digits required to

    represent the information

    n = 1

    = 2n > = 21 = 2 number of information

    that can be r epresented

     

    29 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page31of 54

    Solution:

    for 5 different colors of hair, choose n = 3 to satisfythe formula:

    2n > = number of information to berepresented

    where n = 3

    23 > = 8 = 6 number of information that can

    be represented

     

    31 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page30of 54

    Solution:

    2n > = number of information to be

    represented

    where n = 3

    23 > = 8 = 6 number of information that can

    be represented

    the following combinations can be used:

    000, 001, 010, 011, 100, 110, and 111

     

    30 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page32of 54

    the direct translation of the 10 decimal digits

    into its 4-bit binary counterparts

    a form of coding that which is numeric in nature

    since it encodes numeric characters

     

    32 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    9/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page33of 54

    1 = 0001

    6 = 0110

    5 = 0101

    BCD equivalent = 000101100101.01012

     

    33 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page35of 54

     

    35 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page34of 54

    American Standard Code for Information

    Interchange

    uses 7 bits to represent the text data

    has 128 combinations or 128 values which

    includes 94 printable characters:

    26 uppercase letters

    26 lowercase letters

    10 decimal digits/numbers

    32 special printable characters like @, *, &, etc.

    34 special non-printable characters called

    control characters 

    Control Characters

    correspond to those keys and/or commands

    that include formatting of data (e.g. BS for

    Backspace), sending information (e.g. CR for

    Carriage Return or the Enter key)

     

    34 ________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page36of 54

     

    36 _________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    10/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page37of 54

    Solution:

    Step 1: Write the numbers aligning the radixpoint then start evaluating from the

    rightmost column.

    001.1

    011.1

    + 101.1

     

    37 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page39of 54

    Step 4: Continue evaluating until all the columns

    have been evaluated.

    Step 5: The final carry can be immediatelycarried down as the most significant bit.

     

    39 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page38of 54

    Step 2: Cross out each pair of 1’s and generate a

    carry every time a pair is crossed out.

    Step 3: Two carries cannot be represented by

    the numeral 2. However, it can be

    represented as shown below.

     

    38 ________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page40of 54

    Solution:

    Step 1: Write the numbers aligning the radix

    point then start evaluating from the

    rightmost column. Note: You need toborrow to evaluate the rightmost column.

    1 0 0 1 0 . 0

    - 1 0 1 1 . 1

     

    40 _________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    11/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page41of 54

    Step 2: If borrowing is required, borrow from the

    nearest 1 at the left digit. Add this to thenext digit to its right until we arrive at

    the column you are evaluating.

    Step 3: Perform rules 1 to 3 since you havealready borrowed from 1.

     

    41 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page43of 54

    Step 1:  Align the multiplicand with the

    multiplier.

    Step 2: Remember the two equations in

    performing binary multiplication.

     

    43 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page42of 54

    Step 4: Perform borrowing from the nearest 1 at

    the left digit. Repeat Step 2 .

    Step 5: Perform rules 1 to 3 until you arrive at theleftmost column.

     

    42 ________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page44of 54

    Note that you are to align the product with the

    multiplier digit to which you are multiplying the

    multiplicand.

     

    44 _________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    12/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page45of 54

    Step 3:  Add the resulting products as aligned

    above. The decimal point is placed onthe fourth place from the right.

     

    45 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page47of 54

    Step 3:

     

    47 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page46of 54

    Solution:

    Step 1:

    Step 2:

     

    46 ________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page48of 54

    Dividend

    the number to be divided

    Divisor 

    the quantity by which the dividend will be

    divided by

    Quotient

    the resulting quantity when the dividend has

    been divided by the divisor 

     

    48 _________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    13/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page49of 54

    Solution:

    Step 1: Determine the number of digits (n) of thedivisor.

    101101 - dividend

    101 - divisor  

    n = 3

    the first n digits of the dividend is equal

    to the divisor 

     

    49 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page51of 54

    Step 4: Repeat step 3 until all the difference is 0

    and/or the bits of the dividend has beenbrought down.

     

    51 _________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page50of 54

    Step 2: Write a 1 aligned with the resulting

    number’s place value. Subtract the

    divisor from the corresponding number.

    Step 3: Bring down the next bit from the

    dividend. NOTE: Place 0 if the divisor is> the dividend. Place 1 if the divisor is

  • 8/8/2019 MELJUN CORTES HANDOUTS_The Number System

    14/14

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page53of 54

    Step 2:

    Step 3:

     

    53 ________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

    TheNumber System: AReview

    LogicDesignand Switching

    * Property of STI 

    Page54of 54

    Step 4:

     

    54 ________________ ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________

     ___________________ ___________________

     ___________________

     ___________________

     ___________________