Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Hardware
Fig. 01-00
Basic components
fig_01_03
Some processor options
(note firmware)
1. Microprocessor-
based system
fig_01_05
2. Microcontroller-based
system
Fig. 1-05 components
integrated into one unit)
fig_01_07
DSP (A/D, D/A; high speed—video,
fig_01_06 audio, images
DATA: DATA TYPES
NUMERIC
--Unsigned integer
--Signed integer
(2’s complement,
sign-magnitude,
fixed point, etc.)
--Floating point:
3 components:
fig_01_08
sign
exponent
mantissa
NONNUMERIC
--address
--character
Numeric data
1. Range is always limited. Number of digits of resolution is
size of fractional part.
Example: in 4 numeric bits:
0 (integer) 0-15
1: xxx.x 0-7.5
(fractions 0, ½)
2: xx.xx 0-3.75
(fractions, 0, ¼, ½, ¾)
3: x.xxx 0-1.875
(fractions, 0, 1/8, ¼, 3/8, ½, 5/8, ¾, 7/8)
Most base 10 fractions cannot be represented exactly in
binary:
Example: how to represent 2.x in 4 bits, with 2 bits of
resolution? fig_01_09
rounding truncation
truncation
rounding Error range for n bits of resolution:
down Truncation: -2-n < Etruncation < 0
rounding Rounding: - ½ 2-n < Erounding < ½ 2-n
up
Computation: which is easier to compute?
Error propagation in arithmetic:
Examples:
Consider two numbers whose true values are N1 and N2
and whose values in the computing system are N1E and N2E
term 1 term 2
Another example (pp. 11-12 of text): measuring power
dissipated in resistor R in the following circuit: fig_01_10
Suppose E = 100 VDC +/- 1%, I = 10A +/- 1%, R = 10 ohms +/- 1%.
3 methods of caluculatin power dissipated, neglecting lower order error
terms:
a. E1 = (100V +/- 1%) * (10A +/- 1%) = 998.9 1001.1
b. I2R = (10A +/- 1%) * (10A +/- 1%) * (10 ohms +/- 1%) = 997 1003
c. E3 = (100 V +/- 1%)*(100 V +/- 1%) / (10 ohms +/- 1%) = 908.9
1111.3
Which should we use?
“optimistic”: a
“middle-of-the-road”: average of a,b,c
Instructions—ISA level
Instruction coding:
HLL (high level language, C, C++ , e.g.)
assembly language (ISA)
machine language
(can work at any level; high level allows faster but less
efficient coding)
IEEE Standard 694-1985—IEEE standard for microprocessor
assembly language—used for examples in text
Instruction coding: operator addr mode operand(s)
fig_01_14
fig_01_13
fig_01_15
Instructions
Instruction types:
arithmetic / logical
data movement
control
Arithmetic / logical instructions:
operator; number of operands; arity (unary, binary, three-operand,
…)
Examples:
x = -x negation, assignment
x=y assignment
x=x+y addition, assignment
Typical ALU
and
registers
fig_01_42
Common ALU functions
fig_01_43
fig_01_44
Common ALU functions (continued)
fig_01_45
Data movement instructions: source / destination
fig_01_16
Common data movement instructions
fig_01_17
fig_01_21
fig_01_22
fig_01_23
fig_01_24
Control instructions
Control can be:
sequential (default)
loop (pre or posttest)
branch:
go to
conditional (if, if-else,, case, branch on condition)
procedure or function calll
Branch instructions
Typical condition codes
fig_01_29
fig_01_30
Example of conditional statements: C / assembly language:
fig_01_31
fig_01_32
Looping: example
fig_01_34
fig_01_35
Function or procedure call:
Must store return address, pass information back and forth
fig_01_36
fig_01_37
fig_01_39
fig_01_40
fig_01_41
Question: can you design a “general-purpose
computer” with a 3-bit opcode?
Different viewpoint:
RTL: register-transfer language level
fig_01_46
Register behavior: Read / Write; Serial / Parallel
fig_01_49
fig_01_51
fig_01_50
RTL VIEW
fig_01_52
fig_01_53
Instruction execution cycle fig_01_55
fig_01_54
fig_01_57
fig_01_58
fig_01_59
table_01_03