# Computer Engineering 360 – Microprocessors and Microcontrollers

Document Sample

```					       CS 150
Computer Organization &
Architecture

Lecture 2
Overview
 Quiz 2
 Topics
   Digital & Analog Systems
   Number Systems
   Codes
 New Skill:
   Dealing with ESD
Digital And Analog Systems
 Definitions
   ANALOG
• Values are continuously variable (on, off, or
anything in between)
• Examples: dimmer light switch, clock with hands
   DIGITAL
• Values take only two forms (on or off -- nothing in
between)
• Examples: toggle light switch, numeric clock
Digital and Analog Systems
Digital                           Analog
discrete steps                    continuously variable
number representations            voltages or currents
switching                         amplification/attenuation
easier to design                  real world is mainly analog
easier to store data
greater accuracy & precision
programmable
resistant to noise & component drift
smaller IC’s
Real World System

Temperature   Measuring   Analog             Digital       Digital    Digital
(Analog)     Device                                    Processing

Temperature
Positional Number Systems
 Each symbol     has intrinsic value
   7 has more value than 3

 The position of   the symbol has value
   Example: 307
   The 3 has more value than the 7 because it
represents 3 hundreds (3 X 102) while 7
represents only 7 ones (7 X 100)
Important Number Bases
 Base 2   or Binary
   Number system used by computers
 Base 10    or Decimal
   Number system used by people
   Convenient shorthand for long binary
numbers
Binary Numbers
BASE 10                                 BASE 2
Has 10 numeric symbols (0-9)            Has 2 numeric symbols (0-1)
Position of digit has meaning           Position of bit has meaning
Next number after 9 is 10               Next number after 1 is 10
Examples:
30510 = 300 hundreds position = 3 x 102 (MSD)
+ 00 tens position = 0 x 101
+ 5 ones position = 5 x 100 (LSD)
305
10112 = 1000 eights position 1 x 23 (MSB)
+ 000 fours position 0 x 22
+ 10 twos position 1 x 21
+ 1 ones position 1 x 20 (LSB)
1011
Hex Numbers
BASE 10                              BASE 16
Has 10 numeric symbols (0-9)         Has 16 numeric symbols (0-
9,A-F)
Position of digit has meaning        Position of digit has meaning
Next number after 9 is 10            Next number after F is 10
Examples:
305d = 300 hundreds position = 3 x 102 (MSD)
+ 00 tens position = 0 x 101
+ 5 ones position = 5 x 100 (LSD)
305
1F2Ch = 1000 fourth position 1 x 163 (MSD)
+ F00 third position F x 162
+ 20 second position 2 x 161
+ C first position C x 160 (LSD)
1F2C
Number Counting
Base 10:    0    Base 2:       0   Base 16: 0
1                  1            1
2                 10            2
3                 11            3
4                100            4
5                101            5
6                110            6
7                111            7
8               1000            8
9               1001            9
10               1010            A
11               1011            B
12               1100            C
13               1101            D
14               1110            E
15               1111            F
16              10000           10
Identifying the Base
 Base 2   number
   1010b
   10102
 Base 10      number
   1010d
   101010
 Base 16      number
   1010h
   101016
Binary to Decimal Conversion
 101011.1b =         ???d

   Multiply each digit by its position
(1 x 23) + (0 x 22) + (1 x21) + (1 x 20) + (1 x 2-1)

= 32d + 0d + 8d + 0d + 2d + 1d + ½d

   = 43.5d
Decimal to Binary Conversion
   213d = ???b

   Divide base 10 number by 2 and record the remainders. First
remainder is LSB.
213d ==>213/2 = 106 R = 1 (LSB)
106/2 = 53 R = 0
53/2 = 26 R = 1
26/2 = 13 R = 0
13/2 = 6 R = 1
6/2 = 3 R = 0
3/2 = 1 R = 1
1 /2 = 0 R = 1 (MSB)

 Concatenate remainders.
11010101b
|       |
MSB     LSB
Binary to Hex Conversion
   1110110111b = ???h

1110110111b = 0011 1011 0111

   Convert each group of 4 bits into 1 hexadecimal digit.
0011 1011 0111
3h    Bh 7h

   Concatenate hexadecimal digits for complete
solution.
3B7h
Hex to Binary Conversion
 9F =   ???b
   Convert each hexadecimal digit into its 4-bit
binary equivalent.
9      F
1001b 1111b

   Concatenate binary bits for complete solution.
10011111b
Hex to Decimal Conversion
   BF3h = ???d
 Multiply each digit by its position
(B x 162 ) + (F x 161 ) + (3 x 160 ) = (11 x 256) + (15 x 16) + (3 x 1)

= 2816d + 240d + 3d
      = 3059d
   OR . . .Convert hexadecimal to binary, then binary to decimal.
BF3h = 1011 1111 0011
= 101111110011b
= 2048 + 512 + 256 + 128 + 64 + 32 + 16 + 2 + 1
= 305910
Decimal to Hex Conversion
   7213d = ???h
    Divide base 10 number by 16 and record the remainders. First
remainder is LSB.
7213d ==>     7213/16 = 450 R = 13 = D (LSB)
450/16 = 28 R = 2
28/16 = 1 R = 12 = C
1/16 = 0 R = 1 (MSB)
   Concatenate remainders.
1C2Dh
|   |
MSD LSD

   OR . . . Convert decimal to binary, then binary to hexadecimal.
7213d = 11100001011012
= 0001 1100 0010 1101
= 1h    Ch 2h Dh
= 1C2Dh
Binary Coded Decimal (BCD)
 Decimal numerals represented by binary bits, but the
conversion is not a binary number.
 It is a code -- not a positional number system

Decimal
Digit       BCD
Convert 249610 to BCD:
0          0000
1          0001              2      4       9        6
2          0010
3          0011            0010    0100    1001    0110
4          0100
5          0101
Note: this is very different than
6          0110
7          0111            converting decimal to binary
8          1000            249610 = 1001110000002
9          1001
10          0001   0000
ASCII Code
 7-bit code for storing alphanumeric and control
characters in computer memory
 See ASCII Table in your text or at
http://www.AsciiTable.com
Partial ASCII Table:

Example: Convert “help” to ASCII
h         e         l        p
1101000 1100101 1101100 1111000
Gray Code
 A binary code that changes by only 1 bit between
successive codes.
 Used extensively for positional sensors.

2 Bit Example:     00           3 Bit Example:       000
01                                001
11                                011
10                                010
110
111
101
100
Today’s Skill: Dealing with ESD
Typical Static Voltage Generation
Source               10-20%        65-90%
humidity      humidity
Walking on carpet           35,000 volts   1,500 volts
Walking on vinyl flooring   12,000 volts     250 volts
Worker at a bench            6,000 volts     100 volts
Vinyl envelopes (Work        7,000 volts     600 volts
Instructions
Plastic bag picked up       20,000 volts   1,200 volts
from the bench
Work chair with foam pad    18,000 volts   1,500 volts

NOTE -- It takes <100V to damage modern electronic
components
Typical Static Charge Sources
Work surfaces   Waxed, painted or varnished surfaces
Glass
Untreated vinyl and plastics
Floors          Sealed concrete
Waxed or finished wood
Floor tile and carpeting
Clothes and     Non-ESD smocks
personnel       Synthetic materials
Non-ESD Shoes
Hair
Typical Static Charge Sources
Chairs             Finished wood
Vinyl and Fiberglass
Nonconductive wheels
Packaging and      Plastic bags, wraps, envelopes
handling materials Styrofoam
Bubble wrap, foam
Non-ESD totes, trays, boxes, parts bins
Assembly tools     Pressure sprays
and materials      Copiers, printers
Compressed air
Synthetic brushes
Heat guns, blowers
ESD damage prevention
 Combination of
   preventing static charges from developing
   eliminating static charge when present

***Need to ensure you do not have any
static charge prior to handling electronic
components
Preventing and Eliminating Static
Charge
 Keep electronic    components safe
   Conductive static-shielding boxes
   Antistatic bags and wraps
 Grounding Straps
 Heal Straps
 ESDShoes
 Smocks
ESD Safe Workstation
General Rules for Handling
Electronic Assemblies
 Keep work  stations clean and neat
 Minimize the handling of items
 Use clean gloves/hands
 Do not handle solderable surfaces with
bare hands
 Do not use hand creams or lotions
containing silicone
General Rules for Handling
Electronic Assemblies
 Never stack electronic assemblies
 Always assume the items are ESD
Sensitive (ESDS) even if they are not
marked
 Follow appropriate ESD practices and
procedures
 Never transport ESDS devices unless
proper packaging is applied
ESD Movie
 Let her   roll!
Homework
 HW   2: Chapt 2 Probs: 1, 3, 5
Summary
   Topics:
   Digital & Analog Systems
   Number Systems
• Binary (Base 2)
   Binary Codes
• Binary Coded Decimal (BCD)
• ASCII Code
• Gray Code
   New Skill:
   Dealing with ESD
Next Time
 Boolean algebra
   Basic operators
   Truth tables
   Expressions
 Logic Gates

```
DOCUMENT INFO
Shared By:
Categories:
Stats:
 views: 17 posted: 6/23/2011 language: English pages: 34