Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

1.

A microprocessor is a single chip of silicon that performs all of the essential functions of a
computer central processor unit (CPU) on a single silicon chip. Microprocessors are found in a
huge variety of applications including engine management systems, environmental control
systems, domestic appliances, video games, fax machines, photocopiers, etc.

The CPU performs three functions: it controls the system’s operation; it performs algebraic and
logical operations; and it stores information (or data) whilst it is processing. The CPU works in
conjunction with other chips, notably those that provide random access memory (RAM), read-
only memory (ROM), and input/output (I/O).

The first microprocessor systems were developed in the early 1970’s. These were simple and
crude by today’s standards but they found an immediate application in the automotive industry
where they were deployed in engine management and automatic braking systems. Today,
microprocessor systems are found in a huge variety of applications from personal computers to
washing machines!

The block diagram of a typical microprocessor system is shown below. To find out what each
feature does just move your mouse pointer over it!

The central processing unit (CPU) is generally the microprocessor chip itself. This device
contains the following main units:

 storage locations (called registers) that can be used to hold instructions, data, and
addresses during processing
 an arithmetic logic unit (ALU) that is able to perform a variety of arithmetic and logical
function (such as comparing two numbers)
 a control unit which accepts and generates external control signals (such as read and
write) and provides timing signals for the entire system.

A microcontroller is a compact integrated circuit designed to govern a specific operation in


an embedded system. A typical microcontroller includes a processor, memory and input/output
(I/O) peripherals on a single chip.

Sometimes referred to as an embedded controller or microcontroller unit (MCU),


microcontrollers are found in vehicles, robots, office machines, medical devices, mobile radio
transceivers, vending machines and home appliances, among other devices. They are essentially
simple miniature personal computers (PCs) designed to control small features of a larger
component, without a complex front-end operating system (OS).

How do microcontrollers work?

A microcontroller is embedded inside of a system to control a singular function in a device. It


does this by interpreting data it receives from its I/O peripherals using its central processor. The
temporary information that the microcontroller receives is stored in its data memory, where the
processor accesses it and uses instructions stored in its program memory to decipher and apply
the incoming data. It then uses its I/O peripherals to communicate and enact the appropriate
action.

Microcontrollers are used in a wide array of systems and devices. Devices often utilize multiple
microcontrollers that work together within the device to handle their respective tasks.

For example, a car might have many microcontrollers that control various individual systems
within, such as the anti-lock braking system, traction control, fuel injection or suspension
control. All the microcontrollers communicate with each other to inform the correct actions.
Some might communicate with a more complex central computer within the car, and others
might only communicate with other microcontrollers. They send and receive data using their I/O
peripherals and process that data to perform their designated tasks.
Central Processor Unit (CPU)

As we know that the CPU is the brain of any processing device of the microcontroller. It
monitors and controls all operations that are performed on the Microcontroller units. The User
has no control over the work of the CPU directly. It reads program written in ROM memory and
executes them and do the expected task of that application.

Interrupts

As its name suggests, Interrupt is a subroutine call that interrupts of the microcontrollers main
operations or work and causes it to execute any other program, which is more important at the
time of operation. The feature of Interrupt is very useful as it helps in case of emergency
operations. An Interrupts gives us a mechanism to put on hold the ongoing operations, execute a
subroutine and then again resumes to another type of operations.

The Microcontroller 8051 can be configured in such a way that it temporarily terminates or
pause the main program at the occurrence of interrupts. When a subroutine is completed, then the
execution of main program starts. Generally five interrupt sources are there in 8051
Microcontroller. There are 5 vectored interrupts are shown in below

 INTO
 TFO
 INT1
 TF1
 R1/T1

Out of these, (INT0) ̅ and (INT1) ̅ are external interrupts that could be negative edge triggered or
low level triggered. When All these interrupts are activated, set the corresponding flogs except
for serial interrupt, the interrupt flags are cleared when the processor branches to the interrupt
service routine (ISR). The external interrupt flags are cleared when the processor branches to the
interrupt service routine, provides the interrupt is a negative edge triggered whereas the timers
and serial port interrupts two of them are external interrupts, two of them are timer interrupts
and one serial port interrupt terminal in general.

Memory

Microcontroller requires a program which is a collection of instructions. This program tells


microcontroller to do specific tasks. These programs require a memory on which these can be
saved and read by Microcontroller to perform specific operations of a particular task. The
memory which is used to store the program of the microcontroller is known as code memory or
Program memory of applications. It is known as ROM memory of microcontroller also requires a
memory to store data or operands temporarily of the micro controller. The data memory of the
8051 is used to store data temporarily for operation is known RAM memory. 8051
microcontroller has 4K of code memory or program memory, that has 4KB ROM and also 128
bytes of data memory of RAM.
BUS

Basically Bus is a collection of wires which work as a communication channel or medium for
transfer of Data. These buses consists of 8, 16 or more wires of the microcontroller. Thus, these
can carry 8 bits, 16 bits simultaneously. Hire two types of buses that are shown in below

 Address Bus
 Data Bus

Address Bus: Microcontroller 8051 has a 16 bit address bus for transferring the data. It is used
to address memory locations and to transfer the address from CPU to Memory of the
microcontroller. It has four addressing modes that are

 Immediate addressing modes.


 Bank address (or) Register addressing mode.
 Direct Addressing mode.
 Register indirect addressing mode.

Data Bus: Microcontroller 8051 has 8 bits of the data bus, which is used to carry data of
particular applications.

Oscillator

Generally, we know that the microcontroller is a device, therefore it requires clock pulses for its
operation of microcontroller applications. For this purpose, microcontroller 8051 has an on-chip
oscillator which works as a clock source for Central Processing Unit of the microcontroller. The
output pulses of oscillator are stable. Therefore, it enables synchronized work of all parts of the
8051 Microcontroller.

Input/output Port

Normally microcontroller is used in embedded systems to control the operation of machines in


the microcontroller. Therefore, to connect it to other machines, devices or peripherals we require
I/O interfacing ports in the microcontroller interface. For this purpose microcontroller 8051 has 4
input, output ports to connect it to the other peripherals

Timers/Counters

8051 microcontroller has two 16 bit timers and counters. These counters are again divided into a
8 bit register. The timers are used for measurement of intervals to determine the pulse width of
pulses.
2. Evolution of Microprocessors

We can categorize the microprocessor according to the generations or according to the size of the
microprocessor:

First Generation (4 - bit Microprocessors)

The first generation microprocessors were introduced in the year 1971-1972 by Intel
Corporation. It was named Intel 4004 since it was a 4-bit processor.

It was a processor on a single chip. It could perform simple arithmetic and logical operations
such as addition, subtraction, Boolean OR and Boolean AND.

I had a control unit capable of performing control functions like fetching an instruction from
storage memory, decoding it, and then generating control pulses to execute it.

Second Generation (8 - bit Microprocessor)

The second generation microprocessors were introduced in 1973 again by Intel. It was a first 8 -
bit microprocessor which could perform arithmetic and logic operations on 8-bit words. It was
Intel 8008, and another improved version was Intel 8088.
Third Generation (16 - bit Microprocessor)

The third generation microprocessors, introduced in 1978 were represented by Intel's 8086,
Zilog Z800 and 80286, which were 16 - bit processors with a performance like minicomputers.

Fourth Generation (32 - bit Microprocessors)

Several different companies introduced the 32-bit microprocessors, but the most popular one is
the Intel 80386.

Fifth Generation (64 - bit Microprocessors)

From 1995 to now we are in the fifth generation. After 80856, Intel came out with a new
processor namely Pentium processor followed by Pentium Pro CPU, which allows multiple
CPUs in a single system to achieve multiprocessing.

Other improved 64-bit processors are Celeron, Dual, Quad, Octa Core processors.

3. Components of the Microprocessor


Components of this processor are ALU, Control unit, Input-output devices, and Register array.
 ALU (arithmetic logic unit) performs both arithmetic and logical operations. Arithmetic
operations such as addition, subtraction, multiplications, divisions, and logical operations
such as NOR, AND, NAND, OR, XOR, NOT, XNOR, etc.
 The control unit is used to control the instructions and it generates the signals to operate
the other components.
 The register array consists of registers. Registers that are used by the programmer to
store arbitrary data are known as general-purpose registers and the registers which are not
used by a programmer to store the data are known as the reserved registers. The length of
the register is known as the word length of the computer.
 Input-output devices are used to transfer data between microcomputers and external
devices.
4. Microprocessor architecture
 Von-Neumann architecture
In the classical von Neumann architecture the ALU and the control unit are connected to a single
memory that stores both the data values and the program instructions. During execution, an
instruction is read from the memory and decoded, appropriate operands are fetched from the
memory, and, finally, the instruction is executed. The main disadvantage is that bandwidth
becomes the bottleneck in such an architecture.
The most common operation a standard DSP processor must be able to perform efficiently is
multiply-and-accumulate. This operation should ideally be performed in a single instruction
cycle. This means that two values must be read from memory and (depending on organization)
one value must be written, or two or more address registers must be updated, in that cycle.
Hence, a high memory bandwidth is just as important as a fast multiply-and-accumulate
operation.
Several memory buses and on-chip memories are therefore used so that reads and writes to
different memory units can take place concurrently. Furthermore, pipelining is used extensively
to increase the throughput. Two separate memories are used in the classical Harvard
architecture as shown below. One of the memories is used exclusively for data while the other is
used for instructions. The Harvard architecture therefore achieves a high degree of concurrency.
Current DSP architectures use multiple buses and execution units to achieve even higher degrees
of concurrency. Chips with multiple DSP processors and a RISC processor are also available.

 Harvard architecture
The Harvard architecture is a computer architecture with separate storage and signal pathways
for instructions and data. It contrasts with the von Neumann architecture, where program
instructions and data share the same memory and pathways.
The term originated from the Harvard Mark I relay-based computer, which stored instructions
on punched tape (24 bits wide) and data in electro-mechanical counters. These early machines
had data storage entirely contained within the central processing unit, and provided no access to
the instruction storage as data. Programs needed to be loaded by an operator; the processor could
not initialize itself.
Modern processors appear to the user to be systems with von Neumann architectures, with the
program code stored in the same main memory as the data. For performance reasons, internally
and largely invisible to the user, most designs have separate processor caches for the instructions
and data, with separate pathways into the processor for each. This is one form of what is known
as the modified H.
 CISC Architecture

The term CISC stands for ‘’Complex Instruction Set Computer’’. It is a CPU design plan based
on single commands, which are skilled in executing multi-step operations.

CISC computers have small programs. It has a huge number of compound instructions, which
take a long time to perform. Here, a single set of instructions is protected in several steps; each
instruction set has an additional than 300 separate instructions. Maximum instructions are
finished in two to ten machine cycles. In CISC, instruction pipelining is not easily implemented.

CISC Architecture

The CISC machines have good acts, based on the overview of program compilers; as the range
of innovative instructions are simply obtainable in one instruction set. They design compound
instructions in a single, simple set of instructions.

They achieve low-level processes, which makes it easier to have huge addressing nodes and
additional data types in the hardware of a machine. But, CISC is considered less efficient than
RISC, because of its incompetence to eliminate codes which leads to wasting of cycles. Also,
microprocessor chips are difficult to understand and program for, because of the complexity of
the hardware.

 Instruction Set Architecture is a medium to permit communication between the


programmer and the hardware. Data execution part, copying of data, deleting, or editing
is the user commands used in the microprocessor, and with this microprocessor, the
Instruction set architecture is operated.
 The main keywords used in the above Instruction Set Architecture are as below

Instruction Set: Group of instructions given to execute the program and they direct the
computer by manipulating the data. Instructions are in the form – Opcode (operational code) and
Operand. Where, the opcode is the instruction applied to load and store data, etc. The operand is
a memory register where instruction is applied.

Addressing Modes: Addressing modes are how the data is accessed. Depending upon the type
of instruction applied, addressing modes are of various types such as a direct mode where
straight data is accessed or indirect mode where the location of the data is accessed. Processors
having identical ISA may be very different in the organization. Processors with identical ISA and
nearly identical organization is still not nearly identical.

CPU performance is given by the fundamental law

Thus, CPU performance is dependent upon Instruction Count, CPI (Cycles per instruction), and
Clock cycle time. And all three are affected by the instruction set architecture.

Instruction Count of the CPU

This underlines the importance of the instruction set architecture. There are two prevalent
instruction set architectures

Examples of CISC Processors

IBM 370/168 – It was introduced in the year 1970. CISC design is a 32-bit processor and four
64-bit floating point registers.
VAX 11/780 – CISC design is a 32-bit processor and it supports many numbers of addressing
modes and machine instructions which is from Digital Equipment Corporation.
Intel 80486 – It was launched in the year 1989 and it is a CISC processor, which has instructions
varying lengths from 1 to 11 and it will have 235 instructions.
Characteristics

The characteristics of CISC architecture include the following.

 Instruction-decoding logic will be Complex.


 One instruction is required to support multiple addressing modes.
 Less chip space is enough for general purpose registers for the instructions that are
0operated directly on memory.
 Various CISC designs are set up with two special registers for the stack pointer, handling
interrupts, etc.
 MUL is referred to as a “complex instruction
 RISC Architecture

The term RISC stands for ‘’Reduced Instruction Set Computer’’. It is a CPU design plan based
on simple orders and acts fast.

This is a small or reduced set of instructions. Here, every instruction is expected to attain very
small jobs. In this machine, the instruction sets are modest and simple, which help in comprising
more complex commands. Each instruction is about a similar length; these are wound together to
get compound tasks done in a single operation. Most commands are completed in one machine
cycle. This pipelining is a crucial technique used to speed up RISC machines.

RISC Architecture

Reduced Instruction Set Computer is a microprocessor that is designed to carry out few
instructions at a similar time. Based on small commands, these chips need fewer transistors,
which makes the transistors inexpensive to design and produce. The features of RISC include the
following.

Please refer to this link to know more about Pipelining in Computer Architecture MCQs

 The demand for decoding is less


 Few data types in hardware
 General-purpose register Identical
 Uniform instruction set
 Simple addressing nodes

Also, while writing a program, RISC makes it easier by letting the computer programmer
eliminate needless codes and stops wasting cycles.

Characteristics

The characteristics of RISC architecture include the following.

 Simple Instructions are used in RISC architecture.


 RISC helps and supports few simple data types and synthesizes complex data types.
 RISC utilizes simple addressing modes and fixed-length instructions for pipelining.
 RISC permits any register to use in any context.
 One Cycle Execution Time
 The amount of work that a computer can perform is reduced by separating “LOAD” and
“STORE” instructions.
 RISC contains a Large Number of Registers to prevent various interactions with memory.
 In RISC, Pipelining is easy as the execution of all instructions will be done in a uniform
interval of time i.e. one click.
 In RISC, more RAM is required to store assembly-level instructions.
 Reduced instructions need a less number of transistors in RISC.
 RISC uses the Harvard memory model means it is Harvard Architecture.
 A compiler is used to perform the conversion operation means converting a high-level
language statement into the code of its form.

 VLIW

The intrinsic parallelism in the instruction stream, complexity, cost, and the branch instruction
issue get resolved by a higher instruction set architecture called the Very Long Instruction
Word (VLIW) or VLIW Machines.
VLIW uses Instruction Level Parallelism, i.e. it has programs to control the parallel execution
of the instructions. In other architectures, the performance of the processor is improved by
using either of the following methods: pipelining (break the instruction into subparts),
superscalar processor (independently execute the instructions in different parts of the
processor), out-of-order-execution (execute orders differently to the program) but each of these
methods add to the complexity of the hardware very much. VLIW Architecture deals with it by
depending on the compiler. The programs decide the parallel flow of the instructions and to
resolve conflicts. This increases compiler complexity but decreases hardware complexity by a
lot.
Features :
 The processors in this architecture have multiple functional units, fetch from the Instruction
cache that have the Very Long Instruction Word.
 Multiple independent operations are grouped together in a single VLIW Instruction. They
are initialized in the same clock cycle.
 Each operation is assigned an independent functional unit.
 All the functional units share a common register file.
 Instruction words are typically of the length 64-1024 bits depending on the number of
execution unit and the code length required to control each unit.
 Instruction scheduling and parallel dispatch of the word is done statically by the compiler.
 The compiler checks for dependencies before scheduling parallel execution of the
instructions.

Block Diagram of VLIW Architecture

5. What is Memory?
Any system which processes digital data needs a facility for storing the unprocessed, partially
processed, and completely processed data. A subsystem of such digital processing system which
can store all the mentioned data is called as Memory.

Earlier the memory used to be of magnetic tape.

But now a days we use semiconductor memory of various types and size.

In this lecture, we are going to learn about all the semiconductor memory which are used in
Microprocessor and Microcontroller. But before starting to know what are the types of memory,
we are going to know some advantages of Semiconductor Memory.

What is Random Access Memory (RWM or RAM)?

 Random access memory is also called as read wite memory (RWM).


 The memory locations in this type of memory are organized in such a way that the
access time required for accessing any location is the same. This is the advantage of
using RAM over sequential memories.
 RAMs also can be further classified into two types:
1. Static RAM
2. Dynamic RAM
 RAMs can be fabricated using either bipolar technology or unipolar technology.
 RAM is a volatile memory so ut loses the stored data when power s turned off.
 Static RAM (SRAM):

 It is possible to implement the static RAM using the bipolar as well as MOS
technology.
 It is possible to store data as long as power is applied to the chip.
 Static AM cells are basically flip flops that can stay in a given state (i.e. store a bit) as
long as the power to the circuit is not interrupted.
 Dynamic RAM (DRAM):

 In the dynamic RAM, the data is stored in the form of a charge on the capacitor.
 The single bit Dynamic RAM is formed using only two components, one MOSFET
and a capacitor.
 Hence it needs a very small area as compared to SRAM. Hence DA consists of more
memory cells as compared to the SRAM per unit area.
 One of the most disadvantage of DRAM is that the charge held by capacitor need to
be refreshed after few milliseconds. Hence DRAm needs and extra circuitry for
refreshing the charge.

What is Read Only Memory (ROM)?

 These memories are designed only for reading the information which is already stored
on them. The user cannot write any new information on them.
 These are similar to the prerecorded cassettes.
 A manufacturer or someone else can write ROMs but the writing process is much
more complicated as compared to that of RAM.
 ROM is used to store some fixed information such a look-up tables, instructions, fixed
data, etc.
 It is possible to organize ROMs in such a way that the reading time required for
locations remains the same.
 The ROMs are further classified into the below categories as shown in the figure:
 The technologies used for ROM manufacturing are:

1. Bipolar Technology
2. MOS Technology

 Bipolar ROMs are faster and have higher driving capability whereas MOS ROMs
require less area and consume less power. The improved MOS ROMs have higher
speeds.
 Mask Programmable ROM:

 In this, data patterns must be programmed as a part of the manufacturing process.


 Not reprogrammable
 Normally shifted for high volume usage due to low cost.
 Programmable ROM (PROM):

 This device is electrically programmable. Here user can program the chip. Normally
PROM is one time Programmable (OTP).
 Not reprogrammable.
 Normally used for production purposes.
 Erasable Programmable ROM (EPROM):

 In this, memory data can be written any number of times.


 The chip can be erased by exposing it to UV rays.
 This is used when one wants to develop a digital computer system..
 Electrically Erasable Programmable ROM (E2PROM):

 These are very similar to EPROMs and use the MOS circuitry.
 The chip can be electrically erased.
 In this chip, it is possible to erase and program particular memory locations. This is
called selective erasing.
 The main disadvantage of these ROMs is that they are very expensive and have very
low storage density.

6. Registers are a type of computer memory used to quickly accept, store, and transfer data and
instructions that are being used immediately by the CPU. The registers used by the CPU are
often termed as Processor registers.

A processor register may hold an instruction, a storage address, or any data (such as bit sequence
or individual characters).
The computer needs processor registers for manipulating data and a register for holding a
memory address. The register holding the memory location is used to calculate the address of the
next instruction after the execution of the current instruction is completed.

Following is the list of some of the most common registers used in a basic computer:

Register Symbol Number of bits Function

Data register DR 16 Holds memory operand

Address register AR 12 Holds address for the memory

Accumulator AC 16 Processor register

Instruction register IR 16 Holds instruction code

Program counter PC 12 Holds address of the instruction

Temporary register TR 16 Holds temporary data

Input register INPR 8 Carries input character

Output register OUTR 8 Carries output character

Control Unit — CU
Control unit CU is the part of CPU that helps orchestrate the execution of instructions. It tells
what to do. According to the instruction, it helps activate the wires connecting CPU to different
other parts of computer including the ALU. Control unit is the first component of CPU to receive
the instruction for processing.
There are two types of control unit:

 Hardwired control units.


 Micro programmable (micro programmed) control units.
Hardwired control units are the hardware and needs the change in hardware to add modify its
working whereas micro programmable control unit can be programmed to change its behavior.
Hardwired CU are faster in processing instruction whereas micro programmable as more
flexible.
Arithmetic and logical unit — ALU
Arithmetic and logical unit ALU as name suggest does all the arithmetic and logical
computations. ALU performs the operations like addition, subtraction. ALU consists of logic
circuitry or logic gates which performs these operations.

Most logic gates take in two input and produces one output

Below is an example of half adder circuit which takes in two inputs and outputs the result. Here
A and B are the input, S is the output and C is the carry.

Memory (RAM)
Ram is a collection of register arranged and compact together in an optimized way so that it can
store a higher number of data. RAM (Random Access Memory) are volatile and its data gets lost
when we turn off the power. As RAM is a collection of register to read/write data a RAM takes
input of 8bit address, data input for the actual data to be stored and finally read and write enabler
which works as it is for the latches.

You might also like