Professional Documents
Culture Documents
EUGENE BIZIMANA.
Department of Biomedical Science
Engineering
@MUST 1
Memory and I/O Design
Outline
• Memory and I/O Design;
• Digital I/O
• D/A and A/D signal conversions and converters
@MUST 2
Microprocessor Memory Design
• The main purpose of a memory unit is to hold
instructions and data.
• The major design goal of a memory unit is to
allow it to operate at a speed close to that of a
microprocessor.
• High speed memory is extremely expensive and it
is Practically not feasible to design a large
memory unit.
@MUST 3
Classification of Memory
• A microcomputer memory system can be broadly
divided into three groups:
1. Microprocessor memory
2. Primary or main memory
3. Secondary memory
@MUST 4
Memory Hierarchy
@MUST 6
Main Memory
• The main memory is divided into:
i. Random Access Memory (RAM)
ii. Read Only Memory (ROM)
@MUST 7
Random Access Memory (RAM)
• This type of memory is temporary or volatile in nature as
its data is erased when the system is shut down.
Word Line
@MUST 10
Static RAM (SRAM)
• It consists of internal flip-flops that store the binary
information.
• The static RAM is easier to use and has shorter read and write
cycles compared to dynamic RAM.
@MUST 11
Static Random Access Memories
SRAM cell is a type of flip-flop circuit, usually
implemented using FETs.
Data Data j
j
Word Enable
i
Columns =@MUST
Bits (Double Rail Encoded) 12
RAM Timing
WE
CS
WE
CS
Fig: 3:Simplified Write Timing
Memory Cycle Time
Address Valid Address
@MUST 13
Static RAM Organization
1024 x 4 SRAM
CS
Chip Select Line (active lo) WE
A9
Write Enable Line (active lo) A8
A7 IO3
A6 IO2
10 Address Lines A5 IO1
A4 IO0
4 Bidirectional Data Lines A3
A2
A1
A0
@MUST 14
Memory Cell
• The memory cell is the fundamental building block of
computer memory.
@MUST 15
Memory Addresses
• A memory address is a reference to a specific
memory location used at various levels by
software and hardware.
@MUST 16
Physical Addresses
• The main memory of a microcomputer has many
memory locations.
@MUST 17
Logical Addresses
• A logical address is the address at which a memory
cell appears to reside from the perspective of an
executing application program.
@MUST 20
• When a memory address is generated, cache
is searched first to determine if the address
exists there.
@MUST 21
Types of Cache
i.Level 1 (L1) Cache: Also known as primary cache,
is extremely fast but relatively small, and is usually
embedded in the processor chip as CPU each.
@MUST 23
Cache Hit Ratio
• The performance of cache memory is measured
in terms of its hit ratio.
@MUST 24
Hit Ratio
• The ratio of the number of hits to the total CPU
references to memory is called hit ratio.
@MUST 25
Hit Time
• The time required to access the requested
information in a given level of memory.
@MUST 26
Read Only Memory
• This refers to memory that performs the read
only operation. It does not have write capability.
@MUST 27
Read-Only Memories
2764 EPROM 2764 2764
8K x 8 +
VPP
PGM +
VPP
PGM
A12 A12
A11 A11
2764 A10 O7 A10 O7
A9 O6 A9 O6
VPP A8 O5 A8 O5
A7 O4 A7 O4
PGM A6 O3 A6 O3
A12 A5 O2 A5 O2
A4 O1 A4 O1
A11 A3 O0 A3 O0
A2 A2
A10 O7 A1 A1
A0 A0
A9 O6 CS U3 CS U2
A8 OE OE
O5
A7 O4
A13
A6 /OE
O3 A12:A0
A5 O2 D15:D8
A4 D7:D0
O1 2764 2764
A3 O0 + VPP
+
VPP
PGM PGM
A2 A12 A12
A11 A11
A1 A10 O7 A10 O7
A9 O6 A9 O6
A0 A8 O5 A8 O5
CS A7 O4 A7 O4
A6 O3 A6 O3
OE A5 O2 A5 O2
A4 O1 A4 O1
A3 O0 A3 O0
A2 A2
A1 A1
A0 A0
CS U1 CS U0
16K x 16 OE OE
Subsystem
Fig. 7:ROMs
@MUST 28
i. Programmable ROM
This is a ROM that can be programmed to record
information using PROM programmer that
information cannot be changed.
@MUST 29
iii. Electrically Erasable PROM (EEPROM): This
refers to ROM that can be programmed and erased
by electrical signals.
@MUST 30
Input/output Devices
• The input and output devices are known as
peripheral or input/output devices in the
microcomputer.
@MUST 32
i. Parallel Data Transmission
•In parallel methods of communication, data word
are transferred in parallel all at the same time. It is
usually faster than the serial methods.
@MUST 33
ii. Serial Data Transmission
@MUST 35
Parallel I/O Methods
i. Simple I/O
ii. Strobe I/O
iii. Handshake I/O
@MUST 38
Example of Handshaking
@MUST 41
I/O mapped I/O (isolated I/O)
1. Different address spaces for memory and I/O
devices.
@MUST 42
Memory Mapped I/O
1.Same address bus to address memory and I/O
devices
@MUST 43
Comparison Between Memory Mapping and I/O
Mapping
Memory Mapping I/O Mapping
1. The devices are accessed by 1. The devices are access by I/O read
memory read or write cycle or write cycle.
2. 16-bit addresses are provided for 2. 8-bit addresses are provided for I/O
I/O devices devices
3. The I/O ports or peripherals can be 3. In I/O mapping, IN and OUT
treated as memory locations and so instructions are used for data transfer
all instructions related to memory can between I/O device and the
be used for data transfer between I/O microprocessor.
device and the microprocessor
4. The data can be transferred from 4. Data transfer can occur only
any register to ports. between the accumulator and the
ports.
5. In memory mapping a large 5. In I/O Mapping only 28 (256) ports
number of I/O ports can be can be interfaced
interfaced.
@MUST 44
Asynchronous and Synchronous Transmission
Data transmission through a medium can be either asynchronous or
synchronous.
@MUST 45
• Data is transmitted character by character as
you go on typing on a keyboard. As a result,
there is irregular gaps between characters.
However, it is cheaper to implement, as the
one is not required to save the data before
sending.
@MUST 46
Fig. 10: Asynchronous Data Transmission
@MUST 47
2. Synchronous Transmission
In the synchronous data is sent as a continuous stream at a
constant rate making maximum use of available line capacity
@MUST 49
Digital Input/output
• The digital I/O interface allow a computer to
interface with external digital signals.
@MUST 50
DIRECT MEMORY ACCESS
•Direct memory access (DMA) is a feature of
computer systems that allows certain hardware
subsystems to access main memory independent of
the CPU.
•Without DMA, when the CPU is using programmed
input/output, it is typically fully occupied for the
entire duration of the read or write operation, and
is thus unavailable to perform other work.
@MUST 51
• With DMA, the CPU first initiates the transfer, then it does other
operations while the transfer is in progress, and it finally receives
an interrupt from the DMA controller when the operation is
done.
@MUST 53
• In the ISA bus standard, about 16 MB of memory
can be addressed for DMA.
@MUST 54
DMA OPERATION
Fig. 10 shows the DMA operation. Three numbers of
switches are shown in the figure.
@MUST 59
Analog Signals
They are continuously valued signal, such as
temperature or speed, with infinite possible values
in between as shown in fig. 13.
@MUST 60
Digital Signals
•They are discretely valued signal, such as integers, encoded
in binary.
•Digital signals must have a finite set of possible values
usually one of two values – like either 0V or 5V.
• Timing graphs of these signals look like square waves as
shown in Fig. 14.
@MUST 62
Analogue to Digital Conversion
• Analogue to Digital Conversion involves conversion
of an analog input signal into a digital output signal
using a device known as Analog-to-Digital
Converter (ADC).
@MUST 64
1. Sampling
•Sampling is the reduction of a continuous-time signal to a
discrete-time signal, a sequence of real numbers.
@MUST 66
Nyquist Theory
• The Sampling (Nyquist) Theorem is required for
signal reconstruction.
@MUST 67
Sample and Hold Circuit
• Sample & Hold Circuit is used to sample the given
input signal and to hold the sampled value
between clock cycles.
@MUST 68
Fig. 17: Block Diagram of Sample and Hold Amplifier
@MUST 69
2. Quantization of Sampled Signal
•Quantization is the process of taking a continuous voltage
signal and mapping it to a discrete number of voltage levels.
@MUST 70
• Since digital computers are binary in nature, the
number of quantization levels is usually a power
of 2, i.e.,
• where n is the number of
quantization bits.
• The signal may be amplified or attenuated before
going into the ADC, so that the maximum and
minimum voltage levels give the best
compromise between resolution of the signal
levels and minimization of clipping.
@MUST 71
Fig 18: ADC CONVERSION PROCESS
@MUST 72
3. Encoding
@MUST 75
Dual Slope A/D Converter
•It is a slow speed device comprising an integrator circuit formed
by a resistor, capacitor, and operational amplifier combination.
The integrator circuit generates a comparison voltage.
•When the input voltage Vin equal to the voltage of the waveform,
then control circuit captures the counter value which is the digital
value of corresponding analogue input value.
@MUST 76
Fig. 16: Dual Slope A/D Converter
@MUST 77
Flash A/D Converter
•Also known as parallel ADC, it is a widely used
efficient ADC in terms of its speed though expensive.
•This flash ADC circuit consists of a series of
comparators where each one compares the input
signal with a unique reference voltage.
•At each comparator, the output will be high state
when the analog input voltage exceeds the reference
voltage.
•This output is further given to priority encoder for
generating binary code based on higher order input
activity by ignoring other active inputs.
@MUST 78
Fig. 17: Flash A/D Converter
@MUST 79
Successive Approximation A/D Converter
• It is the most modern ADC IC and much faster
than dual slope and flash ADCs.
@MUST 80
• At the start, SAR is reset and as the LOW to HIGH
transition is introduced, the MSB of the SAR is set.
• Then this output is given to the D/A converter that
produces an analog equivalent of the MSB, further
it is compared with the analog input Vin.
• If comparator output is LOW, then MSB will be
cleared by the SAR, otherwise the MSB will be set
to the next position.
• This process continues till all the bits are tried and
after Q0, the SAR makes the parallel output lines to
contain valid data.
@MUST 81
Fig. 18: Successive Approximation A/D Converter
@MUST 82
Digital-to-Analog Converter
• A Digital to Analog Converter, or DAC, is an electronic device
that converts a digital code to an analog signal such as a
voltage, current, or electric charge.
• Signals can easily be stored and transmitted in digital form;
• However, for signals to be recognized by the human senses or
non-digital systems, they are converted to analog form using
a DAC.
• Converting a signal from digital to analog can degrade the
signal.
• Digital to analog converters are mostly manufactured on an
integrated circuit (IC).
• The suitability of a digital to analog converter for a particular
application is determined by several attributes such as speed
and resolution. @MUST 83
Scaled Resistors in Summing Junction
@MUST 84
• Description of above circuit:
1. The circuit has an input count from 0 (when all
the inputs are OFF) to 15 (when all the inputs are
HIGH.).
2. The maximum input count is 2n – 1.i.e all bits set
to 1.
3. The circuit generates an output voltage from zero
to (almost) 10 Volts.
4. The total maximum current through the gain
resistor is given by:
@MUST 85
• The circuit generates an output voltage from
zero to
@MUST 86
R-2R LADDER
• A resistor ladder is an electrical circuit made from
repeating units of resistors.
@MUST 88
• Ideally, the bit inputs are switched between V = 0 (logic 0)
and V = Vref (logic 1).
• For N= 6 bits
@MUST 90
References
Mathvanan, N. 2003. Microprocessor PC hardware
and interfacing
@MUST 91