0% found this document useful (0 votes)
40 views27 pages

Chapter One Interfacing 1111111

Uploaded by

Assafaw Takele
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views27 pages

Chapter One Interfacing 1111111

Uploaded by

Assafaw Takele
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Chapter One: Introduction to microcomputer and microprocessor

1. Introduction
In this chapter microcomputer organization, different part of microcomputer and
operation, Microprocessor, Evolution of microprocessor, Microprocessors
Architecture and operation, ALU, Register Array, Instruction execution, Memory
array design and memory interfacing are discussed.
After completing this chapter, the students will be able to:
 Differentiate Microprocessor and microcontroller
 Explain memory array design
 Differentiate Static and Dynamic RAM
 Develop knowledge about microcomputer, microprocessor and memory
interfacing.

1.2. Microcomputer

The term microcomputer is generally synonymous with personal computer,or a


computer that depends on a microprocessor. Microcomputer is used to describe a
system that includes a minimum of a microprocessor, program memory, data
memory, and input/output (I/O). Some microcomputer systems include additional
components such as timers, counters, analogue-to-digital converters and so on.
Thus, a microcomputer system can be anything from a large computer having hard
disks, floppy disks and printers, to a single chip computer system. Microprocessor
based system design involves interfacing of the processor with one or more
peripheral devices for the purpose of communication with various input and output
devices connected to it. During the early days of the microprocessor revolution,

Microcomputers &interfacing 1
these techniques required complex hardware consisting of Medium scale
integration devices making the design highly complex and time consuming.

The hardware of a microcomputer system can be divided into four functional


sections such as: Input unit, Microprocessor Unit, Memory Unit, and Output Unit.

Figure 1.1: General Architecture of a Microcomputer System

Input Unit and Output Unit: Input and Output units are the means by which the
MPU communicates with the outside world. Input unit: keyboard, mouse, scanner
etc. Output unit: Monitor, printer etc. Bi-directional ports: Modem, Network etc.
I/O is responsible for interfacing between CPU and operators or external devices.
I/O includes any device that converts binary data in the computer into another form
of data that are used by human. Examples of I/O devices include monitors,
keyboards, printers, modems, hard disks, floppy disks, etc. Each computer system
may have many I/O ports. Each input port has a unique address and each output
port has a unique address. Some microprocessors assign the memory and I/O with
separate address space (e.g., Intel x86 processors). In this case, one may use
memory address X and also I/O address X the same time. Some microprocessors
make the memory and I/O use the same address space (e.g., Motorola 68HC12). In
this case, if memory uses address X, I/O cannot use address X.

Microcomputers &interfacing 2
1.3. Microprocessor Unit/ Central Processing Unit:

CPU has two main components


(a) Arithmetic and logic unit (ALU): Responsible for computation only
(b) Control unit:
 Responsible for sending and gathering information from memory and I/O and
Responsible for coordinating the sequence and timing of the activities on the
whole system.

 CPU is the "brain" of the microcomputer. It provides the decision making


ability for the computer. CPU has two parts, the arithmetic and logic unit
(ALU), and control unit and CPU also has several storage places called
registers.
ALU is responsible for arithmetic and logic operations. Control unit is responsible
for coordinating the data flow and to control the sequence and timing of circuit
operations in the system. Registers are a very small but fast accessing storage
space that holds very essential information for program execution and decision
making.In program execution, the CPU reads and executes the programs
instructions one by one from the main memory. The execution of instructions may
involve the arithmetic/logic operations and/or transfer data between CPU and main
memory (or I/O ports).
Memory Unit: memory unit is a component of a computer system. It is used to
store data, instructions and information. It is actually a work area of computer,
where the CPU stores the data and instruction.
(a) Processor Memory
(b) Primary (or main) memory (c) Secondary memory
Hard disks, CD, floppy disks, tape

Microcomputers &interfacing 3
Memory is responsible for storing programs and the data that are needed by the
program. To make the concept clear, we divide the computer memory to processor
memory, main memory (or primary memory) and secondary memory.
Processor Memory refers to a set of CPU registers. These registers are useful to
hold temporary results when a computation is in progress. Also, there is no speed
disparity between the registers and the microprocessor because they are fabricated
using the same technology. The main disadvantage is the cost involved which
forces the architect to include very few registers (usually 8 to 16 only) in the
microprocessor.
The main memory is the memory that the CPU can access directly. Examples of
main memory include RAM, ROM, etc.
The secondary memory cannot be addressed directly (cannot access specified
memory location) by the CPU. Examples of secondary include floppy disk, hard
disk, CD, etc. The information in the secondary memory must be copied to the
main memory so that CPU can access it. Secondary memory is much cheaper than
primary memory.

1.4. Microprocessor and Microcontroller


Microprocessor is a multipurpose, programmable register based electronic device
which read binary instructions from memory, processes the input data as per
instructions and provides output. It is an IC which has only the CPU inside them
i.e. only the processing powers such as Intel’s Pentium 1,2,3,4, core 2 duo, i3, i5
etc. These microprocessors don’t have RAM, ROM, and other peripheral on the
chip. A system designer has to add them externally to make them functional.

Microcontroller is a device that includes microprocessor, memory and input/output


devices on a single chip. Microcontroller has a CPU, in addition with a fixed

Microcomputers &interfacing 4
amount of RAM, ROM and other peripherals all embedded on a single chip. At
times it is also termed as a mini computer or a computer on a single chip.

Microcontroller: 1. Microcontroller having inbuilt RAM or ROM & inbuilt timer.


2. Input and output ports are available.
3. Inbuilt serial port.
4. Separate memory to store program and data.
5. Many functional pins on the IC.
6. Boolean operation directly possible.
7. It takes few instructions to read and write data from external memory.

Microprocessor:
1. Do not have inbuilt RAM or ROM and timer.
2. Input and output ports are not available, requires extra device like 8255
3. Do not have inbuilt serial port, requires 8250 device.
4. Program and data are stored in same memory.
5. Less multifunction pins on IC.
6. Boolean operation is not possible directly
7. It takes many instructions to read and write data from external memory

1.5. Microprocessor Characteristics


Basic characteristics that can differentiate microprocessors are-
1. Architecture /Instruction set: The set of instructions that the microprocessor
can execute. Based on Architecture/instruction set, the major categories are RISC
and CISC architecture/instruction set.
2. Bandwidth: The number of bits processed in a single instruction.

Microcomputers &interfacing 5
3. Clock speed: Given in megahertz (MHz), the clock speed determines how many
instructions per second the processor can execute or we can say based on
Performance. Performance (in terms of speed, power consumption...)
In modern μPs(microprocessor), the best features from the different types is taken
to achieve the maximum performance.
4. Finally we can classify/differentiate based on Application type .In all cases, the
higher the value, the more powerful the CPU.

1.6. Types of Microprocessors:


Microprocessors generally is categorized in terms of the maximum number of
binary bits in the data they process (i.e. number of bits that their ALU can work
with at a time) – that is, their word length. Over time, five standard data widths
have evolved for microprocessors: 4-bit, 8-bit, 16-bit, 32-bit, 64-bit. So, 16-bit
microprocessor means that ALU can work with 16-bit number at a time or, data
width of this microprocessor is 16-bit. There are so many manufacturers of
Microprocessors, but only two companies have been produces popular
microprocessors: Intel and Motorola.
1.7. Evolution of Microprocessor:
We can divide the years of development of microprocessors as 5 generations
(based on data width).

First generation (1971 – 73)

Intel Corporation introduced 4004(4 bit), the first microprocessor in 1971. It is


evolved from the development effort while designing a calculator chip. There were
three other microprocessors in the market during the same period:

 Intel’s 8008 (8 bits)


 National Semiconductor’s IMP-16 (16 bits)

Microcomputers &interfacing 6
They were fabricated using PMOS technology which provided low cost, slow
speed and low output currents. It contained 2300 PMOS transistor.

Second Generation (1974 – 1978)


Marked the beginning of very efficient 8 – bit microprocessors. Some of the
popular processors were: Motorola’s 6800 and 6809, Intel’s 8085(data bus = 8 bit
& address bus =16 bit) ,Zilog’s Z80.They were manufactured using NMOS
technology. This technology offered faster speed and higher density than PMOS. It
is TTL compatible.
Limitations of 8 Bit microprocessor:
1. Low speed of execution 3. Limited number of general purpose registers
2. Low memory addressing capability 4. Less power full instruction set

Third generation microprocessors (1979 – 80)


This age is dominated by 16 – bits microprocessors .Some of them were: Intel’s
8086/80186/80286 , Motorolla’s 68000/68010 .They were designed using HMOS
technology.HMOS provides some advantages over NMOS as Speed-power-
product of HMOS is four times better than that of NMOS.HMOS can
accommodate twice the circuit density compared to NMOS .Intel used HMOS
technology to recreate 8085A and named it as 8085AH with a higher price tag.
Fourth Generation (1981 – 1995)
This era marked the beginning of 32 bits microprocessors .Intel introduced 432,
which was bit problematic .Then a clean 80386 in launched. Motorola introduced
68020/68030. They were fabricated using low-power version of the HMOS
technology called HCMOS. Motorola introduced 32-bit RISC processors called
MC88100.

Microcomputers &interfacing 7
Fifth Generation (1995 – till date)
This age the emphasis is on introducing chips that carry on-chip functionalities and
improvements in the speed of memory and I/O devices along with introduction of
64-bit microprocessors. Intel leads the show here with Pentium, Celeron and very
recently dual and quad core processors working with up to 3.5GHz speed.
1.8. Microprocessor Architecture
Its architecture consists of a central processing unit, memory modules, a system
bus, and an input/output unit. The system bus connects the various units to
facilitate the exchange of information. It further consists of data, address, and
control buses to perform data exchanging properly.

Figure 1. 2 : Microprocessor based system

As there are a great many variations in architecture between the different kinds of
CPU/MPU, we shall begin my looking at a simplified model of the structure. The
simplified model consists of five parts, which are:

1.8.1 Arithmetic & Logic Unit (ALU)

The part of the central processing unit that deals with operations such as addition,
subtraction and multiplication of integers and Boolean operations. It receives
control signals from the control unit telling it to carry out these operations. It works

Microcomputers &interfacing 8
in conjunction with the register array for many of these, in particular, the
accumulator and flag registers. The accumulator holds the results of operations,
while the flag register contains a number of individual bits that are used to store
information about the last operation carried out by the ALU.

Some of the tasks performed by the ALU are given below:

Addition and subtraction: These two tasks are performed by constructs of logic
gates, such as half adders and full adders. While they may be termed 'adders', with
the aid of they can also perform subtraction via use of inverters and 'two's
complement' arithmetic.
Multiplication and division: In most modern processors, the multiplication and
division of integer values is handled by specific floating-point hardware within the
CPU. Earlier processors used either additional chips known as maths co-
processors, or used a completely different method to perform the task.

Logical tests: Further logic gates are used within the ALU to perform a number of
different logical tests, including seeing if an operation produces a result of zero.
Most of these logical tests are used to then change the values stored in the flag
register, so that they may be checked later by separate operations or instructions.
Others produce a result which is then stored, and used later in further processing.
Comparison: Comparison operations compare values in order to determine such
things as whether one number is greater than, less than or equal to another. These
operations can be performed by subtraction of one of the numbers from the other,
and as such can be handled by the aforementioned logic gates. However, it is not
strictly necessary for the result of the calculation to be stored in this instance; the
amount by which the values differ is not required. Instead, the appropriate status

Microcomputers &interfacing 9
flags in the flag register are set and checked to determine the result of the
operation.
Bit shifting: Shifting operations move bits left or right within a word, with
different operations filling the gaps created in different ways. This is accomplished
via the use of a shift register, which uses pulses from the clock within the control
unit to 10 trigger a chain reaction of movement across the bits that make up the
word. Again, this is a quite complicated logical procedure, and further reading may
aid your understanding.

1.8.2. Control Unit (CU)

This controls the movement of instructions in and out of the processor, and also
controls the operation of the ALU. It consists of a decoder, control logic circuits,
and a clock to ensure everything happens at the correct time. It is also responsible
for performing the instruction execution cycle. The three main elements of the
control unit are as follows:
Decoder: This is used to decode the instructions that make up a program when
they are being processed, and to determine in what actions must be taken in order
to process them. These decisions are normally taken by looking at the opcode of
the instruction, together with the addressing mode used.
Timer or clock: The timer or clock ensures that all processes and instructions are
carried out and completed at the right time. Pulses are sent to the other areas of the
CPU at regular intervals (related to the processor clock speed), and actions only
occur when a pulse is detected. This ensures that the actions themselves also occur
at these same regular intervals, meaning that the operations of the CPU are
synchronized.

Microcomputers &interfacing 10
Control logic circuits: The control logic circuits are used to create the control
signals themselves, which are then sent around the processor. These signals inform
the arithmetic and logic unit and the register array what they actions and steps they
should be performing, what data they should be using to perform said actions, and
what should be done with the results.

1.8.3. Register Array:


This is a small amount of internal memory that is used for the quick storage and
retrieval of data and instructions. All processors include some common registers
used for specific functions, namely the program counter, instruction register,
accumulator, memory address register and stack pointer. Many different types of
registers are common between most microprocessor designs. These are:

Program Counter (PC): This register is used to hold the memory address of the
next instruction that has to execute in a program. This is to ensure the CPU knows
at all times where it has reached, that is able to resume following an execution at
the correct point, and that the program is executed correctly.
Instruction Register (IR): This is used to hold the current instruction in the
processor while it is being decoded and executed, in order for the speed of the
whole execution process to be reduced. This is because the time needed to access
the instruction register is much less than continual checking of the memory
location itself.
Accumulator (A, or ACC): The accumulator is used to hold the result of
operations performed by the arithmetic and logic unit.
Memory Address Register (MAR): Used for storage of memory addresses,
usually the addresses involved in the instructions held in the instruction register.
The control unit then checks this register when needs to know which memory
address to check or obtain data from.

Microcomputers &interfacing 11
Memory Buffer Register (MBR): When an instruction or data is obtained from
the memory or elsewhere, it is first placed in the memory buffer register. The next
action to take is then determined and carried out, and the data is moved on to the
desired location.
Flag register / status flags: The flag register is specially designed to contain all
the appropriate 1-bit status flags, which are changed as a result of operations
involving the arithmetic and logic unit.
Other general purpose registers: These registers have no specific purpose, but
are generally used for the quick storage of pieces of data that are required later in
the program execution. In the model used here these are assigned the names A and
B, 12 with suffixes of L and U indicating the lower and upper sections of the
register respectively.

1.8.4. System Bus:


It is used for connections between the processor, memory and peripherals, and
transferal of data between the various parts. The system bus consists of three
different groups of wiring, called the data bus, control bus and address bus. These
all have separate responsibilities and characteristics, which can be outlined as
follows:

Control Bus: The control bus contains lines that select the memory or I/O and
cause them to perform a read or write operation. In most computer system, there
are four control bus connections: (Memory read control), (Memory Write control)
(I/O read control) ,(I/O write control) .
Data Bus: This is used for the exchange of data between the processor, memory
and peripherals, and is bi-directional so that it allows data flow in both directions
along the wires. Data bus may be 8 bits, 16 bits, 32 bits or 64 bits.

Microcomputers &interfacing 12
Address Bus: Address bus – carries memory addresses from the processor to other
components such as primary storage and input/output devices. .
Note: The 8086 has a combined address and data bus commonly referred as a time
multiplexed address and data bus. The main reason behind multiplexing address
and data over the same pins is the maximum utilization of processor pins and it
facilitates the use of 40 pin standard DIP package

Figure 1. 3 : System bus model of a computer system

1.8.5. Memory
The memory is not an actual part of the CPU itself, and is instead housed
elsewhere on the motherboard. However, it is here that the program being executed
is stored, and as such is a crucial part of the overall structure involved in program
execution.To execute an instruction–the processor must:

Instruction Fetch: Control unit collect the instructions from main memory and put
them in CPU register. This is called instruction fetch.
Instruction Decode: When instruction reaches in processor register, CU decodes
or interprets the instruction and sends necessary signals and data to ALU.
Instruction Execute: ALU process the data with arithmetic and logic operations
and gives a result according to instructions.

Microcomputers &interfacing 13
Store Result: Finally CU stores result in Accumulator or main memory. These
four steps to execute an instruction are called machine cycle.

1.9. Microprocessor Architecture (Based on Instruction Set)


As microprocessor is a programmable device, obviously it has an instruction set to
control its operation by programming. There are two prevalent instruction set
architectures:

 RISC (Reduced Instruction Set Computer) Architecture.


 CISC (Complex Instruction Set Computer) Architecture.
CISC Architecture RISC architecture
CISC chips have Alarge amount of Small number of instructions in the
different and complex instructions instruction set compared to CISC.
In common,CISC chips process smaller RISC chips use simpler instructions
instructions per clock cycles than RISC sets to achieve higher clock frequencies
processors, but to do same task number and process more instructions per clock
of instruction is smaller in CISC than cycle than CISC processors
RISC.
It’s hardware design is difficult but It’s hardware design is easy but
programming is easy as it has large software (programming) is difficult
amount of instructions. because you have to write using a small
number of instructions.

Apple and SUN use RISC architecture Intel and AMD develop CISC
processors ,8086 microprocessor has
RISC architecture
Table 1.1: CISC and RISC architecture

Microcomputers &interfacing 14
Typically, CISC chips have a large amount of different and complex instructions.
The philosophy behind it is that hardware is always faster than software, therefore
one should make a powerful instruction set, which provides programmers with
assembly instructions to do a lot with short programs.
There is still considerable controversy among experts about which architecture is
better. Some say that RISC is cheaper and faster and therefor the architecture of the
future. Others note that by making the hardware simpler, RISC puts a greater
burden on the software. Software needs to become more complex. Software
developers need to write more lines for the same tasks. Therefore they argue that
RISC is not the architecture of the future, since conventional CISC chips are
becoming faster and cheaper anyway.

2. Interfacing
Interface is the path for communication between two components. Interfacing is of
two types, memory interfacing and I/O interfacing.

2.1. Memory Interfacing


When we are executing any instruction, we need the microprocessor to access the
memory for reading instruction codes and the data stored in the memory. For this,
both the memory and the microprocessor requires some signals to read from and
write to registers. The interfacing process includes some key factors to match with
the memory requirements and microprocessor signals. The interfacing circuit
therefore should be designed in such a way that it matches the memory signal
requirements with the signals of the microprocessor. There are various
communication devices like the keyboard, mouse, printer, etc. So, we need to
interface the keyboard and other devices with the microprocessor by using latches
and buffers. This type of interfacing is known as I/O interfacing.

Microcomputers &interfacing 15
Figure 1. 4 : block diagram of memory and I/O interfacing

2. 2. Memory Organization of Microcomputer systems

2.3. Purpose of Memory:


Memory unit is the integral part of any microcomputer system and its primary
purpose is to hold program and data. The major design goal of memory unit is to
allow it to operate as speed close to that of the processor .The cost factor inhibits
the design of entire memory unit with single technology that guarantees high
speed. In order to seek a trade-off between the cost and operating speed, a memory
system is usually designed with different technologies such as solid state, magnetic
and optical.

2.3.1. Types of Memory:


In a broad sense, microcomputer memory can be divided into three groups:
(a) Processor Memory
(b) Primary (or main) memory
 Volatile memory
RAM - random access memory (Static RAM &Dynamic RAM )

Microcomputers &interfacing 16
 Non-volatile memory (ROM - read only memory EPROM, EEPROM,
FLASH)
(c) Secondary memory (Hard disks, CD, floppy disks, tape)
Processor Memory refers to a set of CPU registers. These registers are useful to
hold temporary results when a computation is in progress. Also, there is no speed
disparity between the registers and the microprocessor because they are fabricated
using the same technology. The main disadvantage is the cost involved which
forces the architect to include very few registers (usually 8 to 16 only) in the
microprocessor.
The primary memory or, main memory is the memory that the CPU can access
directly. Examples of main memory include RAM, ROM, etc.

The secondary memory cannot be addressed directly (cannot access specified


memory location) by the CPU. Examples of secondary include floppy disk, hard
disk, CD, etc. The information in the secondary memory must be copied to the
main memory so that CPU can access it. Secondary memory is much cheaper than
primary memory.

2.3.2. Types of Primary Memory


There are two types of primary memories: volatile and nonvolatile. Volatile
memory is the type of memory that will lose data when the power supply to the
memory is gone. Random access memory (RAM) is one type of volatile memory.

Nonvolatile memory keeps the data in the memory even it is not powered up.
Nonvolatile memory includes read only memory (ROM).

Read Only Memory (ROM) is used to permanently save the program being
executed. The size of program that can be written depends on the size of this
memory. There are several types of ROM.

Microcomputers &interfacing 17
(i) Masked ROM (MROM) is a kind of ROM the content of which is programmed
by the manufacturer. The term ‘masked’ comes from the manufacturing process,
where regions of the chip are masked off before the process of photolithography.
In case of a large-scale production, the price is very low.

(ii) One time programmable ROM (OTP ROM) enables you to download a
program into it, but, as its name states, one time only. If an error is detected after
downloading, the only thing you can do is to download the correct program to
another chip.
(iii) UV Erasable Programmable ROM (UV EPROM) Both the manufacturing
process and characteristics of this memory are completely identical to OTP ROM.
It enables data to be erased under strong ultraviolet light. After a few minutes it is
possible to download a new program into it.
(iv) Flash Memory This type of memory was invented in the 80s in the laboratories
of INTEL and was represented as the successor to the UV EPROM. The content of
this memory can be written and cleared practically an unlimited number of times.
Flash memory can only be erased block (many bytes) by block.
(v) Electrically Erasable programmable ROM (EPROM) the contents of EEPROM
may be changed during operation (similar to RAM), but remains permanently
saved even after the loss of power (similar to ROM). EEPROM can be
programmed and erased byte by byte.
Random Access Memory (RAM): Information stored in random access memories
will be lost if the power is turned off. This property is known as volatility and
hence, RAMs are usually called volatile memories. RAM can be made of magnetic
core or by semiconductor. Semiconductor RAM’s are two types: Static RAM and
Dynamic RAM.

Microcomputers &interfacing 18
Static RAM: In a semiconductor memory constructed using bipolar transistors; the
information is stored in the form of voltage levels in flip-flops. These voltage
levels do not usually get drifted away. Such memories are called static RAMs
because stored information remains constant for some period of time. Since the
static RAM maintains information in active circuits, power is required even when
the chip is inactive or standby mode. Hence, static RAMs require large power
supplies. Also each static RAM cell is about four times larger in area than an
equivalent dynamic cell. Dynamic RAM: On the other hand, semiconductor
memories designed using MOS transistors, the information is held in the form of
electrical charges in capacitors. Here the stored charge has the tendency of get
leaked away. These memories are referred to as dynamic RAMs. In order to
prevent any information loss, dynamic RAMS have to be refreshed at regular
intervals. Refreshing means boosting the 18 signal level and writing it back. This
activity is performed using hardware unit termed as refresh logic.
Differences between static and dynamic RAMs:

Microcomputers &interfacing 19
2.4. Main Memory Array Design:

2.4.1. Addressing Memory


Using 3-bit we can address =8 distinct memory location. So, n number of bits
can address memory locations.
1K Byte = 1024 Byte So, for addressing 1KB of memory we need at least 10 bits.
And the addresses will be 0 to 1023 (decimal) or, 000H to 3FF (HEX) or, 0000
0000 0000 to 0011 1111 1111 B (Binary).

Similarly, for addressing 64 KB of memory we need at least 1

How many bits are necessary to address 1MB memory?


1MB= 1024Kbyte= 1,048,576 Byte
So, we need 20 bits to address 1MByte memory. Addresses will be-
0 to 1,048,575 (Decimal),00000H to FFFFFH (Hex)

Microcomputers &interfacing 20
(0000 0000 0000 0000 0000 to 1111 1111 1111 1111 1111 B (Binary))

Note: 8086 has 20-bit address bus. So, it can addresses 1 MB memory.

Address decoding refers to the way a computer system decodes


the addresses on the address bus to select memory locations in one or more
memory or peripheral devices.

Figure 1.5: Address decoding

In many applications, a memory of large size capacity is often realized by


interconnecting several small size memory blocks. There are two kinds of
techniques used for designing the main memory(address decoding) in such cases.
They are:

Microcomputers &interfacing 21
(1) Partial or Linear Decoding.
(2) Absolute or Fully Decoding.
To realize the interconnecting technique first we should know about a small
memory block. Let us consider the block diagram of a typical RAM IC.

The capacity of this chip is 1Kbytes. They are organized in the form of 1024
words with 8 bits/word.
 Each word has a unique address and is specified on 10-bit address lines A9 –
A0.

The inputs and outputs are routed through the 8-bit bidirectional data bus (D7–
D0). The operation of this chip is governed by two control inputs: (Write
Enable) and (Chip Select).
The following truth table describes the operation of this chip:

Microcomputers &interfacing 22
When CS is high, chip is not selected at all, hence D7 to D0 are driven to high
impedance state. When CS = 0 and WE = 0, data on lines D7 – D0 are written
into the word addressed by A0 through A9. 
When CS = 0 and WE = 1, the contents of memory word whose address is on
A9 – A0 will appear on lines D7 – D0. 
Now let us discuss linear decoding and fully decoding:

2.4.1.1. Linear Decoding


This technique uses the unused address lines of the microprocessor as chip selects
for the memory chip. In small systems, h/w for the decoding logic can be
eliminated by using individual high-order address lines to select memory chips.
This is referred to as linear decoding. The main advantage of linear select decoding
is its simplified decoding circuit. This reduces the hardware design cost. But there
are many dis advantages in this decoding. Multiple addresses are provided for the
same location and complete memory space of the microprocessor is not efficiently
used Adding or interfacing ICs with already existing circuitry is difficult.

In a microcomputer system the memory array is often consists of several blocks of


memory chips. Each block of memory requires decoding circuit. To avoid separate
decoding for each memory block special decoder IC is used to generate chip select
signal for each block.

Microcomputers &interfacing 23
Figure1. 6 : Linear decoding

A simple way to connect an 8-bit microprocessor to a 6K RAM system using linear


decoding is shown in figure, where- Address lines A9 through A0 of the

Microcomputers &interfacing 24
microprocessor used as common input to address lines of all memory chips. The
data lines of microprocessor are connected to data lines of all memory chips. The
remaining address lines (A10-A15) are used to select one of the chips ( ) at a
time. For example, 000001 selects chip1, 100000 selects chip 6 etc. from
microprocessor is connected to of all RAM Chips. This line select whether data
is writing to memory or reading from memory.
Advantage:- Linear decoding does not need any decoding circuit (Hardware).
Disadvantages:-
a) Although there is an address bus of 16-bits wide, we could connect only 6Kb of
RAM. This idea clearly wasted address space.
b) Address map is not contiguous. It is sparsely distributed.
c) Conflicts occur if two of the select lines (suppose A11 and A10) become active
at the same time.
d) If all unused address lines are not used as chip selectors, then these unused lines
become don’t cares. This results in fold back, meaning a memory location will
have its image in memory map. For example, if A15 is don’t care, then address
0000H is same as address 8000H. It wastes memory space.

2.4.1.2. Fully Decoding


All the higher address lines are decoded to select the memory chip, and the
memory chip is selected only for the specified logic level on these high-order
address, no other logic levels can select the chip.
The problems of bus conflict and sparse address distribution are eliminated by the
use of fully decoding address technique.
Consider an example where we interface 4Kb of RAM to an 8 – bit
microprocessor. The RAM chips are available in the form of 1K X 8.

Microcomputers &interfacing 25
First we have to write memory map to identify the address lines to be given to
decoderlogic. There are many advantages in absolute address decoding.

1. Each memory location has only one address; there is no duplication in the
address.
2. Memory can be placed contiguously in the address space of the microprocessor.
3. Future expansion can be made easily without disturb ing the existing circuitry

Table 1. 2 : memory map for address lines memory map for address lines

If we observe A10 and A11, 2-to-4 decoder would be an obvious choice for CS
signals. We can write the truth table as follows:

Table 1. 3 : the truth table for CS signals

Microcomputers &interfacing 26
Figure 1.7: Fully Decoding

Microcomputers &interfacing 27

You might also like