CSE 260
Digital Logic Design
        Fall’06
Objective
 Distinguish between analog and digital
  system
 Understand the advantage and limitation
  of digital system
 Understand the meaning of digital logic
Analog vs. Digital
   Analog data can vary over a continuous
    range of values. Example: speedometer
   Digital quantities can take on only discrete
    values (0 and 1, high and low).
    Example: Digital Computer.
Digital System
   A digital system is a combination of
    devices designed to manipulate physical
    quantities or information that are
    represented in digital form.
Advantage of digital system
 Greater accuracy or precision
 Easier to design
 Easier information storage
 Programmability
 Speed
 economical
Limitation of digital
technology
   The real world is mainly analog
Overcome the limitation
 Convert the real world analog input data
  into digital one
 Process this digital data
 Then again convert into analog form
Digital logic
   Design logic is a term used to denote the
    design and analysis of digital system
   Digital logic is concerned with the
    interconnection among digital components
    and modules
   Digital logic design is engineering and
    engineering means problem solving
Number systems and codes
 Digital Systems are built from circuits that
 process binary digits. BUT very few real-
 life problems are based on binary
 numbers.
SO a digital system designer must
establish some correspondence between
the binary digits processed by digital
circuits and real-life numbers, events and
conditions.
Information representation
   Elementory storage units inside computer
    are electronic switches. Each switch holds
    one of two states: on (1) or off (0).
                ON           OFF
   We use a bit (binary digit), 0 or 1, to
    represent the state.
Information representation
   Storage units can be grouped together to
    cater for larger range of numbers.
    Example: 2 switches to represent 4
    values.
                              0 (00)
                              1 (01)
                              2 (10)
                              3 (11)
Information representation
   In general, N bits can represent 2N different values.
   For M values,    log 2 M    bits are needed.
    1   bit → represents up to 2 values (0 or 1)
    2   bits → rep. up to 4 values (00, 01, 10 or 11)
    3   bits → rep. up to 8 values (000, 001, 010. …, 110, 111)
    4   bits → rep. up to 16 values (0000, 0001, 0010, …, 1111)
    32 values   →     requires 5 bits
    64 values   →     requires 6 bits
    1024 values →     requires 10 bits
    40 values   →     requires 6 bits
    100 values →      requires 7 bits
Positional Notations
   Decimal number system, symbols = { 0, 1, 2, 3,
    …, 9 }
   Position is important
   Example:(7594)10 = (7x103) + (5x102) + (9x101)
    + (4x100)
   In general, (anan-1… a0)10 = (an x 10n) + (an-1 x
    10n-1) + … + (a0 x 100)
   (2.75)10 = (2 x 100) + (7 x 10-1) + (5 x 10-2)
   In general, (anan-1… a0 . f1f2 … fm)10 = (an x 10n) +
    (an-1x10n-1) + … + (a0 x 100) + (f1 x 10-1) + (f2 x
    10-2) + … + (fm x 10-m)
Other Number Systems
   Binary (base 2): weights in powers-of-2.
    Binary digits (bits): 0,1.
   Octal (base 8): weights in powers-of-8.
    Octal digits: 0,1,2,3,4,5,6,7
   Hexadecimal (base 16): weights in
    powers-of-16. Hexadecimal digits:
    0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Base-R to Decimal
Conversion
   (1101.101)2 = 1×23 + 1×22 + 1×20 + 1×2-1 + 1×2-3
                   = 8 + 4 + 1 + 0.5 + 0.125
                  = (13.625)10
   (572.6)8 = 5×82 + 7×81 + 2×80 + 6×8-1
             = 320 + 56 + 2 + 0.75 = (378.75)10
   (2A.8)16 = 2×161 + 10×160 + 8×16-1
            = 32 + 10 + 0.5 = (42.5)10
   (341.24)5 = 3×52 + 4×51 + 1×50 + 2×5-1 + 4×5-2
              = 75 + 20 + 1 + 0.4 + 0.16 = (96.56)10
Decimal-to-Binary
Conversion
   Method 1: Sum-of-Weights Method
   Method 2:
       Repeated Division-by-2 Method (for whole
        numbers)
       Repeated Multiplication-by-2 Method (for
        fractions)
    Sum-of-Weights Method
   Determine the set of binary weights whose sum is
    equal to the decimal number.
    (9)10 = 8 + 1 = 23 + 20 = (1001)2
    (18)10 = 16 + 2 = 24 + 21 = (10010)2
    (58)10 = 32 + 16 + 8 + 2 = 25 + 24 + 23 + 21
         = (111010)2
    (0.625)10 = 0.5 + 0.125 = 2-1 + 2-3
             = (0.101)2
Repeated Division-by-2
Method
   To convert a whole
    number to binary, use
    successive division by
    2 until the quotient is     2 43
                                2 21 rem 1  LSB
    0. The remainders
    form the answer, with       2 10 rem 1
                                2 5 rem 0
    the first remainder as      2 2 rem 1
    the least significant bit   2 1 rem 0
    (LSB) and the last as          0 rem 1  MSB
    the most significant
    bit (MSB).
    (43)10 = (101011)2
Repeated Multiplication-by-
2 Method
   To convert decimal
    fractions to binary,
    repeated multiplication by
    2 is used, until the
    fractional product is 0 (or                    Carry
    until the desired number of   0.3125×2=0.625   0       MSB
    decimal places). The          0.625×2=1.25     1
    carried digits, or carries,
    produce the answer, with      0.25×2=0.50      0
    the first carry as the MSB,   0.5×2=1.00       1       LSB
    and the last as the LSB.
    (0.3125)10 = (.0101)2
Conversion between
Decimal and other Bases
   Decimal to base-R
     whole numbers: repeated division-by-R
     fractions: repeated multiplication-by-R
Conversion between
Bases
   In general, conversion between bases can
    be done via decimal:
          Base-2              Base-2
          Base-3              Base-3
          Base-4    Decimal   Base-4
            …                   ….
          Base-R              Base-R
Binary-Octal/Hexadecimal
Conversion
   Binary → Octal: Partition in groups of 3
      (10 111 011 001 . 101 110)2 = (2731.56)8
   Octal → Binary: reverse
      (2731.56)8 = (10 111 011 001 . 101 110)2
   Binary → Hexadecimal: Partition in groups
    of 4
      (101 1101 1001 . 1011 1000)2 = (5D9.B8)16
   Hexadecimal → Binary: reverse
      (5D9.B8)16 = (101 1101 1001 . 1011 1000)2