Preventing and Protecting Lifes of Computers
Preventing and Protecting Lifes of Computers
Understanding Microprocessors:
This is a CPU built on a singe microprocessor chip
It is a programmable, multipurpose, clock -driven, register-based electronic device that reads
binary instructions from a storage device called memory, accepts binary data as input and processes
data according to those instructions and provides results as output.
The microprocessor contains millions of tiny components like transistors, registers, and diodes that
work together.
EVOLUTION:
Microprocessors have evolved through several generations, each marked by advancements in
technology, architecture, and performance. Here's a broad overview:
1. First Generation (1971-1972): The Intel 4004, released in 1971, is often considered the
first microprocessor. It had a 4-bit architecture and was primarily used in calculators and
other simple devices.
2. Second Generation (1973-1978): This era saw the introduction of more powerful 8-bit
microprocessors like the Intel 8008 and 8080. These chips found applications in early
personal computers and other devices.
3. Third Generation (Late 1970s to Early 1980s): The introduction of 16-bit microprocessors
like the Intel 8086 and Motorola 68000 marked this era. These chips enabled more powerful
computing capabilities and were used in early personal computers, gaming consoles, and
industrial applications.
4. Fourth Generation (Mid-1980s to Early 1990s): The fourth generation saw the rise of 32-
bit microprocessors such as the Intel 80386 and Motorola 68020. These processors
significantly increased computational power and were used in more advanced personal
computers and workstations.
5. Fifth Generation (Early 1990s to Early 2000s): This era saw the widespread adoption of
32-bit and 64-bit microprocessors. Notable examples include the Intel Pentium series and
the AMD Athlon series. These processors powered the growth of the internet, multimedia
applications, and gaming.
6. Sixth Generation (Early 2000s to Present): The sixth generation is characterized by
further advancements in 64-bit architecture and multi-core processing. Processors like the
Intel Core series and AMD Ryzen series are prominent examples. These chips have powered
the digital revolution, enabling high-performance computing, artificial intelligence, and
cloud computing.
Within each generation, there are often multiple iterations and improvements, with advancements
in speed, efficiency, and features. Additionally, other manufacturers such as AMD, ARM, and IBM
have contributed significantly to the evolution of microprocessors, each with their own lines of
chips catering to different market segments and applications.
ASSOCIATED TERMS:
Understanding basic terms used in microprocessors can help grasp their functioning and
architecture. Here are some fundamental terms:
8085 Microprocessors:
8085 is part of the intel 8080 family so just like in programming we need to understand the class
before we get the concept of the object. So lets discus about the 8080 family
8080 PIN
ASSIGNMENT
DIAGRAM
SO NOW WE HAVE AN UNDERSTANDING OF THE 8080 UPS, LETS DELVE BACK INTO
THE 8085 UPS
8085 microprocessor
the most famous intel microprocessor form the 8080 family
8 bit as we know just like the 8080 family but this time around we it has only on voltage source
which is +5v unlike the 8080 that makes use of the +5v, +12v and -5 v and hence 8085 is more
compatible with hardware and that is why we have the name 5 suffix in the model.
Main features:
it is an 8-bit microprocessor.
It is manufactured with N-MOS technology.
It has 16-bit address bus and hence can address up to 216= 65536 bytes (64KB) memory locations
through A0–A15.
The first 8 lines of address bus and 8 lines of data bus are multiplexed AD0–AD7
Data bus is a group of 8 lines D0–D7.
It supports external interrupt request.
A 16-bit program counter (PC)
A 16-bit stack pointer (SP)
Six 8-bit general purpose register arranged in pairs: BC, DE, HL.
It requires a signal +5V power supply and operates at 3.2 MHZ single phase clock.
It is enclosed with 40 pins DIP (Dual in line package).
Program counter
It is a 16-bit register used to store the memory address location of the next instruction to be
executed. Microprocessor increments the program whenever an instruction is being executed,
so that the program counter points to the memory address of the next instruction that is
going to be executed.
Stack pointer
It is also a 16-bit register works like stack, which is always incremented/decremented by 2
during push & pop operations.
Temporary register
It is an 8-bit register, which holds the temporary data of arithmetic and logical operations.
Flag register
It is an 8-bit register having five 1-bit flip-flops, which holds either 0 or 1 depending upon
the result stored in the accumulator.
These are the set of 5 flip-flops −
Sign (S)
Zero (Z)
Auxiliary Carry (AC)
Parity (P)
Carry
Instruction register and decoder
It is an 8-bit register. When an instruction is fetched from memory then it is stored in the
Instruction register. Instruction decoder decodes the information present in the Instruction
register.
Timing and control unit
It provides timing and control signal to the microprocessor to perform operations. Following
are the timing and control signals, which control external and internal circuits −
Control Signals: READY, RD’, WR’, ALE
Status Signals: S0, S1, IO/M’
DMA Signals: HOLD, HLDA
RESET Signals: RESET IN, RESET OUT
Interrupt control
As the name suggests it controls the interrupts during a process. When a microprocessor is
executing a main program and whenever an interrupt occurs, the microprocessor shifts the
control from the main program to process the incoming request. After the request is
completed, the control goes back to the main program.
There are 5 interrupt signals in 8085 microprocessor: INTR, RST 7.5, RST 6.5, RST 5.5,
TRAP.
Serial Input/output control
It controls the serial data communication by using these two instructions: SID (Serial input
data) and SOD (Serial output data).
Address buffer and address-data buffer
The content stored in the stack pointer and program counter is loaded into the address buffer
and address-data buffer to communicate with the CPU. The memory and I/O chips are
connected to these buses; the CPU can exchange the desired data with the memory and I/O
chips.
Address bus and data bus
Data bus carries the data to be stored. It is bidirectional, whereas address bus carries the
location to where it should be stored and it is unidirectional. It is used to transfer the data &
Address I/O devices.
8085 ARCHITECTURE
WHY
DONT
WE
AD0 ? AD7 (Input/output): These are time multiplexed address/data bus i.e. they serve
dual purpose. They are used for the least significant 8 bits of the memory address or I/O
address during the first cycle. Again they are used for data during 2nd and 3rd clock cycles.
Control and Status Signals
ALE (Output): ALE stands for Address Latch Enable signal. ALE goes high during
first clock cycle of a machine cycle and enables the lower 8-bits of the address to be latched
either into the memory or external latch.
IO/M (Output): It is a status signal which distinguishes whether the address is for
memory or I/O device.
S0, S1 (Output): These are status signals sent by the microprocessors to distinguish the
various types of operation given in table below:
RD (Output): RD is a signal to control READ operation. When it goes low, the
selected I/O device or memory is read.
WR (Output): WR is a signal to control WRITE operation. When it goes low, the data
bus' data is written into the selected memory or I/O location.
HOLD (INPUT): HOLD indicates that another device is requesting for the use of the
address and data bus.
HLDA (OUTPUT): HLDA is a signal for HOLD acknowledgement which indicates that
the HOLD request has been received. After the removal of this request the HLDA goes low.
INTR (Input): INTR is an Interrupt Request Signal. Among interrupts it has the lowest
priority. The INTR is enabled or disabled by software.
RST 5.5, 6.5, 7.5 and TRAP (Inputs): These all are interrupts. When any interrupt is
recognized the next instruction is executed from a fixed location in the memory as given
below:
The TRAP has the highest priority among interrupts. The order of priority of interrupts is as
follows:
RST 7.5
RST 6.5
RST 5.5
RESET IN (Input): It resets the program counter (PC) to 0. It also resets interrupt enable
and HLDA flip-flops. The CPU is held in reset condition till RESET is not applied.
RESET OUT (Output): RESET OUT indicates that the CPU is being reset.
Clock Signals
X1, X2 (Inpu): X1 and X2 are terminals to be connected to an external crystal oscillator
which drives an internal circuitry of the microprocessor. It is used to produce a suitable
clock for the operation of microprocessor.
CLK (Output): CLK is a clock output for user, which can be used for other digital ICs.
Its frequency is same at which processor operates.
Serial I/O Signals
SID (Input): SID is data line for serial input. The data on this line is loaded into the
seventh bit of the accumulator when RIM instruction is executed.
SOD (Output): SOD is a data line for serial output. The seventh bit of the accumulator
is output on SOD line when SIM instruction is executed.
Power Supply
Vcc : +5 Vlots supply
8085 Instructions
An instruction of computer is a command given to the computer to perform a specified operation
on given data. Some instructions of Intel 8085 microprocessor are: MOV, MVI, LDA, STA, ADD,
SUB, RAL, INR, MVI, etc.
Write Cycle: In write cycle data are sent from the CPU to the memory or an output device.
8086 MICROPROCESSOR
Well the pioneer of the x86 family,
The Intel x86 family is a lineage of microprocessors developed by Intel and based on the x86
instruction set architecture (ISA). It's one of the most widely used architectures in the world,
especially in personal computers.
The 8086 has two parts, the Bus Interface Unit (BIU) and the Execution Unit
(EU).The BIU fetches instructions, reads and writes data, and computes the 20-bit
address. The EU decodes and executes the instructions using the 16-bit ALU.
The BIU contains the following registers:
The BIU fetches instructions using the CS and IP, written CS: IP, to construct the 20-
bit address. Data is fetched using a segment register (usually the DS) and an effective
AX - the Accumulator
8086 ARCHITECTURE
MICROPROCESSORS &INTERFACING
Most of the registers contain data/instruction offsets within 64 KB memory segment.
There are four different 64 KB segments for instructions, stack, data and extra data. To
specify where in 1 MB of processor memory these 4 segments are located the processor
uses four segment registers:
Code segment (CS) is a 16-bit register containing address of 64 KB segment with
processor instructions. The processor uses CS segment for all accesses to instructions
referenced by instruction pointer (IP) register. CS register cannot be changed directly.
The CS register is automatically updated during far jump, far call and far return
instructions.
Stack segment (SS) is a 16-bit register containing address of 64KB segment with
program stack. By default, the processor assumes that all data referenced by the stack
pointer (SP) and base pointer (BP) registers is located in the stack segment. SS register
can be changed directly using POP instruction.
Data segment (DS) is a 16-bit register containing address of 64KB segment with
program data. By default, the processor assumes that all data referenced by general
registers (AX, BX, CX, DX) and index register (SI, DI) is located in the data segment.
DS register can be changed directly using POP and LDS instructions.
Accumulator register consists of two 8-bit registers AL and AH, which can be combined
together and used as a 16-bit register AX. AL in this case contains the low order byte of
the word, and AH contains the high-order byte. Accumulator can be used for I/O
operations and string manipulation.
Base register consists of two 8-bit registers BL and BH, which can be combined together
and used as a 16-bit register BX. BL in this case contains the low-order byte of the word,
and BH contains the high-order byte. BX register usually contains a data pointer used for
based, based indexed or register indirect addressing.
Count register consists of two 8-bit registers CL and CH, which can be combined
together and used as a 16-bit register CX. When combined, CL register contains the low
order byte of the word, and CH contains the high-order byte. Count register can be used
in Loop, shift/rotate instructions and as a counter in string manipulation.
Data register consists of two 8-bit registers DL and DH, which can be combined together
and used as a 16-bit register DX. When combined, DL register contains the low order
byte of the word, and DH contains the high-order byte. Data register can be used as a port
number in I/O operations. In integer 32-bit multiply and divide instruction the DX
register contains high-order word of the initial or resulting number.
The EU also contains the Flag Register which is a collection of condition bits and
control bits. The condition bits are set or cleared by the execution of an instruction. The
control bits are set by instructions to control some operation of the CPU.
Bit 0 - CF Carry Flag - Set by carry out of MSB
Bit 2 - PF Parity Flag - Set if result has even parity
Bit 4 - AF Auxiliary Flag - for BCD arithmetic
Bit 6 - ZF Zero Flag - Set if result is zero
Bit 7 - SF Sign Flag = MSB of result
Bit 8 - TF Single Step Trap Flag
Bit 9 - IF Interrupt Enable Flag
Bit 10 - DF String Instruction Direction Flag
Bit 11 - OF Overflow Flag
Bits 1, 3, 5, 12-15 are undefined
An 8bit MP
The 6800 was popular in computer peripherals, test equipment applications and point-of-sale terminals.
It also found use in arcade games[7] and pinball machines.[8] The MC6802, introduced in 1977, included
128 bytes of RAM and an internal clock oscillator on chip. The MC6801 and MC6805 included RAM,
ROM and I/O on a single chip and were popular in automotive applications. Some MC6805 models
integrated a Serial Peripheral Interface (SPI).[9] The Motorola 6809 was an updated compatible design.
FEATURES:
8-bit Data Bus: The MC6800 has an 8-bit data bus, allowing it to process data in 8-bit chunks.
1. 16-bit Address Bus: With a 16-bit address bus, the MC6800 can address up to 64KB of
memory.
2. Instruction Set Architecture (ISA): The MC6800 instruction set architecture includes a
variety of instructions for arithmetic, logic, data movement, and control operations.
3. Registers:
Accumulator (A): Used for arithmetic and logic operations.
Index Register (X): Supports indexed addressing modes.
Stack Pointer (SP): Used for managing the stack.
Program Counter (PC): Holds the address of the next instruction to be executed.
4. Addressing Modes: The MC6800 supports various addressing modes, including direct,
indirect, indexed, and relative modes, providing flexibility in accessing memory operands.
5. Clock Frequency: Operating frequencies range from a few kHz to several MHz, depending
on the specific variant and application requirements.
6. Interrupts: The MC6800 supports interrupt handling, allowing the processor to respond
promptly to external events or signals.
7. I/O Ports: It features general-purpose I/O ports for interfacing with peripherals such as
keyboards, displays, sensors, etc.
8. Low Power Consumption: Designed with low power consumption in mind, making it
suitable for battery-powered or energy-efficient applications.
9. Integrated Peripherals: Some versions of the MC6800 may include integrated peripherals
such as timers, serial communication interfaces, and parallel I/O ports.
10. Development Tools: Assemblers, debuggers, simulators, and other development
tools are available for programming and testing software for the MC6800.
11. Reliability: Known for its reliability and robustness, the MC6800 was widely used in
industrial, automotive, and consumer electronics applications.
12. Cost-Effectiveness: The MC6800 offered a good balance of performance and cost,
making it attractive for a wide range of applications, including mass-produced consumer
products.
13. Compatibility: While being an 8-bit processor, the MC6800's design influenced
subsequent Motorola processors, such as the 6809 and 68000 series, ensuring a degree of
compatibility and familiarity across different processor families.
P I N ASSIGNMENT:
VCC: Power supply pin,
typically connected to +5V.
1. D0-D7: Data bus pins, used for transferring data between the processor and external
memory or peripherals.
2. A0-A15: Address bus pins, used for specifying memory addresses.
3. R/W: Read/Write control pin, indicates whether the processor is performing a read or write
operation.
4. IRQ: Interrupt Request pin, used for external interrupt signals.
5. NMI: Non-Maskable Interrupt pin, for high-priority interrupts.
6. SO: Serial Output pin, for serial data transmission.
7. SI: Serial Input pin, for serial data reception.
8. SCLK: Serial Clock pin, synchronizes serial data transmission.
9. RESET: Reset pin, used to reset the processor.
10. E: Enable pin, controls the clock signal to the processor.
11. VSS: Ground pin, connected to ground (0V).
12. Q (not used): Generally left unconnected.
13. E (not used): Generally left unconnected.
14. D0-D7 (not used): Generally left unconnected.
15. A8-A15 (not used): Generally left unconnected.
16. BS (not used): Generally left unconnected.
17. DTACK: Data Transfer Acknowledge, indicates that a data transfer has been
completed.
18. AS: Address Strobe, indicates that a valid address is present on the address bus.
19. VMA: Valid Memory Address, indicates a valid memory access.
20. R/W (not used): Generally left unconnected.
21. BA: Bus Available, indicates that the bus is available for use.
22. BGACK: Bus Grant Acknowledge, indicates that the processor has been granted bus
access.
23. BERR: Bus Error, indicates a bus error condition.
24. HALT: Halt, halts the processor's operation.
25. HOLD: Hold, places the processor in a hold state.
26. SYNC: Synchronization, used for synchronization signals.
27. E, Q (not used): Generally left unconnected.
28. A0-A7 (not used): Generally left unconnected.
29. A8-A15 (not used): Generally left unconnected.
30. D0-D7 (not used): Generally left unconnected.
31. VSS: Ground pin, connected to ground (0V).
32. VCC: Power supply pin, typically connected to +5V.
33. A0-A7: Address bus pins, used for specifying memory addresses.
34. DTACK, AS, VMA (not used): Generally left unconnected.
35. BS (not used): Generally left unconnected.
36. BGACK, BERR (not used): Generally left unconnected.
37. HALT, HOLD (not used): Generally left unconnected.
38. SYNC (not used): Generally left unconnected.
39. RESET (not used): Generally left unconnected.
Registers:
Accumulator (A): The accumulator is an 8-bit register used for arithmetic and
logical operations. It holds one of the operands for arithmetic operations and stores
the result after computation.
Index Register (X): The 16-bit index register is primarily used for indexed
addressing modes. It can also be used for arithmetic operations and as a general-
purpose register.
Stack Pointer (SP): The stack pointer is a 16-bit register that holds the address of
the top of the stack. It is used for managing subroutine calls, interrupt handling, and
temporary data storage.
Program Counter (PC): The program counter is a 16-bit register that holds the
address of the next instruction to be executed. It is automatically incremented after
each instruction fetch.
2. Arithmetic Logic Unit (ALU):
The ALU is responsible for performing arithmetic and logical operations on data
stored in the accumulator and other registers. It supports basic operations such as
addition, subtraction, AND, OR, XOR, and shift operations.
3. Instruction Decoder and Control Logic:
The instruction decoder interprets the instructions fetched from memory and
generates control signals to coordinate the execution of the instruction.
Control logic generates timing signals and control signals to synchronize the
operation of different functional units within the processor.
4. Address Generation Unit:
The address generation unit is responsible for generating memory addresses based on
the addressing mode specified in the instruction. It combines the contents of the
program counter, index register, and immediate values to form the effective address
for memory access.
5. Memory Interface:
The memory interface facilitates communication between the processor and external
memory devices. It includes address buffers, data buffers, and control signals for
reading from and writing to memory.
6. Input/Output (I/O) Interface:
The I/O interface provides communication between the processor and external
devices such as sensors, actuators, displays, and communication ports. It includes
dedicated I/O ports, control signals, and data transfer mechanisms.
7. Interrupt Controller:
The interrupt controller manages interrupt requests from external devices and
prioritizes them based on their importance. It coordinates the handling of interrupts,
including saving the processor state, jumping to the interrupt service routine, and
returning to the interrupted program.
8. Clock Generator:
The clock generator generates the internal clock signals required for the operation of
the processor. It ensures that instructions are executed at the appropriate timing
intervals and synchronizes the operation of different parts of the processor.
Registers:
Accumulator (A): The accumulator is an 8-bit register used for arithmetic and
logical operations. It holds one of the operands for arithmetic operations and stores
the result after computation.
Index Register (X): The 16-bit index register is primarily used for indexed
addressing modes. It can also be used for arithmetic operations and as a general-
purpose register.
Stack Pointer (SP): The stack pointer is a 16-bit register that holds the address of
the top of the stack. It is used for managing subroutine calls, interrupt handling, and
temporary data storage.
Program Counter (PC): The program counter is a 16-bit register that holds the
address of the next instruction to be executed. It is automatically incremented after
each instruction fetch.
2. Arithmetic Logic Unit (ALU):
The ALU is responsible for performing arithmetic and logical operations on data
stored in the accumulator and other registers. It supports basic operations such as
addition, subtraction, AND, OR, XOR, and shift operations.
3. Instruction Decoder and Control Logic:
The instruction decoder interprets the instructions fetched from memory and
generates control signals to coordinate the execution of the instruction.
Control logic generates timing signals and control signals to synchronize the
operation of different functional units within the processor.
4. Address Generation Unit:
The address generation unit is responsible for generating memory addresses based on
the addressing mode specified in the instruction. It combines the contents of the
program counter, index register, and immediate values to form the effective address
for memory access.
5. Memory Interface:
The memory interface facilitates communication between the processor and external
memory devices. It includes address buffers, data buffers, and control signals for
reading from and writing to memory.
6. Input/Output (I/O) Interface:
The I/O interface provides communication between the processor and external
devices such as sensors, actuators, displays, and communication ports. It includes
dedicated I/O ports, control signals, and data transfer mechanisms.
7. Interrupt Controller:
The interrupt controller manages interrupt requests from external devices and
prioritizes them based on their importance. It coordinates the handling of interrupts,
including saving the processor state, jumping to the interrupt service routine, and
returning to the interrupted program.
8. Clock Generator:
The clock generator generates the internal clock signals required for the operation of
the processor. It ensures that instructions are executed at the appropriate timing
intervals and synchronizes the operation of different parts of the processor.
FEATURES:
16/32-bit architecture