Notes
Slide Show
Outline
1
Hardware


2
Where are we?
  • Computer Science is the study of algorithms, including their
    • Formal and mathematical properties
      • We’re mostly done with this part
    • Hardware realizations
      • Computing Agents
    • Linguistic realizations
    • Applications
3
Computer Hardware
  • Binary numbers are used to encode all forms of data, such as numbers and letters
  • Electric circuits process and store binary data
  • Simple gates can be combined to build circuits for any computation
  • Boolean logic is a useful abstraction of electric circuits
4
Binary Representation of Information
  • Detecting Voltage Levels
    • Why not 10 levels?
      • Would be unreliable
      • Not enough difference between states
    • On/Off
    • Fully Charged - Fully Discharged
    • Magnetized - Demagnetized
5
Binary Numbers
  • Base 2 - digits 0 and 1



  • ___ ___ ___ ___ ___ ___
  • 25 24 23 22 21 20
6
Converting Binary to Decimal
  • The position of each digit determines its value
  • for example, the binary number 101011 equals:
  •  1x25 + 0x24 + 1x23 + 0x22 + 1x21 + 1x20   =
  •    32  +    0    +   8    +   0    +   2     +   1     =  4310
  • note the similarity with decimal numbers:
  •       57210 = 5x102 +  7x101 + 2x100
7
Calculating in binary
  • First practice counting to 2010 in binary
  • Practice adding:  10112 + 1012
  • Try subtracting: 10112 - 1012



8
Shorthand Notation
  • Octal (Base 8) digits 0-7
  • Hexadecimal (Base 16) digits 0-F


  •  ___ ___ ___ ___ ___ ___
  • 85 84 83 82 81 80


  •  ___ ___ ___ ___ ___ ___
  • 165 164 163 162 161 160



9
Binary numbers can represent all types of data
  • negative integers:  reserve the leading bit for sign (0=positive; 1=negative)
  • letters: ASCII codes (using 8 bits=1 byte)
  •      A = 01000001, B=01000010, C=01000011, and so on…
  • Why do they call it a byte? What is 4 bits called?
  • Other digital data: MP3, DVD, JPEG, etc.
10
A Switch is a 2-state device that can be toggled
  • A relay is a switch built with an electromagnet
11
Switches can do it all
  • With switches we can implement AND, OR, and NOT gates
  • With just those types of gates, we can design circuits to perform any computation
12
Basic electric circuits:
Computing AND
13
Basic electric circuits:
Computing OR
14
Basic electric circuits:
Computing NOT
15
A better switch: Transistors
  • bi-stable, solid state device
  • switching is done electronically, not mechanically
  • no  moving parts; therefore, fast, small, reliable
  • can switch states in about one 10 billionth of a second
  • about 5 million transistors can fit on a chip 1 centimeter square.  Density is increasing rapidly with new technology.
16
Summary
  • Computers use binary numbers for storage and computation because
    • all types of data can be stored this way
    • 2-state devices are highly reliable
  • A switch is a 2-state device that can be toggled
  • Switches can implement AND, OR, and NOT gates
  • With these gates, we can perform any computation, as we’ll see next time!