Grzegorz Budzyń
Lecture 1:
Introduction
Plan
• Introduction
• Course requirements
• Work plan for the semester
• First lecture – Basic definitions,
Microcontroller, Microprocessor
Introduction
Source: [1]
– Simple construction
– Reduced efficiency
– Very popular
– Most microcontrollers works with this architeture
Microprocessor classifications
• MISD features:
– Many instruction streams
– Single data stream
Source: [1]
– Parallel operation
– Many units makes the
same operation on one
data
– Rarely used
Microprocessor classifications
• SIMD features:
– Single instruction stream
– Many data streams
Source: [1]
– Efficient parallel processing
– Different data processed in the
same way
– Used in supercomputers, vector
coprocessors and DSP
Microprocessor classifications
• MIMD features:
– Many instruction streams
– Many data streams
Source: [1]
– Efficient parallel processing
– Many units operates
independently and
asynchronously
– Used in computation networks
Microprocessor classifications
• CISC architecture:
– Large number of instructions
– Small optimization
– Some instructions need many clock cycles
– Existance of complex instructions
– Large number of addressing modes
– Smaller processor clocking as compared to RISC
architecture
Microprocessor classifications
• RISC architecture:
– Reduced number of instructions (even below 30)
– Most instructions performed in one clock cycyle
– Instructions simple or very simple
– Limited access to memory
– Large number of auxiliary registers
Microprocessor classifications
• Von Neumann architecture
Source: [2]
Microprocessor classifications
• Harvard architecture
Source: [2]
8-bits vs 16-bits vs 32-bits
• Some remarks:
– More bits = easier operation with large number of
data
– More bits = less problems with computation
errors
– More bits ≠ faster operation
8-bits vs 16-bits vs 32-bits
• Some remarks:
– Simpler processors can be “overclocked” more
easily
– 32-bit processors are usually faster because that is
necessary
– Smaller processors are very often much more
efficient and simpler for programming then their
“large” brothers
Numbers in microcontrollers
• CPUs natively support only integer
numbers – signed or unsigned
• CPU accumulator width defines size of
supported numbers:
– 8b -> [0;0xff] = [0;255]
– 16b -> [0;0xffff] = [0;65535]
– 32b -> [0;0xffffffff] = [0;4294967296]
Numbers in microcontrollers
• Signed integers are usually written in U2
code:
i.e.
-1 = 0xff
-128 = 0x80
Numbers in microcontrollers
• In CPUs there is problem with non-integer
numbers
• Some CPUs support fractional numbers
• Some have additional coprocessor
(Floating Point Unit – FPU) for real
numbers calculation
Numbers in microcontrollers
• Comparison of Integer and Fractional
numbers:
Numbers in microcontrollers
• Integer:
– 8-bit (Byte)
– 16-bit (Word)
– 32-bit (Long)
• Float:
– Single precision (float)
– Double precision (double)
Numbers in microcontrollers
• Single precision:
S EEEEEEEE FFFFFFFFFFFFFFFFFFFFFFF
01 89 31
S E −127
X = (−1) • 1.F • 2
S – sign
E – exponent bits
F - fraction
Numbers in microcontrollers
• Double precision:
S EEEEEEEEEEE FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
01 11 12 63
S E −1023
X = (−1) • 1.F • 2
S – sign
E – exponent bits
F - fraction
Endiannes
• Endiannes is the same as byte-order
• Big-endian = MSB goes first
• Little-endian = LSB goes first
Benchmarking
Benchmarking
• Benchmarking is used for speed comparation
of microprocessors and microcontrollers
• Comparing microprocessors is difficult
• Comparing microcontrollers is even more
difficult – it is fairly easy to compare cores but
very hard to compare peripherals!!!
Benchmarking
• Main measures of microcontrollers core speed
are:
– MIPS
– DMIPS
– FLOPS
Benchmarking - MIPS
• MIPS – Millions of Instructions Per Second
• Simple algorithm usually used – speed of NOP
instruction ☺
• Comparison of processors speeds requires thorough
analysis.
• The speed of a given CPU is dependent upon many
factors:
– the type of instructions being executed,
– the execution order and
– the presence of branch instructions (pipeline!)
Benchmarking - MIPS
• CPU instruction rates are usually different from clock
frequencies
• Each instruction usually require several clock cycles
to complete
• The number of cycles required for instructions to
complete is dependent upon the instruction being
executed
• MIPS can be useful when comparing performance
between processors made from a similar
architecture
Benchmarking - DMIPS
• DMIPS – another name for Dhrystone type
computer speed test
• Dhrystone is a synthetic computing
benchmark intended to be representative of
system (integer) programming
• The algorithm is well documented and can be
made to work on almost any system
Benchmarking - DMIPS
• DMIPS – shortcomings:
– it features unusual code that is not usually
representative of real-life programs
– it is susceptible to compiler optimizations
– Dhrystone's small code size may fit in the
instruction cache of a modern CPU, so that
instruction fetch performance is not rigorously
tested
Benchmarking - FLOPS
• FLOPS - FLoating-point Operations Per Second
• Measure of floating point arithmetic
operation speed of a microcontroller
• Similar to MIPS but for floating point numbers
Thank you for your attention
References
[1] www.wikipedia.org
[2] http://www.scribd.com/doc/1532910/Von-Neumann-
Computer-Architecture
[3] www.atmel.com