Subject: ECE3004
Microprocessors and Microcontrollers
Faculty: Dr. N. Anveshkumar
Course type: LTP
Credits: 4
COMPUTER SYSTEM COMPONENTS
Memory
Stores instructions and data
Input/Output
Called peripherals
Used to input and output instructions and data
Arithmetic and Logic Unit
– Performs arithmetic operations (addition, subtraction)
– Performs logical operations (AND, OR, XOR, SHIFT, ROTATE)
COMPUTER SYSTEM
COMPONENTS
Control Unit
– Coordinates the operation of the computer
System Interconnection and Interaction
Bus—A group of lines used to transfer bits between the
microprocessor and other components of the computer
system. Bus is used to communicate between parts of the
computer. There is only one transmitter at a time and only
the addressed device can respond.
Types
» Address
» Data
» Control signals
CPU COMPONENTS
Registers
Hold data, instructions, or other items.
Various sizes.
Program counter and memory address registers must
be of same size/width as address bus.
Registers which hold data must be of same
size/width as memory words.
CPU COMPONENTS
Control Unit
Generates control signals which are
necessary for execution of an
instruction.
Connect registers to the bus.
Controls the data flow between
CPU and peripherals (including
memory).
Provides status, control & timing
signals required for the operation of
memory and I/O devices to the system.
Acts as a brain of computer system
All actions of the control unit are
associated with the decoding and
CPU COMPONENTS
Arithmetic and Logic Unit
Executes arithmetic and logical
operations.
Accumulator is a special 8-bit register
associated with ALU.Register ‘A’ in 8085 is
an accumulator.
Source of one of the operands of an
arithmetic or logical operation.
serves as one input to ALU.
Final result of an arithmetic or logical
operation is placed in accumulator.
ARITHMETIC AND
LOGIC UNIT
ALU performs the following arithmetic & logical
operations:
Addition
Subtraction
Logical AND
Logical OR
Logical EXCLUSIVE OR
Complement(logical NOT)
Increment (add 1)
Decrement (subtract 1)
Left shift, Rotate Left, Rotate right
Clear etc.
Data and instructions are stored in a single set o f
read-write memory. Contents of memory are
addressable by memory address, without regard to
the type of data contained.Execution occurs in a
sequential fashion, unless explicitly altered, from
one instruction to the other.
Performance metrics of CPU:
Short response time for a given piece of work
High throughput (rate of processing work)
Low utilization of computing resource(s)
High availability of the computing system or application
Fast (or highly compact) data compression and decompression
High bandwidth
Short data transmission time.
MICROPROCESSOR
is a semiconductor device
consisting of electronic logic
circuits
manufactured by using various
fabrication schemes
capable of performing computing
functions
capable of transporting
data/information
can be divided into 3 segments:
Arithmetic and Logic Unit
History: https://spectrum.ieee.org/the-surprising-story-of-the-first-microprocessors
Register Unit
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Intel 4004
Year of introduction
1971
4-bit microprocessor
4 KB main memory
45 instructions
PMOS technology
was first programmable device which was
used in calculators
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Intel 8008
Year of
introduc
tion
1972
8-bit
version
of 4004
16 KB
main
memor
y
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Intel 8080
Year of introduction 1973
8-bit microprocessor
64 KB main memory
2 microseconds clock cycle
time
500,000 instructions/sec
10X faster than 8008
NMOS technology
Drawback was that it
needed three power
supplies.
Small computers
(Microcomputers) were
designed in mid 1970’s
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Intel 8085
Year of introduction 1975
8-bit microprocessor-upgraded version
of 8080
64 KB main memory
1.3 microseconds clock cycle time
246 instructions
Intel sold 100 million copies of this
8-bit microprocessor
uses only one +5v power supply.
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Intel 8086/8088
Year of introduction 1978 for 8086 and 1979
for 8088
16-bit microprocessors
Data bus width of 8086 is 16 bit and 8 bit for 8088
1 MB main memory
400 nanoseconds clock cycle time
6 byte instruction cache for 8086 and 4 byte for
8088
Other improvements included more registers and
additional instructions
In 1981 IBM decided to use 8088 in its personal
computer
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Intel 80186
Year of introduction 1982
16-bit microprocessor-upgraded version of
8086
1 MB main memory
Contained special hardware like
programmable counters, interrupt
controller etc.
Never used in the PC
But was ideal for systems that required a
minimum of hardware
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Intel 80286
Year of introduction 1983
16-bit high performance microprocessor with
memory management & protection
16 MB main memory
Few additional instructions to handle extra 15
MB
Instruction execution time is as little as 250 ns
Concentrates on the features needed to
implement MULTITASKING
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Intel 80386
Year of introduction 1986
Intel’s first practical 32-bit microprocessor
4 GB main memory
Improvements include page handling in
virtual environment
Includes hardware circuitry for memory
management and memory assignment
Memory paging and enhanced I/O permissions
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Intel 80486
Year of introduction 1989
32-bit high performance microprocessor
4 GB main memory
Incorporates 80387-like floating point
coprocessor and
8 K byte cache on one package
About half of the instructions executed in
1 clock instead of 2 on the 80386
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Pentium
Year of introduction 1993
32-bit microprocessor, 64-bit data bus and
32-bit address bus
4 GB main memory
Double clocked 120 and 133MHz versions
Fastest version is the 233MHz, Dual
integer processor
16 KB L1 cache (split instruction and data:
8 KB each)
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Pentium Pro
Year of introduction 1995
32-bit microprocessor, formerly code-named
P6
64 GB main memory, 64-bit data bus and
36-bit address bus
16 KB L1 cache (split instruction/data: 8 KB
each), 256 KB L2 cache
Uses three execution engines
Intel launched this processor for the server
market
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Pentium II
Year of introduction 1997
32-bit microprocessor, 64-bit data bus and
36-bit address bus, MMX
64 GB main memory
32 KB split instruction/data L1 caches (16
KB each)
Module integrated 512KB L2 cache
(133MHz)
A version of P2 called Xeon; specifically
designed for high-end applications
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Pentium III
Year of introduction 1999
32-bit microprocessor, 64-bit data bus and
36-bit address bus
64 GB main memory
Dual Independent Bus (simultaneous L2 and
system memory access)
On-chip 256 KB L2 cache
P3 was available in clock frequencies of up to
1 GHz
HISTORICAL BACKGROUND OF INTEL
MICROPROCESSORS
Pentium IV
Year of introduction 2002
32-bit microprocessor, 64-bit data bus and
36-bit address bus
64 GB main memory
1.4 to 1.9 GHz and the latest at 3.20 GHz and
3.46GHz (Hyper-Threading)
1MB/512KB/256KB L2 cache
Specialized for streaming video, game
and DVD applications
Microprocessor and microcontrollers:
https://www.youtube.com/watch?v=_Cdf68NMTZ0.
Assembly language, high level language, low level language,
machine language:
http://www.itrelease.com/2018/07/difference-between-assembly-language-and-high
-level-language
/.
MOV A, M : Assembly language
7E (0111 1110): Machine language
Assembly language and machine language are treated as low level languages.
Assembly language vs high-level language :
In assembly language programs written for one processor will not run on another type of
processor. In high-level language programs run independently of processor type.
Performance and accuracy of assembly language code are better than a high-level.
High-level languages have to give extra instructions to run code on the computer.
Code of assembly language is difficult to understand and debug than a high-level.
One or two statements of high-level language expand into many assembly language
codes.
Assembly language can communicate better than a high-level. Some type
of hardware actions can only be performed by assembly language.
In assembly language, we can directly read pointers at a physical address which is not
possible in high-level
Working with bits is easier in assembly language.
Assembler is used to translate code in assembly language while the compiler is used to
compile code in the high-level.
The executable code of high-level language is larger than assembly language code so it
takes a longer time to execute.
Due to long executable code, high-level programs are less efficient than assembly
language programs.
High-level language programmer does not need to know details about hardware
like registers in the processor as compared to assembly programmers.
The most high-level language code is first automatically converted into assembly code.
Assembly Programming
• Machine Language
• binary
• hexadecimal
• machine code or object code
• Assembly Language
• mnemonics
• assembler
• High-Level Language
• Pascal, Basic, C
• compiler
Assembly Language Programming
Microprocessor development tools:
https://
csenotesforyou.blogspot.com/2016/12/assembly-language-program-development.
html
Hardware Tools :
. Software Tools !
In Circuit Emulator (ICE)
Assembler !
Logic Analyzer
Linker !
Emulator
Loader !
Compiler ! A debugger is a computer program used by programmers to test
Libraries ! and debug a target program. Debuggers may use instruction-set
Simulator ! simulators, rather than running a program directly on the
Debugger ! processor to achieve a higher level of control over its execution.
Locator ! This allows debuggers to stop or halt the program according to
specific conditions. However, use of simulators decreases
execution speed. When a program crashes, debuggers show the
position of the error in the target program. Most debuggers also
are capable of running programs in a step-by-step mode, besides
stopping on specific points. They also can often modify the state
of programs while they are running.
5. Debugger: - A debugger is a program which allows you to load your object code
program into system memory, execute the program and troubleshoot or debug it.
The debugger allows you to look at the contents of registers and memory locations
after your program runs.
- It allows you to change the contents of registers and memory locations and re-run
the program.
- Some debuggers allow you to stop execution after each instruction so that you can
check or alter after each register contents.
- A debugger also allows you to set a breakpoint at any point in your program. If you
insert a breakpoint at any point in your program, the debugger will run the program
up to the instruction where you put the breakpoint and then stop the execution.
6. Emulator: - An emulator is a mixture of hardware and software.
- It is used to test and debug the hardware and software of an external system, such
as the prototype of a microprocessor based instrument. Part of the hardware of an
emulator is a multi wire cable which connects the host system to the system being
developed. Ex: FPGAs, USRPs.
Logic analysers:
https://www.radio-electronics.com/info/t_and_m/logic_analyzer/logic_analyzer.php.
Debugging, Simulator, Emulator, In-circuit emulator:
https://www.youtube.com/watch?v=4wmDsd53ibE.
ICE:
Embedded systems pose unique debugging challenges. With neither terminal nor
display (in most cases), there's no natural way to probe these devices, to extract the
behavioural information needed to find what's wrong. They let us connect an external
computer to the system being debugged to enable single stepping, breakpoints, and all
of the debug resources enjoyed by programmers of desktop computers.
In-circuit emulation (ICE) is the use of a hardware device or in-circuit emulator used to
debug the software of an embedded system. It operates by using a processor with the additional
ability to support debugging operations, as well as to carry out the main function of the system.
Particularly for older systems, with limited processors, this usually involved replacing the
processor temporarily with a hardware emulator: a more powerful although more expensive
version. It was historically in the form of bond-out processor which has many internal signals
brought out for the purpose of debugging. These signals provide information about the state of
the processor.
An in-circuit emulator (ICE) provides a window into the embedded system. The
programmer uses the emulator to load programs into the embedded system, run
them, step through them slowly, and view and change data used by the system's
software.
WHAT DOES IT MEAN TO
DISASSEMBLE CODE?
Preprocessing
& Compiling
Source Code Assembly Code
Assembly
Executable Code Object Code
Linking
DLLs
WHAT DOES IT MEAN TO
DISASSEMBLE CODE?
Preprocessing
& Compiling
Source Code Assembly Code
LY
M B
SE
AS Assembly
I S
D
Executable Code Object Code
Linking
DLLs
1. Linker :
A linker is special program that combines the object files, generated by
compiler/assembler, and other pieces of codes to originate an executable file have.
exe extension. In the object file, linker searches and append all libraries needed for
execution of file. It regulates the memory space that will hold the code from each
module. It also merges two or more separate object programs and establishes link
among them.
2. Loader :
The loader is special program that takes input of object code from linker, loads it to
main memory, and prepares this code for execution by computer. Loader allocates
memory space to program. Even it settles down symbolic reference between objects.
It is in charge of loading programs and libraries in operating system.
A locator is a program used to assign the specific addresses of where the
segments of object code are to be loaded into memory.