digital systems and binary numbers - national chiao tung ... · pdf file digital systems and...

Click here to load reader

Post on 07-Mar-2020

14 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

  • Digital Circuit Design

    Digital Systems and Binary Numbers

    Lan-Da Van (范倫達), Ph. D.

    Department of Computer Science

    National Chiao Tung University Taiwan, R.O.C.

    Spring, 2017

    ldvan@cs.nctu.edu.tw

    http://www.cs.nctu.edu.tw/~ldvan/

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-2

    Digital Systems

    Binary Numbers

    Number-Base Conversion

    Octal and Hexadecimal Number

    Signed Binary Numbers

    Binary Codes

    Binary Storage and Registers

    Binary Logic

    Outline

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-3

    Digital age and information age

    Digital computers

    – general purposes

    – many scientific, industrial and commercial applications

    Digital systems

    – smartphone

    – digital camera

    – electronic calculators, PDA's

    – digital TV

    Discrete information-processing systems

    – manipulate discrete elements of information

    Digital System

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-4

    A Digital Computer Example

    Synchronous or

    Asynchronous?

    Inputs: keyboard,

    mouse, modem,

    microphone,

    posture

    Outputs: LCD,

    modem, speakers

    Memory

    Control unit

    Datapath

    Input/Output

    CPU

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-5

    Signal

    An information variable represented by physical quantity

    For digital systems, the variable takes on digital values

     Two level, or binary values are the most prevalent values

    Binary values are represented abstractly by:

     digits 0 and 1

     words (symbols) False (F) and True (T)

     words (symbols) Low (L) and High (H)

     words On and Off.

    Binary values are represented by values or ranges of

    values of physical quantities

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-6

    Signal

    Analog signal

     t->y: y=f(t), y:C, n:C

    Discrete-time signal

     n->y: y=f(nT), y:C, n:Z

    Digital signal

     n->y: y=D{f(nT)}, y:Z,n:Z

    )3(

    )1(

    )2(

    )1(

    2)1110(

    2)1000( 2)1011( 2)1000(

    t n n

    y y y

    Analog Signal Discrete-Time Signal Digital Signal

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-7

    Binary Numbers

    Decimal number

    5 4 3 2 1 0 1 2 3

    5 4 3 2 1 0 1 2 310 10 10 10 10 10 10 10 10a a a a a a a a a   

               

    … a5a4a3a2a1a0.a1a2a3…

    Decimal point

    3 2 1 07,329 7 10 3 10 2 10 9 10       

    Example:

    ja

    Base or radix

    Power

    General form of base-r system 1 2 1 1 2

    1 2 1 0 1 2

    n n m

    n n ma r a r a r a r a a r a r a r    

                      

    Coefficient: aj = 0 to r  1

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-8

    Example: Base-2 number

    Binary Numbers

    2 10

    4 3 2 1 0 1 2

    (11010.11) (26.75)

    1 2 1 2 0 2 1 2 0 2 1 2 1 2 

                 

    Example: Base-5 number

    5

    3 2 1 0 1

    10

    (4021.2)

    4 5 0 5 2 5 1 5 2 5 (511.5)          

    Example: Base-8 number

    Example: Base-16 number

    3 2 1 0

    16 10(B65F) 11 16 6 16 5 16 15 16 (46,687)        

    4

    10 1012

    8

    )5.87(84878281

    )4.127(

     

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-9

    Binary Numbers

    Example: Base-2 number

    2 10(110101) 32 16 4 1 (53)    

    Special Powers of 2

     210 (1024) is Kilo, denoted "K"

     220 (1,048,576) is Mega, denoted "M"

     230 (1,073, 741,824) is Giga, denoted "G"

     240 (1.0995116e+12) is Tera, denoted “T"

     250 (1.1258999e+15) is Peta, denoted “P"

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-10

    Arithmetic operations with numbers in base r follow the same rules as decimal numbers.

    Binary Numbers

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-11

    Binary Arithmetic

    Addition

    Augend: 101101

    Addend: +100111

    Sum: 1010100

    Subtraction

    Minuend: 101101

    Subtrahend: 100111

    Difference: 000110

    The binary multiplication table is simple:

    0  0 = 0 | 1  0 = 0 | 0  1 = 0 | 1  1 = 1

    Extending multiplication to multiple digits:

    Multiplicand 1011

    Multiplier  101

    Partial Products 1011

    0000 -

    1011 - -

    Product 110111

    Multiplication

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-12

    Octal and Hexadecimal Numbers

     Numbers with different bases: Table 1.2.

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-13

    Example1.1

    Convert decimal 41 to binary. The process is continued until the integer quotient

    becomes 0.

    Number-Base Conversions

    10/2

    5/2

    2/2

    1/2

    5

    2

    1

    0

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-14

     The arithmetic process can be manipulated more conveniently as follows:

    Number-Base Conversions

    Answer=(101001)2

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-15

    Example 1.2

    Convert decimal 153 to octal. The required base r is 8.

    Number-Base Conversions

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-16

    Example1.3

     To convert a decimal fraction to a number expressed in base r, a similar

    procedure is used. However, multiplication is by r instead of 2, and the

    coefficients found from the integers may range in value from 0 to r  1

    instead of 0 and 1.

    Convert (0.6875)10 to binary.

    The process is continued until the fraction becomes 0 or until the number of digits has

    sufficient accuracy.

    Number-Base Conversions

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-17

    Example1.4 Convert (0.513)10 to octal.

     From Examples 1.1 and 1.3: (41.6875)10 = (101001.1011)2

     From Examples 1.2 and 1.4: (153.513)10 = (231.406517)8

    Number-Base Conversions

  • Lecture 1

    Digital Circuit Design

    Lan-Da Van DCD-01-18

     Conversion from binary to octal can be done by positioning the binary number into

    groups of three digits each, starting from the binary point and proceeding to the left

    and to the right.

     Conversion from binary to hexadecimal i

View more