Micro 1
Micro 1
Micro 1
The
memory hierarchy in computer storage separates each of its levels based on response time. There are typically 3 levels
of memory. INTERNAL PROCESSOR MEMORY : It is a small high speed memory inside the processor. It has temporary
storage of instruction and data. Example: Registers, built -in cache. Like in Intel 8085 Microprocessor there are 6, 8-bit
Registers (B,C,D,E,H,L). Registers: Registers are small, high-speed memory units located in the CPU. They are used to
store the most frequently used data and instructions. Registers have the fastest access time and the smallest storage
capacity, typically ranging from 16 to 64 bits. Cache Memory: Cache memory is a small, fast memory unit located close
to the CPU. It stores frequently used data and instructions that have been recently accessed from the main memory.
Cache memory is designed to minimize the time it takes to access data by providing the CPU with quick access to
frequently used data. MAIN MEMORY: It is relatively large memory placed outside the processor. Data and instruction
storage for the operation of the processor. It can be accessed directly and rapidly by the CPU. Example: RAM, ROM
SECONDARY STORAGE: Much larger in capacity but slower than main memory. It has permanent storage of data and
instruction. Secondary storage, such as hard disk drives (HDD) and solid-state drives (SSD), is a non-volatile memory unit
that has a larger storage capacity than main memory. It is used to store data and instructions that are not currently in
use by the CPU. Secondary storage has the slowest access time and is typically the least expensive type of memory in the
memory hierarchy.
Explain the types of RAM: DYNAMIC RAM: DRAM stands for Dynamic RAM. It is a relatively slower and low cost
memory. It is used for main memory. Its access time 60 – 70 nanosecond DRAM stores the binary information in the
form of electric charges applied to capacitors. The stored information on the capacitors tends to lose over a period of
time and thus the capacitors must be periodically recharged to retain their usage. The contents are constantly refreshed
1000 times per second. DRAM requires refresh time. The main memory is generally made up of DRAM chips.
TYPES OF DYNAMIC RAM: 1) DDR SDRAM (Double Data Rate Synchronous RAM): DDR RAM transfers data twice per
clock cycle. DDR clock speeds range between 200 MHz (DDR-200) and 400 MHz (DDR-400) DDR-200 transfers 1600
MB/s, while DDR-400 transfers 3200 MB/s. 2) DDR2 SDRAM (Double Data Rate 2 Synchronous RAM): DDR2 is twice as
fast as DDR which means twice as much data is carried to the module for each clock cycle. DDR2 speeds range between
400 MHz (DDR2-400) and 800 MHz (DDR2-800). DDR2-400 transfers 3200 MB/s. DDR2-800 transfers 6400 MB/s.
3) DDR3 SDRAM (Double Data Rate 3 Synchronous RAM) : DDR3 is supposed to act twice as fast as DDR2 memories.
Thus DDR3 speeds range between 800 MHz (DDR3-800) and 1600 MHz (DDR3- 1600). DDR3-800 transfers 6400 MB/s;
DDR3-1600 transfers 12800 MB/s. 4) STATIC RAM: The SRAM memories consist of circuits capable of retaining the
stored information as long as the power is applied. That means this type of memory requires constant power. SRAM
memories are used to build Cache. SRAM stands for static RAM. Characterized by high speed and high cost. It uses six
transistors to store data. Access time 60 – 70 nanoseconds. It can accept one command and transfer one word of data
per clock cycle.
What are the different types of ROM: 1. MROM (Masked read-only memory): We know that ROM is as old as
semiconductor technology. MROM was the very first ROM that consists of a grid of word lines and bit lines joined
together transistor switches. This type of ROM data is physically encoded in the circuit and only be programmed during
fabrication. It was not so expensive. 2. PROM (Programmable read-only memory): PROM is a form of digital memory. In
this type of ROM, each bit is locked by a fuse or anti-fuse. The data stored in it are permanently stored and cannot be
changed or erasable. It is used in low-level programs such as firmware or microcode. 3. EPROM (Erasable
programmable read-only memory): EPROM also called EROM, is a type of PROM but it can be reprogrammed. The data
stored in EPROM can be erased and reprogrammed again by ultraviolet light. Reprogrammed of it is limited. Before the
era of EEPROM and flash memory, EPROM was used in microcontrollers. 4. EEPROM (Electrically erasable
programmable read-only memory): As its name refers, it can be programmed and erased electrically. The data and
program of this ROM can be erased and programmed about ten thousand times. The duration of erasing and
programming of the EEPROM is near about 4ms to 10ms. It is used in microcontrollers and remote keyless systems.
Differentiate between microcomputer, microprocessor and microcontroller: Microcomputer – It is a programmable
machine. The 2 principal characteristic of a computer are: Responds to a specific set of instructions in a well-defined
manner. And It can execute a pre-recorded list of instructions (a program). Its main components are CPU, Input &
Output devices and Memory. Microprocessor: It is a programmable VLSI chip which includes ALU, register circuits &
control circuits. Microprocessor can process micro-instructions. Instructions in the form of 0sand 1s are called micro-
instructions. The microprocessor is the CPU part of a microcomputer, and it is also available as a single integrated circuit.
Its main units are-ALU, Registers, Control Unit.
Microcontroller:- Silicon chip which includes microprocessor, memory & I/O in a single packageMicrocomputer is
designed to perform the specific tasks of embedded systems like displaying microwave information, receiving remote
signals etc.
Differentiate between Microprocessor and microcontroller
Microprocessor microcontroller
It is just a processor. Memory and I/O componentshave to Micro controller has external processor along
be connected externally withinternal memory and i/O components
Since memory and I/O must be connected externally,the Since memory and I/O are present internally,
circuit becomes large thecircuit is small.
Cannot be used in compact systems and henceinefficient Can be used in compact systems and hence it is
anefficient technique
Cost of the entire system increases Cost of the entire system is low
Due to external components, the entire Since external components are low, total
powerconsumption is high. Hence it is not suitable to powerconsumption is less and can be used with
usewith devices running on stored power like batteries. devicesrunning on stored power like batteries.
Most of the microprocessors do not have power Most of the micro controllers have power saving
savingfeatures. modeslike idle mode and power saving mode. This
helps toreduce power consumption even further.
What are the different types of buses
used in a microprocessor.
Address bus –It is a group of conducting
wires which carries address only. Address
bus is unidirectional because data flows in
one direction, from microprocessor to
memory or from microprocessor to
Input/output devices (That is, Out of
Microprocessor). Length of Address Bus
of 8085 microprocessor is 16 Bit. The
microprocessor 8085 can transfer
maximum 16 bit address which means it
can address 65, 536 different memory location. The Length of the address bus determines the amount of memory a
system can address. Data bus –It is a group of conducting wires which carries Data only.Data bus is bidirectional
because data flow in both directions, from microprocessor to memory or Input/Output devices and from memory or
Input/Output devices to microprocessor. Length of Data Bus of 8085 microprocessor is 8 Bit When it is write operation,
the processor will put the data (to be written) on the data bus, when it is read operation, the memory controller will get
the data from specific memory block and put it into the data bus. Control bus – It is a group of conducting wires, which
is used to generate timing and control signals to control all the associated peripherals, microprocessor uses control bus
to process data, that is what to do with selected memory location. Some control signals are: Memory read, Memory
write, I/O read,
I/O Write, Opcode fetch. If one line of control bus may be the read/write line. If the wire is low (no electricity flowing)
then the memory is read, if the wire is high (electricity is flowing) then the memory is written.
List the advantages and disadvantages of high level language, assembly language and machine language.
High Level languages: It is a set of words and symbol which a programmer uses to write a program High-level languages
are much closer to human language. A programming language such as C, FORTRAN or Pascal that enables to write
programs which is understandable to programmer (Human) and can perform any sort of task, such languages are
considered high-level because they are closer to human languages. High level language must use interpreter, compiler or
translator to convert human understandable program to computer readable code (machine code). Some Examples: C &
C++ General Purpose ,PROLOG Artificial Intelligence, JAVA General all purpose programming ,NET General or web
applications. Advantages of High level language: 1)They are near to English language, that is they are easier to read,
write and maintain. 2) High-level languages make complex programming simpler. 3) High level languages is portable,
i.e., they can work on different operating system. Length of the program is also small compared with low level.
4) Many real time problems can be easily solved with high level language.
Disadvantages of High level language over low level language: They need to be translated for the computer to
understand, hence work slower than machine code.
Assembly languages: Assembly languages have the same structure and set of commands as machine languages, but they
enable a programmer to use names instead of numbers. Each assembly language is specific to a particular computer
architecture, in contrast to most high level programming languages, which are generally portable across multiple
systems. Advantages of Assembly Languages: 1) The errors and bugs in assembly language can be easily tracked and
solved. 2) Assembly language is fast and can implement programs faster than others. 3) It is more accessible than
machine language. Disadvantages of Assembly Languages: 1) The syntax used in assembly language is complicated to
learn. 2) Needs more memory to run more extensive programs and codes. 3) It is a machine-dependent language.
4) Prone to errors. Machine language: Machine code or machine language is a system of instructions and data executed
directly by a computer's CPU. The lowest-level programming language that only be understood by computers. Computer
language that is directly executable by a computer without the need for translation by a compiler or an assembler.
Advantages: 1) Machine language makes fast and efficient use of the computer. 2) It requires no translator to translate
the code. It is directly understood by the computer. Disadvantages: 1) All operation codes have to be remembered.
2) All memory addresses have to be remembered. 3) It is hard to amend or find errors in a program written in the
machine language.
Draw and explain the block-diagram/architecture of 8085 microprocessor . Control Unit :
Generates signals within uP to carry out the instruction, which has been decoded. In reality causes certain connections
between blocks of the uP to be
opened or closed, so that data goes
where it is required, and so that
ALU operations occur.
Arithmetic Logic Unit : The ALU
performs the actual numerical and
logic operation such as ‘add’,
‘subtract’, ‘AND’, ‘OR’, etc. Uses
data from memory and from
Accumulator to perform arithmetic.
Always stores result of operation in
Accumulator. Registers : The
8085/8080A-programming model
includes six registers, one
accumulator, and one flag register,
as shown in Figure. In addition, it
has two 16-bit registers: the stack
pointer and the program counter.
They are described briefly as
follows : The 8085/8080A has six
general-purpose registers to store
8-bit data; these are identified as
B,C,D,E,H, and L as shown in the
figure. They can be combined as
register pairs – BC, DE, and HL – to perform some 16-bit operations. The programmer can use these registers to store or
copy data into the registers by using data copy instructions.
Accumulator : The accumulator is an 8-bit register that is a part of arithmetic/logic unit (ALU). This register is used to
store 8-bit data and to perform arithmetic and logical operations. The result of an operation is stored in the
accumulator. The accumulator is also identified as register A.
Flags : The ALU includes five flip-flops, which are set or reset after an operation according to data conditions of the
result in the accumulator and other registers. They are called Zero(Z), Carry (CY), Sign (S), Parity (P), and Auxiliary Carry
(AC) flags; they are listed in the Table and their bit positions in the flag register are shown in the Figure below. The most
commonly used flags are Zero, Carry, and Sign. The microprocessor uses these flags to test data conditions.
Program Counter (PC) : This 16-bit register deals with sequencing the execution of instructions. This register is a
memory pointer. Memory locations have 16-bit addresses, and that is why this is a 16-bit register.
The microprocessor uses this register to sequence the execution of the instructions. The function of the program
counter is to point to the memory address from which the next byte is to be fetched. When a byte (machine code) is
being fetched, the program counter is incremented by one to point to the next memory location.
Stack Pointer (SP) : The stack pointer is also a 16-bit register used as a memory pointer. It points to a memory location in
R/W memory, called the stack. The beginning of the stack is defined by loading 16-bit address in the stack pointer. The
stack concept is explained in the chapter “Stack and Subroutines.” Instruction Register/Decoder : Temporary store for
the current instruction of a program. Latest instruction sent here from memory prior to execution. Decoder then takes
instruction and ‘decodes’ or interprets the instruction. Decoded instruction then passed to next stage. Memory Address
Register : Holds address, received from PC, of next program instruction. Feeds the address bus with addresses of
location of the program under execution. Control Generator : Generates signals within uP to carry out the instruction
which has been decoded. In reality causes certain connections between blocks of the uP to be opened or closed, so that
data goes where it is required, and so that ALU operations occur. Register Selector : This block controls the use of the
register stack in the example. Just a logic circuit which switches between different registers in the set will receive
instructions from Control Unit. General Purpose Registers : uP requires extra registers for versatility. Can be used to
store additional data during a program. More complex processors may have a variety of differently named registers.
What are the different types of assembly language program development tools: 1. Editor - An editor is a
program which allows you to create a file containing the assembly language statements for your program. Example: PC-
Write, Wordstar. - When you have typed in all your program, you then save the file on the hard disk. This file is called
source file and the extension is .asm. 2. Assembler - An assembler program is used to translate the assembly language
mnemonics for instructions to corresponding binary codes. When you run the assembler, it reads the source file of your
program from the disk where you have saved it after editing. 3. Linker- A linker is a program used to join several object
files into one large object file. 4. Locator - A locator is a program used to assign the specific address of where the
segments of object code are to be loaded into memory. 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.
Explain the different types of registers of 8085 microprocessor: (a) General Purpose Registers – The 8085 has six
general-purpose registers to store 8-bit data; these are identified as- B, C, D, E, H, and L. These can be combined as
register pairs – BC, DE, and HL, to perform some 16-bit operation. These registers are used to store or copy temporary
data, by using instructions, during the execution of the program.
(b) Specific Purpose Registers – Accumulator: The accumulator is an 8-bit register (can store 8-bit data) that is the part
of the arithmetic and logical unit (ALU). After performing arithmetical or logical operations, the result is stored in
accumulator. Accumulator is also defined as register A. Flag registers: The flag register is a special purpose register and it
is completely different from other registers in microprocessor. It consists of 8 bits and only 5 of them are useful. The
other three are left vacant and are used in the future Intel versions. These 5 flags are set or reset (when value of flag is 1,
then it is said to be set and when value is 0, then it is said to be reset) after an operation according to data condition of
the result in the accumulator and other registers. The 5 flag registers are:
Sign Flag: It occupies the seventh bit of the flag register, which is also known as the most significant bit. It helps the
programmer to know whether the number stored in the accumulator is positive or negative. If the sign flag is set, it
means that number stored in the accumulator is negative, and if reset, then the number is positive.
ZeroFlag: It occupies the sixth bit of the flag register. It is set, when the operation performed in the ALU results in
zero(all 8 bits are zero), otherwise it is reset. It helps in determining if two numbers are equal or not.
AuxiliaryCarry Flag: It occupies the fourth bit of the flag register. In an arithmetic operation, when a carry flag is
generated by the third bit and passed on to the fourth bit, then Auxiliary Carry flag is set. If not flag is reset. This flag is
used internally for BCD(Binary-Coded decimal Number) operations. Note – This is the only flag register in 8085 which is
not accessible by user. Parity Flag: It occupies the second bit of the flag register. This flag tests for number of 1’s in the
accumulator. If the accumulator holds even number of 1’s, then this flag is set and it is said to even parity. On the other
hand if the number of 1’s is odd, then it is reset and it is said to be odd parity.
Carry Flag: It occupies the zeroth bit of the flag register. If the arithmetic operation results in a carry(if result is more
than 8 bit), then Carry Flag is set; otherwise it is reset. Memory Registers: There are two 16-bit registers used to hold
memory addresses. The size of these registers is 16 bits because the memory addresses are 16 bits. They are :-
Program Counter: This register is used to sequence the execution of the instructions. The function of the program
counter is to point to the memory address from which the next byte is to be fetched. When a byte (machine code) is
being fetched, the program counter is incremented by one to point to the next memory location.
Stack Pointer: It is used as a memory pointer. It points to a memory location in read/write memory, called the stack. It is
always incremented/decremented by 2 during push and pop operation.
Draw and explain the pin diagram of 8085 microprocessor: The
8085 is an 8-bit general purpose microprocessor that can address 64K
Byte of memory. It has 40 pins and uses +5V for power. It can run at a
maximum frequency of 3 MHz.
Address Bus(Pin 21-28): 16 bit address lines A0 to A15. The address bus
has 8 signal lines A8 – A15 which are unidirectional. The other 8
address lines A0 to A7 are multiplexed (time shared) with the 8 data
bits. Data Bus (Pin 19-12): To save the number of pins lower order
addresspin are multiplexed with 8 bit data bus (bidirectional). So, the
bits AD0– AD7 are bi-directional directional and serve as A0 – A7 and
D0 – D7at the same time. Status Pins – ALE, S1, S0
ALE(Address Latch Enable): (Pin 30): Used to demultiplexed the
address and data bus. ALE = 1 when the AD0 – AD7 lines have an
address. ALE = 0 When it is low it indicates that the contents are data
S1 and S0 (Status Signal): (Pin 33 and 29): Status signals to specify the
kind of operation being performed.
Control Pins – RD, WR, IO/M(active low):
RD: Read(Active low) (Pin 32): Indicated that data is to be read either
from memory or I/P device and data bus is ready for accepting data
from the memory or I/O device.
WR:Write(Active low) (Pin 31): Indicated that data on the data bus are to be written into selected memory or I/P
device.
IO/M: (Input Output/Memory-Active low) (Pin 34): When (IO/M=1) the address on the address bus is for I/O device
When (IO/M=0) the address on the address bus is for memory Interrupts. They are the signals initiated by an external
device to request the microprocessor to do a particular task or work. There are hardware interrupts called,
(Pin 6-11) TRAP, RST 7.5, RST 6.5, RST 5.5, INTR, INTA. Vcc (Pin 40) : single +5 volt power supply. Vss (Pin 20) : Ground
X0 and X1 :((Pin 1-2): Crystal or R/C network or LC network connections to set the frequency of internal clock generator.
CLK(Output)(pin 37): Clock Output is used as the system clock for peripheral and devices interfaced with the
microprocessor. Reset Signals: Reset In (input, active low) (Pin 36) - This signal is used to reset the microprocessor.
Reset Out (Output, Active High) (Pin 3)- It indicates MP is being reset. Used to reset all the connected devices when the
microprocessor is reset.DMA Request Signals: HOLD (Pin 38)-This signal indicates that another device is requesting the
use of address and data bus. HLDA (Pin 39) - On receipt of HOLD signal, the MP acknowledges the request by sending
out HLDA signal and leaves out the control of the buses.Serial I/O Signals: SID (input) Serial input data (Pin 4) - It is a
data line for serial input. It is used to accept serial data bit by bit from external device
SOD (output) Serial output data (Pin 5)- It is a data line for serial output. It is used to transmit serial data bit by bit to
the external device. Ready(input)(Pin 35): The processor sets the READY signal after completing the present job to
access the data. It synchronize slower peripheral to the processor.
Write the working of the following pins: HOLD- This signal indicates that another device is requesting the
use of address and data bus. So it relinquishes the use of buses as soon as the current machine cycle is completed. MP
regains the bus after the removal of a HOLD signal . HLDA- On receipt of HOLD signal, the MP acknowledges the request
by sending outHLDA signal and leaves out the control of the buses. After the HLDA signal the DMA controller starts the
direct transfer of data. After the removal of HOLD request HLDA goes low.
IO/M - This signal is used to differentiate between IO and Memory operations. When it is 1 it means that the address on
the address bus is for I/O device whereas if it is 0 the address on the address bus is for memory
TRAP - The TRAP instruction is used to handle non-maskable interrupts (NMI) in the 8085 microprocessor. The TRAP
instruction is a one-byte instruction. It provides a way to call a specific subroutine to handle critical system events that
cannot be ignored by the processor. Ready- the READY pin in the 8085 microprocessor is a signal line used to
synchronize the data transfer between the processor and the peripheral devices. It provides a way to insert wait states
in the execution cycle of the processor and ensures that the data transfer is error-free
ALE-ALE (Address Enable Latch) is the control signal which is nothing but a positive going pulse generated when a new
operation is started by microprocessor. So when pulse goes high means ALE=1, it makes address bus enabled and when
ALE=0, means lowpulse makes data bus enabled.
Write a short note on : Fetch cycle- The fetch cycle takes the instruction required from memory, stores it in the
instruction register, and increment the program counter by one so that it points to the next instruction
Execute cycle- The actual actions which occur during the execute cycle of an instruction. Depend on both the instruction
itself and the addressing mode specified to be used to access the data that may be required
Instruction cycle- The necessary steps that a CPU carries out to fetch an instruction and necessary data from the
memory and execute it, constitute an instruction cycle. IC = FC + EC. Machine cycle-A machine cycle consists of the steps
that a computer’s processor executes whenever it receives a machine language instruction. It is the most basic CPU
operation, and modern CPUs are able to perform millions of machine cycles per second. The cycle consists of three
standard steps: fetch, decode and execute.
What gave the different classification of8085 instruction. Give two examples of each