How computers calculate - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

How computers calculate

Description:

First half-adder adds two input digits, giving unit and carry digit ... OR gives carry digit if either half-adder has a carry digit (you will never have ... – PowerPoint PPT presentation

Number of Views:28
Avg rating:3.0/5.0
Slides: 22
Provided by: DJWa5
Learn more at: https://www.rpi.edu
Category:

less

Transcript and Presenter's Notes

Title: How computers calculate


1
How computers calculate
  • How binary operations yield complex capabilities

2
Activity Part 1
  • Answer the questions in the Before You Start
    section

3
Why Digital Not Analog?
  • What is difference?
  • Digital is discrete number analog varies
    continuously
  • Analog signals prone to distortion because of
    large range
  • Analog signals lose information with every
    replication and over time

4
Discussion Question
  • What are some applications for which you would
    prefer an analog device? When would a digital
    device be preferable?

5
Why Binary not Decimal?
  • Two options is a lot easier to manage than 10
  • Switch can be on/off
  • Less confusion between different settings
  • Faster

6
What is Binary?
  • Only uses digits 1 and 0
  • So 1110 (112)
  • 10111 (213)
  • 111100 (314)
  • 10011010? (182819)
  • 10011 (1216)

7
Activity Part 2
  • Hook up the equipment as shown by your
    instructor, and answer the first 3 questions in
    the What type of signal is it? section

8
What Good is Binary?
  • Can use numbers to represent letters
  • Standard code ASCII has 7 binary digits (bits)
    per character
  • e 1100101
  • ! 0100001
  • Del 1111111
  • E 1000101

9
Activity Part 3
  • Answer questions 4-8 in the What are the
    properties of the signal? section

10
Activity Part 4
  • Answer questions 9-15 in the How do signals from
    different keys compare? section

11
Boolean Logic
  • NOT the simplest outputs the opposite of the
    input.
  • AND outputs a 1 only if both of its two inputs
    are 1.
  • NAND outputs a 1 unless both of its two inputs
    are 1.
  • OR outputs 1 if either input is 1.
  • XOR outputs 1 if only one input is 1

12
So how do these do math?
  • Can create a half-adder and a full adder
  • Half-adders add two digits and output the unit
    output and the carry digit
  • Full -adders add two digits and a carried digit
    and give the two outputs

13
Creating a half-adder
  • An XOR gate can give the unit output
  • 0 0 ? 0
  • 0 1 ? 1
  • 1 0 ? 1
  • 1 1 ? 0
  • An AND gate can give the carry digit
  • 0 0 ? 0
  • 0 1 ? 0
  • 1 0 ? 0
  • 1 1 ? 1

14
Creating a full-adder
  • Combine 2 half-adders and 1 OR
  • First half-adder adds two input digits, giving
    unit and carry digit
  • Second adds new unit digit with carry input,
    giving final unit output and carry digit
  • OR gives carry digit if either half-adder has a
    carry digit (you will never have carry digits
    from both)

15
Adding 1111
Ones (20)
Twos (21)
1
1
1
1
1
1
1
0
1
1
So answer is 110, or 6 in decimal representation
16
Adding large numbers
  • Start with right-most digits and work left
  • Number of gates needed grows quickly

17
An exercise
  • How many gates needed to add any possible 2-digit
    decimal integers?
  • 9916413201608041211
  • So need to add 2 7-digit binary numbers
  • Need one half-adder and 6 full-adders
  • Half-adder has 1 XOR and 1 AND
  • Full-adders have 2 XOR, 2 AND, 1 OR
  • Total is 13 XOR, 13 AND, 6 OR

18
Discussion Question
  • Think about different mathematical functions you
    are familiar with. Could you perform each of
    them using only adders and half-adders? How
    would you do it?

19
The Rest of Mathematics
  • Subtraction, Multiplication, and Division can be
    performed by combos of Addition and data shifting
  • Mathematical features such as Taylor sums can be
    used to express complicated functions using
    addition.
  • Data processing boils down to nothing but
    addition (and storage and shifting).

20
So what have we learned today?
  • Computers use digital binary numbers to
    communicate and calculate
  • One convention for expressing text as binary
    numbers is ASCII
  • Keyboards do not use ASCII, but use a quite
    different format
  • Boolean operators can process binary information
  • AND, NAND, and XOR can be used to create
    half-adders and full-adders
  • All mathematical functions can be performed by a
    series of addition and data shifting

21
Evaluation
  • Log on to WebCT and answer the 6 questions in the
    Act02eval quiz
Write a Comment
User Comments (0)
About PowerShow.com