Module 1
Module 1
Input/Output
Called peripherals
Used to input and output instructions and data
https://www.youtube.com/watch?v=_Cdf68NMTZ0.
Microprocessor
The microprocessor is a type of computer processor in which both the data processing
logic and control are included on a single integrated circuit or small numbers of
integrated circuits.
These processors consist of logic, control, and arithmetic circuits.
Its integrated circuit is capable of interpreting and executing program instructions.
These are multiple-purpose, clock-driven, and register-based digital integrated circuits
that accept input in binary data and process it as per the instruction stored in its memory
A microprocessor has the following components
1.I/O Units
2.Control units
3.Arithmetic Logic Unit (ALU)
4.Cache
5.Registers
Eg: 8085, 8086 Microprocessor
Microcontroller
A microcontroller is a small, low-cost microcomputer on a single VLSI
integrated circuit (IC) chip.
It controls portions of an electronic system through a microprocessor unit
(MOU) and some peripherals.
Microcontroller contains processor cores with additional peripherals such
as serial interface, time, programmable I/O, and memory on the same
chip.
It interacts with other components due to its functionality resulting from
combining digital memory and a digital processor with additional
hardware.
A microcontroller is also an Embedded controller, a single-chip-computer,
or a computer on a chip.
Eg: Arduino, Raspberry Pi, ARM etc
INTRODUCTION
Slow
INTEL 8080 Introduced in 1974.
It was also 8-bit µP.
Its clock speed was
2 MHz.
It had 6,000 transistors.
Was 10 times faster
than 8008.
Could execute
64 KB main memory 5,00,000 instructions
10X faster than 8008 per second.
NMOS technology
Drawback was that it needed three power supplies. 9
Small computers (Microcomputers) were designed in mid 1970’s
using 8080 as CPU.
Introduced in 1976.
INTEL 8085
It was also 8-bit µP.
Its clock speed was 3 MHz.
13
.
INTEL 80186 & 80188
Introduced in 1982.
They were 16-bit µPs.
Clock speed was 6 MHz.
80188 was a cheaper version of
80186 with an 8- bit external
data bus.
They had additional components
like:
Interrupt Controller
Clock Generator
Local Bus Controller
14
Counters
INTEL 80286 Introduced in 1982.
It could address 16 MB of
memory.
80486 DX
80486 SX
80486 DX2
80486 SL
80486 DX4
8 KB of cache memory was
18
introduced.
Introduced in 1993.
INTEL PENTIUM It was also 32-bit
µP.
It was originally named 80586.
It could address 4 GB of
memory.
Cache memory:
8 KB for instructions.
19
8 KB for data.
INTEL PENTIUM PRO
Introduced in 1995.
It was also 32-bit µP.
It had L2 cache of 256 KB.
It had 21 million transistors.
8 KB for data.
20
on one circuit.
INTEL PENTIUM II XEON
Introduced in 1998.
23
INTEL PENTIUM IV
Introduced in 2000.
24
INTEL DUAL CORE Introduced in 2006.
It is 32-bit or 64-bit µP.
It has two cores.
Both the cores have there own
internal bus and L1 cache, but
share the external bus and L2
cache.
It supported SMT
technology.
▪ Assembly language and machine language are treated as low level languages.
▪ 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
Microprocessor development tools:
https://csenotesforyou.blogspot.com/2016/12/assembly-language-program-develo
pment.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.
Editor
- An editor is a program that allows to create a file containing the assembly language
statements for your program.
Example: PC-Write, Wordstar.
- As you type in your program, the editor stores the ASCII codes for the letters and numbers in
successive RAM locations.
- When you have typed in all your programs, you then save the file on the hard disk. This file is
called source file and the extension is .asm.
Assembler
- An assembler program translates the assembly language mnemonics for instructions to
corresponding binary codes. When you run the assembler, it reads your program's source file
from the disk where you saved it after editing.
- On the first pass through the source program, the assembler determines the displacement of
named data items, the offset of labels, etc., and puts this information in a symbol table.
- On the second pass through the source program, the assembler produces the binary code for
each instruction and inserts the offsets, etc. that are calculated during the first pass.
- The assembler generates 2 files on the floppy disk or hard disk. The first file is called an
object file (.obj).
- The second file the assembler generates is called the assembler list file and is given extension
(.lst).
Linker
- A linker is a program used to join several object files into one large
object file.
- The linker produces a link file which contains the binary codes for all
the combined modules. The linker also produces a link map file which
contains the address information about the linked files (.exe).
4. Locator
- A debugger is a program that 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.
Emulator
- 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 multiwire cable that connects the host system to the system being
developed.
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.
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.
Locator - A locator is a program used to assign the specific addresses of where the
segments of object code are to be loaded into memory.
Linking and relocation:
In computing, a linker or link editor is a computer utility program that takes one or
more object files generated by a compiler and combines them into a
single executable file, library file, or another 'object' file.
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.
- 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.
Debugging, Simulator, Emulator, In-circuit emulator:
https://www.youtube.com/watch?v=4wmDsd53ibE.
ICE:
https://www.scribd.com/document/251155947/IN-CIRCUIT-EMUL
ATOR
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.
Logic analysers:
https://www.radio-electronics.com/info/t_and_m/logic_analyzer/logic_analyzer.php.
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
DLLs
WHAT DOES IT MEAN TO
DISASSEMBLE CODE?
Preprocessing
& Compiling
Source Code Assembly Code
LY
MB
S E
A S Assembly
S
DI
DLLs
Modular programming:
https://en.wikipedia.org/wiki/Modular_programming.
Modular programming is a software design technique that emphasizes separating the
functionality of a program into independent, interchangeable modules, such that each
contains everything necessary to execute only one aspect of the desired functionality.
A module interface expresses the elements that are provided and required by the module.
The elements defined in the interface are detectable by other modules.
The implementation contains the working code that corresponds to the elements declared in
the interface. Modular programming is closely related to structured
programming and object-oriented programming, all having the same goal of facilitating
construction of large software programs and systems by decomposition into smaller pieces,
and all originating around the 1960s. While the historical usage of these terms has been
inconsistent, "modular programming" now refers to high-level decomposition of the code of
an entire program into pieces: structured programming to the low-level code use of
structured control flow, and object-oriented programming to the data use of objects, a kind
of data structure.
67
•
•