CSCE 211: Digital Logic Design - PowerPoint PPT Presentation

About This Presentation
Title:

CSCE 211: Digital Logic Design

Description:

Repeatedly subtract from the number the largest power of 2 less than that number ... Binary Subtraction. Subtraction can be ... Overflow in Binary Subtraction ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 28
Provided by: huan75
Learn more at: https://cse.sc.edu
Category:
Tags: csce | design | digital | iff | logic | subtract

less

Transcript and Presenter's Notes

Title: CSCE 211: Digital Logic Design


1
CSCE 211Digital Logic Design
  • Chin-Tser Huang
  • huangct_at_cse.sc.edu
  • University of South Carolina

2
Chapter 1 Introduction
3
Digital Systems
  • They are everywhere!
  • They are usually binary operating on two-valued
    signals
  • Take an arbitrary number of inputs and produce an
    arbitrary number of outputs
  • Some systems require a timing signal called clock

4
(No Transcript)
5
Examples
  • A system with three inputs, A, B, and C, and one
    output Z, such that Z 1 if and only if two of
    the inputs are 1
  • A system with eight inputs, representing two
    4-bit binary numbers, and one 5-bit output,
    representing the sum

6
Examples
  • A system with one input, A, plus a clock, and one
    output, Z, which is 1 iff the input was one at
    the last three consecutive clock times
  • A traffic controller on two streets the light is
    green on each street for a fixed period of time,
    then goes to yellow for another fixed period and
    finally to red. The only input to this system is
    the clock

7
Truth Table
  • Describe the behavior of a digital system in
    tabular form

8
A Brief Review of Number Systems
  • Integers are usually written using a positional
    number system
  • N an-1rn-1 an-2rn-2 a2r2 a1r a0
  • where 0 ? ai lt r

9
Conversion between Number Systems
  • How to convert from binary to decimal? Evaluate
    the power series
  • Example 1010112 ?

10
Conversion between Number Systems
  • How to convert from decimal to binary? Two
    algorithms
  • Repeatedly subtract from the number the largest
    power of 2 less than that number and put a 1 in
    corresponding position
  • Repeatedly divide the number by 2 and put the
    remainder from right to left

11
(No Transcript)
12
(No Transcript)
13
Hexadecimal
  • Radix r 16
  • Why use hexadecimal? Shorthand notation for
    binary
  • Grouping 4 bits in binary to get 1 digit in
    hexadecimal

14
Binary Addition
15
One-bit Adder
16
4-bit Adder
17
Signed Numbers
  • Signed-magnitude human friendly, but causes
    complexity of arithmetic
  • Twos complement store a as the binary
    equivalent of 2n a in an n-bit system

18
Twos Complement
  • An easier way to get twos complement
    representation for a negative number
  • Find binary equivalent of the magnitude
  • Complement each bit (change 0s to 1s, and
    change 1s to 0s)
  • Add 1

19
Addition using Twos Complement
  • Its simple!
  • Do the binary addition as usual
  • If there is a carry out of the most significant
    bit, just ignore it
  • But watch out for overflow!
  • Overflow occurs when the sum is out of range,
    which indicates an error

20
(No Transcript)
21
Binary Subtraction
  • Subtraction can be accomplished by
  • Taking the twos complement of second operand
  • Adding the first operand and the twos complement
    of second operand

22
Overflow in Binary Subtraction
  • For unsigned numbers, overflow occurs when the
    second number is larger than the first number,
    and is indicated by a carry out of 0
  • For signed numbers, overflow may occur if we
    subtract a negative number from a positive one or
    subtract a positive number from negative one

23
Binary Coded Decimal (BCD)
  • Most computers operate on binary numbers
  • However, for computers to interface with humans,
    the mode of communication is generally decimal
  • Convert from decimal to binary on input
  • Convert from binary to decimal on output
  • But the decimal output still needs to be coded
    into binary, digit by digit

24
Binary-Coded Decimal Codes
25
Other Codes
  • ASCII used to transmit alphanumeric information
  • Gray code consecutive numbers differ in only one
    bit
  • Particularly useful in coding the position of a
    continuous device and error detection

26
(No Transcript)
27
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com