Recall '''Numbers in Binary - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

Recall '''Numbers in Binary

Description:

represents musical notes, time between notes, tempo, sustain, each as a unique ... more samples, the smaller the less blocky our curve, and the closer our ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 27
Provided by: cspeo
Learn more at: http://cs-people.bu.edu
Category:

less

Transcript and Presenter's Notes

Title: Recall '''Numbers in Binary


1
Recall ...Numbers in Binary
  • Remember
  • Binary representations of...
  • Symbols
  • Images
  • Music
  • In this lecture
  • Further binary representations of data
  • Sound
  • Instructions
  • Binary logic

2
Representation of Music
3
Representation of Sound
sound waves
paper cone
magnet
voltage wires
coil
4
Representation of Sound
5
Representing anything in Binary
  • Programs/Instructions?
  • A program is a sequence of tasks
  • each unique task can be represented by a sequence
    of bits
  • seems nearly anything can be represented in
    binary...
  • So, how did we wind up with bits anyway?

6
Logic and Logic Circuits
  • What is a circuit?
  • the complete path of an electric current, or a
    collection of electronic elements
  • We are interested in logic circuits, those whose
    output varies depending on their input
  • Logic circuits emulate the Boolean logic
    operators from propositional logic

7
Binary for Logic?
  • In Propositional Logic we examine the truth of
    logical sentences across all possible scenarios.
  • Sentences consist of
  • Variables
  • sub-sentences (A, B, C ) which are either true
    or false
  • In computer science, we use
  • true 1
  • false 0
  • Logical Operators
  • e.g., NOT, OR, AND, XOR, NAND, NOR
  • Example sentence
  • X (A AND B) OR C
  • We examine the logical outcome of a sentence
    through truth table analysis

8
Simplest Truth Tablea Single Variable
9
Logical AND
10
Logical AND on two variables

11
Logical Or
  • A OR B
  • A ? B
  • Has two values true if either A or B is true, or
    if both A and B are true
  • false if they are both false.
  • Are either of these things true?
  • Note both can be true this is not exclusive or

12
Logical Not
  • Used to invert a meaning
  • NOT A as an alternative
  • A It is raining
  • ?A It is not raining

13
XOR- Exclusive Or
  • True when either A or B are true, but not both
  • So A and NOT B or B and NOT A
  • Built from simpler logic
  • (A ? ?B) ? (?A ? B)

14
Nor and Nand
15
Truth Table Analysis
  • How do you build a truth table?
  • Step 1 Create columns for all the variables in
    the sentence
  • Step 2 Determine the number of rows you need
    given the variables in your sentence
  • Step 3 Define all possible sequences (cases) for
    your truth table, starting with all variables
    false and ending with all variables true
  • Step 4 De-construct the logic in the sentence
    and fill in your table
  • What is the truth table for
  • X A AND (NOT B)
  • X (NOT A) AND (NOT B)
  • X (A OR B) AND C

16
Logic and Logic Circuits
  • What is a circuit?
  • the complete path of an electric current, or a
    collection of electronic elements
  • we will consider transistors to be the basic
    building blocks of logic computer hardware.
  • Logic circuits are built from a series of
    transistors
  • What is a transistor?

17
Transistors
  • A transistor is an electronic device that has
    three ends a source, a sink, and a gate
  • In this type of transistor, when the gate is
  • ON, power flows from the source to the sink.
  • OFF, power does not flow to the sink

source
gate
sink
18
Transistors (like faucets)
  • The operation of a transistor could be explained
    by making an analogy to faucets.
  • A faucet has
  • An input
  • the water company
  • source
  • An output
  • a sink (where water is drained)
  • sink
  • Flow control
  • If the tap knob (gate) is turned
  • ON water flows from the source to the sink
  • OFF no water flows.
  • The state of the tap determines the presence of
    water at the sink

19
Transistors (like faucets)
  • Changing from water to electricity in
    transistors
  • Electricity flows from the source to the sink
    with the gate 1 (ON)
  • Electricity does not flow from the source to the
    sink with the gate 0 (OFF)

20
Transistors
  • The current technology used to build computer
    hardware (chips) is called CMOS.
  • In CMOS we also use another kind of transistor,
    distinguished by the little bubble
  • The bubble means that this transistor works in
    the opposite way (it's ON when the gate is OFF
    and OFF when the gate is ON).

source
gate
sink
21
Building Complicated Circuits with Transistors
Battery
  • What on earth does this do?
  • If A0 then . . .
  • bottom gate is off
  • top gate is on
  • power flows from the battery, cant go out the
    sink, and goes out through Z. Z 1
  • If A 1 then
  • bottom gate is on
  • top gate is off
  • power doesnt get to Z from the battery, and any
    power left in Z will flow out the sink. Z 0

A
Z
22
Building Circuits with Transistors
Battery
A
Z
23
Building Circuits with Transistors
Battery
What does this circuit do? -- build a truth
table!
A
B
Z
24
Building Circuits with Transistors
Battery
A
B
Z
Looks like a negated AND (NAND) Attach a NOT
circuit to the output of Z and wed get AND
25
Building Circuits with Transistors
Battery
A
B
Z
26
Logic Gates
Write a Comment
User Comments (0)
About PowerShow.com